- All products
- Sensors & Modules
- Temp + Humidity
- DHT22 Temperature and Humidity Sensor Module (Generic)
- Temp + Humidity
Features:
- Fully calibrated digital output
- Measures both relative humidity and temperature
- Excellent long-term stability
- Low power consumption
- Wide operating voltage range: 3.5V to 5.5V
- Long transmission distance
- Simple 3-pin interface
Principle of Operation:
- Uses a single-wire digital interface (not One-Wire compatible)
- Requires a pull-up resistor on the data line (typically 5K)
- Transmits 5 bytes: 16 bits humidity, 16 bits temperature, and 8-bit checksum
- Data request: host pulls data pin LOW briefly, then HIGH to initiate transmission
Pinout:

| Pin | Label | Description |
|---|---|---|
| 1 | VCC | Power supply (3.5V – 5.5V) |
| 2 | Data | Serial data output |
| 3 | GND | Ground |
Note: Incorrect wiring (e.g., reversing VCC and GND) can permanently damage the sensor.
Applications:
- Weather monitoring systems
- Humidity regulators
- Air conditioners and HVAC control
Circuit Diagram:
Connect the DHT22 sensor to an Arduino as follows:
- VCC → 5V
- GND → GND
- Data → A0 (or any digital pin)

Library:
Install the SimpleDHT library via Arduino IDE: Sketch > Include Library > Add .ZIP Library
Example Arduino Code:
#include "SimpleDHT.h"
int pinDHT22 = 2;
SimpleDHT22 dht22(pinDHT22);
void setup() {
Serial.begin(115200);
}
void loop() {
Serial.println("=================================");
Serial.println("Sample DHT22...");
float temperature = 0;
float humidity = 0;
int err = SimpleDHTErrSuccess;
if ((err = dht22.read2(&temperature, &humidity, NULL)) != SimpleDHTErrSuccess) {
Serial.print("Read DHT22 failed, err=");
Serial.println(err);
delay(2000);
return;
}
Serial.print("Sample OK: ");
Serial.print(temperature);
Serial.print(" *C, ");
Serial.print(humidity);
Serial.println(" RH%");
delay(2500); // DHT22 sampling rate is 0.5Hz
}
Technical Details:
- Supply Voltage: 3.3V to 5.5V
- Temperature Range: -40°C to +125°C
- Temperature Accuracy: ±0.3°C
- Humidity Range: 0% to 100% RH
- Humidity Accuracy: ±2% RH
- Data Format: Digital single-wire serial
- Size: 38 x 20 mm
Comparison with DHT11:
| Feature | DHT22 | DHT11 |
|---|---|---|
| Temperature Range | -40°C to 125°C | 0°C to 50°C |
| Temperature Accuracy | ±0.3°C | ±2°C |
| Humidity Range | 0% to 100% RH | 20% to 80% RH |
| Humidity Accuracy | ±2% RH | ±5% RH |
| Response Time | 2-5 seconds | 5-10 seconds |
| Cost | Higher | Lower |
| Size | Larger | Smaller |
Resources:
Features:
- Fully calibrated digital output
- Measures both relative humidity and temperature
- Excellent long-term stability
- Low power consumption
- Wide operating voltage range: 3.5V to 5.5V
- Long transmission distance
- Simple 3-pin interface
Principle of Operation:
- Uses a single-wire digital interface (not One-Wire compatible)
- Requires a pull-up resistor on the data line (typically 5K)
- Transmits 5 bytes: 16 bits humidity, 16 bits temperature, and 8-bit checksum
- Data request: host pulls data pin LOW briefly, then HIGH to initiate transmission
Pinout:

| Pin | Label | Description |
|---|---|---|
| 1 | VCC | Power supply (3.5V – 5.5V) |
| 2 | Data | Serial data output |
| 3 | GND | Ground |
Note: Incorrect wiring (e.g., reversing VCC and GND) can permanently damage the sensor.
Applications:
- Weather monitoring systems
- Humidity regulators
- Air conditioners and HVAC control
Circuit Diagram:
Connect the DHT22 sensor to an Arduino as follows:
- VCC → 5V
- GND → GND
- Data → A0 (or any digital pin)

Library:
Install the SimpleDHT library via Arduino IDE: Sketch > Include Library > Add .ZIP Library
Example Arduino Code:
#include "SimpleDHT.h"
int pinDHT22 = 2;
SimpleDHT22 dht22(pinDHT22);
void setup() {
Serial.begin(115200);
}
void loop() {
Serial.println("=================================");
Serial.println("Sample DHT22...");
float temperature = 0;
float humidity = 0;
int err = SimpleDHTErrSuccess;
if ((err = dht22.read2(&temperature, &humidity, NULL)) != SimpleDHTErrSuccess) {
Serial.print("Read DHT22 failed, err=");
Serial.println(err);
delay(2000);
return;
}
Serial.print("Sample OK: ");
Serial.print(temperature);
Serial.print(" *C, ");
Serial.print(humidity);
Serial.println(" RH%");
delay(2500); // DHT22 sampling rate is 0.5Hz
}
Technical Details:
- Supply Voltage: 3.3V to 5.5V
- Temperature Range: -40°C to +125°C
- Temperature Accuracy: ±0.3°C
- Humidity Range: 0% to 100% RH
- Humidity Accuracy: ±2% RH
- Data Format: Digital single-wire serial
- Size: 38 x 20 mm
Comparison with DHT11:
| Feature | DHT22 | DHT11 |
|---|---|---|
| Temperature Range | -40°C to 125°C | 0°C to 50°C |
| Temperature Accuracy | ±0.3°C | ±2°C |
| Humidity Range | 0% to 100% RH | 20% to 80% RH |
| Humidity Accuracy | ±2% RH | ±5% RH |
| Response Time | 2-5 seconds | 5-10 seconds |
| Cost | Higher | Lower |
| Size | Larger | Smaller |