Troubleshooting - Micropressure Sensor Not Detected

Looking for some suggestions on troubleshooting connections between the Sparkfun Micropressure Sensor (SEN-16476) and the Sparkfun Thing Plus ESP32 WROOM USB-C (WRL-20168). I purchased these intending to follow along with the Atmospheric Pressure guide (Measuring Height with Atmospheric Pressure - SparkFun Learn).

Hardware setup is identical to the guide: QWIIC cable connecting the Thing Plus with the Sensor. Thing Plus powered over USB. Software is using Arduino IDE 2.3.2, with Sparkfun MicroPressure Library v1.0.1 included in sketches.

First attempt used the Height Demo code found in the guide. When connected, the power LED on both the Thing Plus and the board are lit. When run, the Thing Plus returns:

19:00:12.558 -> ets Jul 29 2019 12:21:46
19:00:12.558 -> 
19:00:12.558 -> rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
19:00:12.605 -> configsip: 0, SPIWP:0xee
19:00:12.605 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
19:00:12.605 -> mode:DIO, clock div:1
19:00:12.605 -> load:0x3fff0018,len:4
19:00:12.605 -> load:0x3fff001c,len:1044
19:00:12.605 -> load:0x40078000,len:8896
19:00:12.605 -> load:0x40080400,len:5816
19:00:12.605 -> entry 0x400806ac
19:00:12.731 -> MicroPressure height demo begin!
19:00:12.731 -> Cannot connect to MicroPressure sensor.

In all configurations I can think of, the MicroPressure sensor remains undetectable to the ThingPlus.

Troubleshooting So Far:

  • Replacement ThingPlus cannot detect MicroPressure sensor.
  • Replacement MicroPressure sensor is undetected by either ThingPlus.
  • Six different QWIIC cables, no change in output message.
  • Attempted connections to each QWIIC port on the sensor.
  • Different power sources: PC connected or appropriate voltage battery connected.
  • Alternative sketch from the MicroPressure sensor hookup guide, no connection to sensor.
  • Manually specifying the address (0x18, Wire1) for the MicroPressure Sensor as per its manual.
  • An I2C scanner script detects no connected devices.
  • No change between version 1.0.0 and 1.0.1 of SparkFun MicroPressure Library
  • Blink Demo on each SparkFun Thing Plus works - boards run sketches fine.
  • Full reinstall of Arduino IDE on main computer, and attempted sketch compiling and upload on second computer.

I feel like I must be missing something fundamental for the ThingPlus to not detect the sensor at all in any of these combinations. Would appreciate any ideas!

It looks like the demo tries to use Wire, not Wire1 Measuring Height with Atmospheric Pressure - SparkFun Learn

How long are your qwiic cables? Try disabling the i2c pull up resistors by cutting the trace on the back of the board and re-attempt (easily reversible by replacing a solder blob)

Thanks for replying. I tried the Example Script in the Micropressure Library with specifying (0x18, Wire) as well as (0x18, Wire1) and there was no change.

The cables are 5, 10 and 15cm long.

With traces cut on I2C pull-up resistors, no change in board being able to see the sensor.

Hi

You tried a lot but still not get the right results.

Your program never came out from this loop:
if (!mpr.begin()) {
Serial.println(“Cannot connect to MicroPressure sensor.”);
while (1);
}

because mpr.begin() never returned false or 0.
This is a kind of harware lock.

Have you checked the pin assignments in the code:
There is seems right pin connection issue:

#define EOC_PIN  -1
#define RST_PIN  -1
#define MIN_PSI   0
#define MAX_PSI   25

SparkFun_MicroPressure mpr(EOC_PIN, RST_PIN, MIN_PSI, MAX_PSI);

Specially check these two pin signals: 
#define EOC_PIN  -1
#define RST_PIN  -1
1 Like

Thanks for your reply.

The loop in the setup portion that you suggest is causing a hardware lock, can you elaborate on this further? To my knowledge this loop prevents the program from continuing if an error occurs, i.e. if the sensor cannot be connected.

To test this I removed the while(1) loop and the program continued as if the sensor was connected, but returning NaN values.

Regarding the pin assignments, the values are consistent with the example script in library, board documentation from Honeywell and the two guides (hookup guide and atmospheric height guide). Would you have expected other values?

Hi
There is no data read from the sensor so your program shown null values.

I assumed you have chosen the right board in the adruino IDE.

Try the following code to debug your system there. Make sure EOC and RST pin are connected to the right IO pins. Here IO 9 and 10 have used. You can modify accordingly to your hardware connection there .
You may need to use pull up external resistors in the SDA and SCL line, please check.

