I have seen many posts regarding the subject line and wanted to post a solution.
Solution first - Switching from DHT Sensor Library by Adafruit to DHTStable by Rob Tillaart solved this problem.
Arduino Nano 33 IoT, operating DHT22 at 3.3V, polling every approx. 8 seconds, 10K pullup resistor on data line, ASAIR AM2302 version of DHT22
Symptoms -
- Randomly produces 'nan' (not a number) rather than expected values.
- Two out of five DHT22s tested sometimes produced very high humidity values: 3318%, 3305%, 3314%, etc. Problem was more pronounced near freezing temperatures. (DHT22 is supposed to be good to -40C.)
Attempted other solutions found such as changing 'delayMicroseconds(40)' to 'delayMicroseconds(20)' or completely commenting out in library .cpp file. But, did not address problem. Switching to this alternate library solved the problem and has given consistent successful results at all temperatures including below freezing for the last few days of testing.
I hope this will save others some time in figuring this one out.