SHT30 Temperature & Humidity Sensor not found on Arduino reset (Disappearing off i2c bus?)

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
lcoffin
 
Posts: 12
Joined: Wed Mar 23, 2022 11:58 am

SHT30 Temperature & Humidity Sensor not found on Arduino reset (Disappearing off i2c bus?)

Post by lcoffin »

I'm working with the Adafruit SHT30 temp and humidity sensor connected to an Arduino Nano RP2040 Connect and the sensor works normally for the first execution after applying power to the board, but if either the temp or humidity have been read, when the Arduino is reset via the push button (or when new code is loaded), the sensor is no longer detected on the i2c bus. The most straightforward way to get the sensor to work again is to remove power to the board and then reapply power and then it works again.

I'm seeing this consistently across multiple SHT30s, and with multiple Arduino Nano RP2040 Connects.

I see it consistently across applications *that read the temp or humidity*, including running the example SHT31test script that comes with the SHT31 library from Adafruit (current library version 2.2.0).

The issue does not occur with the example i2c scanner code at: https://learn.adafruit.com/scanning-i2c ... es/arduino, that only scans the i2c bus -- the sensor is detected even after resets.

If I combine the SHT31test script and add in the i2c scanner, the sensor is visible to the scanner at the start of the script, then is no longer visible after the first temp/humidity read. And is not visible to the scanner after reset.

The issue does *not* occur with the SHT31test script *if the readTemperature() and readHumidity() lines are commented out*. That leaves the sht31.begin() code and the code that enables and disables the on-board heater -- so it's not just general communication to the sensor that is causing the problem, but specifically when the temp or humidity are read.

The only similar behavior I was able to find documented online was the reference mentioned in the last post of this thread: viewtopic.php?p=892563 -- however no solution was presented that would work with the SHT30 (it has no reset pin).

From some testing I've done, in an attempt to find a way to get around the problem during boot, the only other way (other than removing power completely from the board) that seems to get around the problem is to remove *either* the Vcc, SDA and SCL lines together, *or* the ground line between the board and the sensor during boot (before trying to access the sensor). Removing any one line other than ground (i.e. Vcc, SDA, or SCL by themselves) or any combination of two lines (Vcc+SDA, Vcc+SCL, SDA+SCL) does not work.

If I try doing an sht31.reset() before the sht31.begin() call it appears to crash the board (the board locks up and flashes its "SOS" signal on the LED - I think this is because it may be trying to access the i2c bus before it has been initialized?)


Any idea what is going wrong or how to get around this issue short of some really ugly hardware hacks involving relays to disconnect the Vcc/SDA/SCL or ground lines?

I'm trying to get these sensors to work for a remote system that would need to be able to survive resets automatically.

Thanks,

---Lawrence

User avatar
lcoffin
 
Posts: 12
Joined: Wed Mar 23, 2022 11:58 am

Re: SHT30 Temperature & Humidity Sensor not found on Arduino reset (Disappearing off i2c bus?)

Post by lcoffin »

Photos of my test setup:
IMG_1143.jpg
IMG_1143.jpg (65.2 KiB) Viewed 401 times
IMG_1144.jpg
IMG_1144.jpg (66.88 KiB) Viewed 401 times

User avatar
Franklin97355
 
Posts: 24460
Joined: Mon Apr 21, 2008 2:33 pm

Re: SHT30 Temperature & Humidity Sensor not found on Arduino reset (Disappearing off i2c bus?)

Post by Franklin97355 »

Have you tried the Arduino forum?

User avatar
lcoffin
 
Posts: 12
Joined: Wed Mar 23, 2022 11:58 am

Re: SHT30 Temperature & Humidity Sensor not found on Arduino reset (Disappearing off i2c bus?)

Post by lcoffin »

Franklin97355 wrote: Tue Dec 13, 2022 8:11 pm Have you tried the Arduino forum?
I haven't posted there about this issue. I've searched on it but haven't seen anything specific to the behavior I am seeing.

I assumed (perhaps incorrectly?) that it was an issue specific to this sensor (the Adafruit SHT30 product), not the board as I'm using other I2C components without problems. There are two I2C components internal to the Arduino Nano RP2040 Connect that always show up on the i2c scans, even after the SHT30s drop out. And I've been using a magnetometer, OLED board, and a multiplexer with no problems. Only these SHT30s are behaving like this.

