Page 1 of 1

DHT21 humidity sensor doesnt work

Posted: Sat Jun 09, 2018 5:08 am
by VladVons
I have DHT21 sensor, 3 wires, 4,7 k resistor.
It causes exception ETIMEOUT

Code: Select all

import dht
import time

aPin = 14
#Pin = machine.Pin(aPin, machine.Pin.IN, machine.Pin.PULL_UP)
Pin = machine.Pin(aPin)
Obj = dht.DHT22(Pin)
time.sleep_ms(250)
Obj.measure()
-> exception : ETIMEOUT
 
native GitHub micropython driver source here:
https://github.com/micropython/micropyt ... /dht/dht.c
However this driver works good on micropython wirh DHT22 sensor

It seems that DHT21 and DHT22 are similar. Or not?
On a raspberry i use another python driver from Adafruit_DHT and both DHT21 and DHT21 are working good

how to solve this problem using micropython on ESP8266 chip?

Re: DHT21 humidity sensor doesnt work

Posted: Fri Nov 16, 2018 6:35 pm
by SvenW
See https://github.com/micropython/micropython/issues/4233

I think this addresses our problem. ;)

Re: DHT21 humidity sensor doesnt work

Posted: Fri Nov 16, 2018 6:50 pm
by SvenW
Do you use version 1.9.4?