DHT22 stops working

I had problems too with DHT22 sensors failing randomly after hours or sometimes days. A workaround was to power the sensor from a digital output, and simply turn on the sensor for one reading, then off until next reading..

Then, I analyzed the data sent by the sensor, and there is a ~13 microseconds delay after every 8 data bits sent by the sensor. I verified it with multiple sensors that I had, all acting the same.

No DHT library - that I know of - take care of this delay (not mentioned in the datasheet). And, all these libraries wait ~1ms for the start signal, but the datasheet says "1-10ms", so IMO it's more 10ms than 1ms...

So I made my own DHT library, mainly changing this 1ms to something like 15ms, and added a delayMicroseconds(13) after every 8 bits of data received, and as far as I remember, it solved the problems...Until I replaced these crappy sensors with Bosch BME280..!

1 Like