Description
The DHT22 Humidity / Temperature Sensor Module uses a 1-wire interface to report both humidity (0 – 99.9%) and temperature (-40 – 80°C).
PACKAGE INCLUDES:
- DHT22 Humidity / Temperature Sensor Module
- Female / Female 3 x 8″ jumper cable for connecting the module to a microcontroller.
KEY FEATURES OF DHT22 HUMIDITY / TEMPERATURE MODULE:
- Reports humidity over range of 0% to 99.9%
- Reports temperature over range of -40°C to 80°C
- Uses 1-Wire interface
- 3.3 and 5V logic compatible
This module utilizes the DHT22 which is a combined humidity and temperature sensor assembly. Note that AM2302 is just another name sometimes used for the DHT22 and you may see this marking on the module.
The DHT22 sensor is capable of reading humidity over the full range of 0 to 99.9% with an accuracy of +/- 2% and temperature over the range of -40 to 125°C with an accuracy of +/- 0.5°C. The humidity accuracy increases to +/-5% at temperature extremes.
The device does have a minimum sampling time of 2 seconds so the sensor cannot be polled more often than every 2 seconds or bad data may be retrieved.
Module Connections
The module has a 3-pin header on the assembly.
1 x 3 Header
- ‘+’ = Connect to 3.3V to 5V.
- OUT = Digital sensor I/O – Connects to a digital pin on a microcontroller
- ‘- ‘ = Connect to system ground. This ground needs to be in common with the microcontroller.
The sensor is written and read via a single digital pin and requires the use of a library for the communications. With an Arduino, the DHTLib library can be downloaded from the Arduino site or GitHub.
OUR EVALUATION RESULTS:
This is a commonly used module for basic humidity and temperature measurement. Once up and running with a microcontroller, it is easy to test basic functionality of the module by breathing on the sensor. That will increase both humidity and temperature temporarily.
The DHT22 has a larger measurement range and higher accuracy compared to the similar DHT11 sensor which is why it costs more. If you are looking for a less expensive option, check out our DHT11 Module below.
These sensors are often spec’d to read temps of up to 125C. While the circuit will indeed measure temps that high, the plastic housing will start to deform, therefore I recommend not using it at temps higher than 80C which is higher than most applications will require anyway.
The sensor can not be polled faster than once every 2 seconds, otherwise data errors may occur. If you get occasional bad readings (such as -999.00) try increasing the delay between reads. Our sample program below uses a 3 second delay just to be safe.
Once the DHT library is installed, using the device is fairly simple as shown in the code below. We are using pin 7 for the digital I/O, but this can be changed to any digital pin.
DHT22 Humidity / Temperature Sensor Test Program
/* DHT22 Temp / Humidity sensor module test Basic code for exercising the module. Requires DHT library to be installed */ #include <dht.h> // Include the DHT library dht DHT; // Create instance of DHT object int const DHT22_PIN = 7; // Connects to sensor I/O, use any digital pin int sensor; // Dummy variable for sensor read //=============================================================================== // Initialization //=============================================================================== void setup() { Serial.begin(9600); // Initialize serial comm } //=============================================================================== // Main //=============================================================================== void loop() { sensor = DHT.read22(DHT22_PIN); // Read sensor Serial.print("Temperature = "); // Printout returned results Serial.print(DHT.temperature); Serial.print(" C "); Serial.print("Humidity = "); Serial.print(DHT.humidity); Serial.println(" %"); delay(3000); // 2 sec min read time, so using 3 to be safe }
BEFORE THEY ARE SHIPPED, THESE MODULES ARE:
- Sample inspected and tested for correct operation
Notes:
- Wire colors may vary from the pics
Technical Specifications
Maximum Ratings | ||
Vcc | Range | 3.3 to 5.5V |
Vmax | <500uA | |
Tmin | Minimum Sampling Period | 2 seconds |
Operating Ratings | ||
Humidity | Range | 0% to 99.9%RH (+/- 2%RH) |
Temperature | -40 to 80°C (+/- 0.5°C) | |
Dimensions | L x W (PCB) | 37 x 16mm (1.5 x 0.6″) |
Datasheet | DHT22 |