Page 1 of 1

DTH11 temperature and humidity sensor

PostPosted: Wed Nov 30, 2022 11:23 pm
by input54
I have the Maker pi Pico board and I connect the Grove sensor DTH11 on Grove port 1 and I use the following code:
CODE: SELECT_ALL_CODE
 import dht
import machine
import utime

pin = machine.Pin(1)
data_dht = dht.DHT11(pin)

while True:
    utime.sleep(2)
   
    data_dht.measure()
    print()
    print ( f" temperature (C) :{data_dht.temperature()}")
    print ( f" humidity (%): {data_dht.humidity()} ")


But I receive this error:
Traceback (most recent call last):
File "<stdin>", line 11, in <module>
File "dht.py", line 25, in measure
OSError: [Errno 110] ETIMEDOUT

Does someone have a solution for this

Re: DTH11 temperature and humidity sensor

PostPosted: Fri Dec 02, 2022 5:54 pm
by input54
I found out that the Grovesensor needs a library to work, so there is no library for Micropython.
For example, does anyone know what kind of sensors you can use the Grove ports with.