#include <Wire.h>

const int EOC_PIN = 9; // End of Conversion pin, high for data ready
const int RST_PIN = 10; // Reset pin, low for reset
const uint8_t SENSOR_ADDRESS = 0x18; // Sensor I2C address

void setup() {
// Initialize Serial for output
Serial.begin(115200);

// Initialize I2C communication
Wire.begin();

// Set up EOC and RST pins
pinMode(EOC_PIN, INPUT);
pinMode(RST_PIN, OUTPUT);

// Perform sensor reset
resetSensor();

// Scan for I2C devices
scanI2CDevices();

// Check if the sensor is connected
if (checkSensorConnection()) {
Serial.println(“Sensor found! Polling EOC pin for data…”);
} else {
Serial.println(“Sensor not found, check connection and power.”);
}
}

void loop() {
// Continuously poll the EOC pin for data availability
if (digitalRead(EOC_PIN) == HIGH) {
readPressure();
}
}

void resetSensor() {
// Reset the sensor by toggling the RST pin
Serial.println(“Resetting sensor…”);
digitalWrite(RST_PIN, LOW); // Active low reset
delay(10); // Hold reset for 10ms
digitalWrite(RST_PIN, HIGH); // Release reset
delay(10); // Wait for sensor to be ready
}

void scanI2CDevices() {
Serial.println(“Scanning I2C devices…”);
for (uint8_t address = 1; address < 127; address++) {
Wire.beginTransmission(address);
if (Wire.endTransmission() == 0) {
Serial.print(“I2C device found at address 0x”);
Serial.println(address, HEX);
}
}
}

bool checkSensorConnection() {
Wire.beginTransmission(SENSOR_ADDRESS);
return (Wire.endTransmission() == 0);
}

void readPressure() {
// Request 24-bit pressure data from the sensor
Wire.beginTransmission(SENSOR_ADDRESS);
Wire.requestFrom(SENSOR_ADDRESS, 3); // Request 3 bytes (24 bits)

if (Wire.available() == 3) {
// Read each byte and print in hex format
uint8_t byte1 = Wire.read();
uint8_t byte2 = Wire.read();
uint8_t byte3 = Wire.read();

// Print each byte in hex format
Serial.print("Pressure Data (Hex): ");
Serial.print(byte1, HEX);
Serial.print(" ");
Serial.print(byte2, HEX);
Serial.print(" ");
Serial.println(byte3, HEX);

} else {
Serial.println(“Failed to read pressure data.”);
}
}

Thanks for the debug code Raj, it’s showing up with errors so I will need some time to learn how to adapt and run it. Hopefully it gives me some ideas to try.

I realised that I was using tutorials that used different boards:

  • Atmospheric Pressure guide uses a Thing Plus ESP32 WROOM (Micro-B) [WRL-15663]
  • Hook-up guide uses a Redboard Qwiic [DEV-15123]

I had ordered 2 x Thing Plus thinking they were interchangeable and purchased two Thing Plus ESP32 WROOM (C) [WRL-20168].

I received a Redboard Qwiic this morning and the sensor works with the hook-up guide example code, confirming that the sensor is not faulty. However, I would ideally like to run the sensor with the smaller Thing Plus USB-C board for space reasons.

The only notable difference I can see on the newer Thing Plus USB-C is the CH340C serial-to-UART bridge which would be different from the Micro-B variant. I need to learn a lot more before I can try to adjust the code from the guides to run on the USB-C Thing Plus instead of the Micro-B variant they were written for.

Thank you for the replies so far, I will reply below if I can adapt the code to run on the newer Thing Plus.

Solved!

As I assumed the Thing Plus range was interchangable, I was using the SparkFun packages in Arduino Uno as recommended in setup guides. However, there is no board definition for ‘Thing Plus C’ in the SparkFun ESP32 board definitions, only ‘Thing Plus’. This is noted at the bottom of the Sparkfun Arduino Boards Github page that ESP32-based boards require a separate board file, but I must have missed that when installing packages.

After some digging, there is a Thing Plus C board definition in the ‘esp32’ package by Espressif Systems. Once installed, everything runs as expected:

  • I2C scanner detects the sensor at 0x18
  • code from Atmospheric Pressure guide works and detects pressure
  • code from sensor Hook-up guide works and detects pressure
2 Likes

Thank you for sharing your solution, it will help others that find themselves in the same situation.

Have a great weekend!

Well done.