Close

Testing the AM2302/DHT22 sensor

A project log for The Home Measurement Project

An excuse to use up all those ESP modules I hoarded

ken-yapKen Yap 02/20/2025 at 10:010 Comments

Since my soldering station is out of action until my new iron arrives, I can't build anything but can write firmware, design PCBs, and test modules provided the wiring is with connectors and not solder. So this is an opportune time to get back to this project.

Today's sensor is the AM2302/DHT22 temperature and humidity sensor. It's very old hat, er old sensor. The datasheet dates from 2013.

Of course there are Arduino sketches for it. I installed AM2302 Sensor. I ran the sensor health check sketch and got this output. (Actually I made the silly mistake of thinking that this was a DS18B20 sensor until its sketch failed to work and then I belatedly checked the legend on the DHT22 sensor.)

>>> AM2302-sensor Health Check <<<

Sensor status: 0
Number checksum errors: 0
Number timeout errors: 0
Number read freq errors: 0

Temperature: 24.40
Humidity: 63.90 

That looks good and agrees with my wall sensor. Very comfy here.

Incidentally there is an annoying flaw in the Arduino IDE. The serial monitor output window cannot be copied. I had to capture a portion of the screen and run the picture through OCR to get the above output.

Discussions