How to Hookup Keyes AM2302 DHT22 Humidity Temperature Module
The DHT-22 is a low cost device for measuring humidity and temperature. The DHT sensors are made of two parts, a capacitive humidity sensor and a thermistor. The device requires a 3 to 5V power supply. It uses a single data wire to communicate back to the Arduino. It has a fairly slow update rate and should only be sampled every 2 seconds.
- Arduino Board
- Keyes AM2302 DHT-22 Temperature Humidity Sensor Module
- Breadboard hookup wires
- USB Cable to suite Arduino
Wiring Diagram for connecting Keyes AM2302 DHT-22 Module to a Arduino Board
The breakout board already has the pullup resistor installed so we do not need to connect a resistor to our circuit.
To test this sensor we can use sample sketch shown below. You can download the sketch file and the cactus.iolibrary to communicate with the sensor. It reads the DHT22 every 2 seconds and prints the results to the console on the computer connected to the USB port on the Arduino.
We are using digital pin 2 to connect to the data pin on the sensor. If you are using a different digital pin then you will need to change the pin number defined on line 6 in the sketch code.