Need help getting my DHT 20 working on MIcropython

Hi, I’m new to using the pi pico, I’ve been trying to get the DHT 20 I got in my grove kit to work using the code and library on the Seeed wiki but I keep getting this error code.

1 Like

Hello, I have just tested the issue you have fed back. The main reason for this error is probably caused by you not connecting the DHT20 to the correct pins of the Pico.

1 Like

I’m having this exact same problem after checking my pinout several times. I’m using a Grove 4-pin to Dupont cable. I have VCC connected to physical pin 36, GND to 38, and I tried to hook SDA and SLC to both 21 and 22, and 11 and 12.

>>> i2c = I2C(0, scl=Pin(9), sda=Pin(8))
>>> dht20 = DHT20(i2c)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 4, in __init__
  File "<stdin>", line 23, in dht20_read_status
OSError: [Errno 5] EIO

Which is even stranger considering the following scan does return the correct number (56 aka 0x38)

>>> i2c.scan()
[56]

Any idea what could be going wrong?

In the end, I solved this by moving 2 pins down and onto i2c1. No idea why that solved it, but I thought I’d put it in writing for others with the same problem.