SHT30 Temperature & Humidity Sensor not found on Arduino reset (Disappearing off i2c bus?)
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- lcoffin
- Posts: 12
- Joined: Wed Mar 23, 2022 11:58 am
SHT30 Temperature & Humidity Sensor not found on Arduino reset (Disappearing off i2c bus?)
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
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
- 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?)
Photos of my test setup:
- Franklin97355
- Posts: 24460
- Joined: Mon Apr 21, 2008 2:33 pm
- 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?)
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.
- 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?)
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?
- 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?)
I've posted to the Arduino forums here: https://forum.arduino.cc/t/adafruit-sht ... us/1067261
https://github.com/adafruit/Adafruit_SH ... 31test.ino
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.Have you tried the SHT30 alone to see if there was a conflict in the i2c bus?
Issue shows up with pretty much any of the code I've tried, but specifically with the example code from the Adafuit_SHT31 library:what code are you using to test?
https://github.com/adafruit/Adafruit_SH ... 31test.ino
- 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?)
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.
- 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?)
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?
- 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?)
0x60 (cryp-to chip)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?
0x6a (IMU)
Which I believe are the internal cryp-to chip and IMU.
(Sorry, apparently can't enter cryp-to as a single word!)
- 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?)
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
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
- lcoffin
- Posts: 12
- Joined: Wed Mar 23, 2022 11:58 am
- 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?)
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)
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)
Please be positive and constructive with your questions and comments.