Hey, I'm trying to get my SHT30 to work with my Pi Pico using those libraries:
https://github.com/rsc1975/micropython-sht30/blob/master/sht30.py
https://github.com/n1kdo/temperature-sht30/blob/master/src/temperature/sht30.py
But with both I run into errors.
The way I have SHT30 connected to my Rpi Pico:
SDA -> GP4
SCL -> GP5
GND -> Physical Pin 23 (GND)
VIN -> 3v3(OUT)
I also tried with 10kOhm pull-up resistors SDA->3v3(OUT) + SCL->3v3(OUT)
I tried doing an I2C scan but it seems it doesn't even see the device using the following code:
py
from machine import I2C, Pin
i2c = I2C(0, scl=Pin(5), sda=Pin(4))
devices = i2c.scan()
if devices:
print("Found I2C devices:", devices)
else:
print("No I2C devices found")
The code I'm trying to test SHT30 with is:
py
from sht30 import SHT30
sensor = SHT30()
temperature, humidity = sensor.measure()
print('Temperature:', temperature, 'ºC, RH:', humidity, '%')
The errors I get:
1. First lib error
MPY: soft reboot
Traceback (most recent call last):
File "<stdin>", line 3, in <module>
File "sht30.py", line 40, in __init__
TypeError: 'id' argument required
2. Second lib error
MPY: soft reboot
[Errno 110] ETIMEDOUT
Traceback (most recent call last):
File "<stdin>", line 5, in <module>
File "sht30.py", line 140, in measure
File "sht30.py", line 104, in send_cmd
TypeError: 'int' object isn't iterable
3. (after adding i2c_id=0 in first lib)
MPY: soft reboot
Traceback (most recent call last):
File "<stdin>", line 5, in <module>
File "sht30.py", line 136, in measure
File "sht30.py", line 101, in send_cmd
SHT30Error: Bus error
4. (after adding i2c_id=1 in first lib)
MPY: soft reboot
Traceback (most recent call last):
File "<stdin>", line 3, in <module>
File "sht30.py", line 40, in __init__
ValueError: bad SCL pin