But I suppose a post over there might uncover something as well. Thanks.

User avatar
Franklin97355
 
Posts: 24460
Joined: Mon Apr 21, 2008 2:33 pm

Re: SHT30 Temperature & Humidity Sensor not found on Arduino reset (Disappearing off i2c bus?)

Post by Franklin97355 »

OK, let me know what you find. Have you tried the SHT30 alone to see if there was a conflict in the i2c bus? Also what code are you using to test?

User avatar
lcoffin
 
Posts: 12
Joined: Wed Mar 23, 2022 11:58 am

Re: SHT30 Temperature & Humidity Sensor not found on Arduino reset (Disappearing off i2c bus?)

Post by lcoffin »

I've posted to the Arduino forums here: https://forum.arduino.cc/t/adafruit-sht ... us/1067261
Have you tried the SHT30 alone to see if there was a conflict in the i2c bus?
I've tried it with no other external I2C components, but the RP2040 Connect does have two internal I2C components that can't be removed.
what code are you using to test?
Issue shows up with pretty much any of the code I've tried, but specifically with the example code from the Adafuit_SHT31 library:
https://github.com/adafruit/Adafruit_SH ... 31test.ino

User avatar
lcoffin
 
Posts: 12
Joined: Wed Mar 23, 2022 11:58 am

Re: SHT30 Temperature & Humidity Sensor not found on Arduino reset (Disappearing off i2c bus?)

Post by lcoffin »

Note that I've also tested the SHT30 sensor with a Raspberry PI 4 and do not see the same behavior -- the sensor remains "visible" on the bus even after reading the temp/humidity. Of course, it's using Python with the corresponding Adafruit SHT31 Python library.

User avatar
adafruit_support_carter
 
Posts: 31903
Joined: Tue Nov 29, 2016 2:45 pm

Re: SHT30 Temperature & Humidity Sensor not found on Arduino reset (Disappearing off i2c bus?)

Post by adafruit_support_carter »

The Arduino Nano RP2040 Connect has some onboard sensors. What I2C addresses do you see when running the I2C scanner sketch *without* the SHT30 connected?

User avatar
lcoffin
 
Posts: 12
Joined: Wed Mar 23, 2022 11:58 am

Re: SHT30 Temperature & Humidity Sensor not found on Arduino reset (Disappearing off i2c bus?)

Post by lcoffin »

adafruit_support_carter wrote: Mon Dec 19, 2022 3:28 pm What I2C addresses do you see when running the I2C scanner sketch *without* the SHT30 connected?
0x60 (cryp-to chip)
0x6a (IMU)

Which I believe are the internal cryp-to chip and IMU.

(Sorry, apparently can't enter cryp-to as a single word!)

User avatar
adafruit_support_carter
 
Posts: 31903
Joined: Tue Nov 29, 2016 2:45 pm

Re: SHT30 Temperature & Humidity Sensor not found on Arduino reset (Disappearing off i2c bus?)

Post by adafruit_support_carter »

Thanks. So not an address conflict. The SHT30 is 0x44.

It sounds like the issue can be demonstrated by:
* Run example SHT31test.ino sketch from library
* Runs as expected outputting sensor values
* Press reset on Nano board
* Sketch reruns and displays "Couldn't find SHT31"
* Behavior persists until SHT30 is power cycled

User avatar
lcoffin
 
Posts: 12
Joined: Wed Mar 23, 2022 11:58 am

Re: SHT30 Temperature & Humidity Sensor not found on Arduino reset (Disappearing off i2c bus?)

Post by lcoffin »

Yes, exactly! :)

User avatar
adafruit2
 
Posts: 22837
Joined: Fri Mar 11, 2005 7:36 pm

Re: SHT30 Temperature & Humidity Sensor not found on Arduino reset (Disappearing off i2c bus?)

Post by adafruit2 »

what if you try using the philhower core? (on the off chance its an i2c controller software bug)


https://github.com/earlephilhower/arduino-pico


also try adding a 100ms delay before initializing the sensor (on the off chance its some startup delay requirement)

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”