Overview
The DHT22 (also sold as AM2302) is a high-precision digital temperature and humidity sensor manufactured by Aosong Electronics. It serves as an accuracy upgrade to the basic DHT11, offering wider measurement ranges, 16-bit high-resolution output, sub-zero temperature capability, and decimal precision.
It incorporates a capacitive humidity sensor element, a high-precision NTC thermistor, and a 8-bit microcontroller that outputs a calibrated 40-bit digital signal over a single-bus interface.
Quick reference
Operating voltage (VCC) | 3.3 V to 6.0 V DC (5 V recommended) |
| Humidity range | 0% to 100% RH ( accuracy) |
| Temperature range | to ( accuracy) |
| Resolution | 16-bit (0.1% RH, 0.1 °C resolution) |
| Sampling period | 2.0 seconds (do not sample faster than 0.5 Hz) |
| Interface | Custom Single-Bus 1-Wire protocol |
| Active measuring current | 1.0 mA to 1.5 mA |
Pinout
4-Pin Single In-line Package / 3-Pin Breakout
| Pin | Name | Type | Description |
|---|---|---|---|
| 1 | VCC | Power | Supply voltage (+3.3 V to +6.0 V DC) |
| 2 | DATA | Digital I/O | Single-bus bidirectional data line (requires 1kΩ–10kΩ pull-up) |
| 3 | NC | Not Connected | Do not connect |
| 4 | GND | Power | Ground (0 V) |
Specifications
| Parameter | Symbol | Min | Typ | Max | Unit | Conditions |
|---|---|---|---|---|---|---|
| Supply Voltage | 3.3 | 5.0 | 6.0 | V | DC | |
| Measuring Current | 1.0 | 1.5 | 2.1 | mA | During data transmission | |
| Standby Current | 40 | 50 | 60 | µA | Between measurements | |
| Humidity Measuring Range | 0 | — | 100 | % RH | ||
| Humidity Accuracy | -2.0 | — | +2.0 | % RH | At | |
| Humidity Resolution | — | 0.1 | — | % RH | 16-bit data | |
| Temp Measuring Range | -40 | — | 80 | °C | ||
| Temp Accuracy | -0.5 | — | +0.5 | °C | ||
| Temp Resolution | — | 0.1 | — | °C | 16-bit data | |
| Data Response Time | — | 2.0 | — | s | Minimum interval between reads |
Communication protocol
The DHT22 uses a single-bus protocol sending a 40-bit (5-byte) frame. Unlike the DHT11, both humidity and temperature values are 16-bit signed values multiplied by 10:
- Negative Temperatures: If bit 15 (MSB) of the Temperature word is
1, the temperature is negative. Clear bit 15 and multiply by -0.1. - Checksum Formula: .
- Timing: MCU pulls
DATALOW for 1 to 10 ms, then releases. DHT22 responds with 80 µs LOW + 80 µs HIGH, followed by 40 data bits (50 µs LOW baseline; 26 µs HIGH =0, 70 µs HIGH =1).
Wiring
| DHT22 / AM2302 | → | Microcontroller (Arduino Uno / ESP32) | Notes |
|---|---|---|---|
VCC | 5V (or 3.3V) | Power supply | |
DATA | Digital GPIO Pin (e.g. GPIO4) | Requires – pull-up resistor to VCC | |
GND | GND | Ground |
Common mistakes
- Polling faster than 0.5 Hz (every 2 seconds): The DHT22 requires 2 seconds between measurements to allow internal sensor element stabilization. Requesting data too quickly results in reading errors or internal self-heating.
- Using DHT11 driver code for DHT22: While the physical signaling waveform is identical, the data payload decoding differs. DHT11 sends 8-bit integer bytes, whereas DHT22 sends 16-bit values with decimal multipliers.
- Inadequate pull-up resistor on long wires: For cables longer than 5 meters, use a to pull-up resistor to ensure fast signal rise times.
Notes
- AM2302 is the module version of the DHT22, often pre-wired with flexible lead wires and an internal pull-up resistor.
Assets & downloads
- datasheetdatasheet
- product-pagereference