DHTNew: Sensors getting stuck at a certain value

I have two AM2302s connected to pins 0 and 2 of an ESP32, after a while of working perfectly they only return a static value…

My loop looks like this:

  1. AM2302s get read using .read();
  2. Values get sent to InfluxDB using .getTemperature(); and .getHumidity();
  3. 10 second wait

I have tried adding .reset(); before the 10 second wait but that only made them return 0 or -999 instead of a static value. chrome_9umnscGanw

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 37 (20 by maintainers)

Most upvoted comments

Okay! Relais are here, I changed this value to 90

You can try to tune the line 328 in the .cpp file

if (_waitFor(HIGH, 70)) return DHTLIB_ERROR_TIMEOUT_C;

try a value of 80 or even 90 to give the handshake a bit more time.

I also added a small array to keep track of past values and if the last three values are the same, the relais will dis and reconnect the sensor.

Currently i cant upload the code as im not Home, but i can do it later today

Ok so apparently they just forgot to update the status on their Website… I just got a mail saying it’s gonna be delivered today…