DTH11 temperature and humidity sensor

Digital Fiber, Photoelectric, Laser Range, Optical, Temperature, Rotary Encoder, Ultrasonic, Gas, Gyro, Accelerometer, FlexiBend, Flexiforce, Compass......

DTH11 temperature and humidity sensor

Postby input54 » Wed Nov 30, 2022 11:23 pm

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
input54
Newbie
 
Posts: 9
Joined: Mon Nov 14, 2022 6:12 pm

Re: DTH11 temperature and humidity sensor

Postby input54 » Fri Dec 02, 2022 5:54 pm

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.
input54
Newbie
 
Posts: 9
Joined: Mon Nov 14, 2022 6:12 pm


Return to Sensor

Who is online

Users browsing this forum: No registered users and 1 guest