Skip to content
sensors / dht22.md

DHT22 (AM2302)

The accurate cousin of the DHT11. ±0.5°C / ±2 %RH, full -40 to 80°C range, still the same one-wire protocol so library-compatible with DHT11.

In stock Manufacturer 1 files · 407 KB

Specs

Spec Value
Humidity range 0–100 %RH (±2 %)
Temp range -40 to 80 °C (±0.5 °C)
Sample rate 0.5 Hz (read every 2 s minimum)
Voltage 3.3–5 V
Output Custom 1-wire, same protocol as DHT11

Wiring

Identical to DHT11. The 3-pin Gravity-style module has VCC, DATA, GND. Bare 4-pin sensor needs a 10 kΩ pull-up on DATA.

Module Arduino Uno
VCC (+) 5 V
DATA D2
GND (–) GND

Code

#include "DHT.h"
#define DHTPIN  2
#define DHTTYPE DHT22         // <-- only change vs DHT11

DHT dht(DHTPIN, DHTTYPE);
void setup() { Serial.begin(9600); dht.begin(); }
void loop() {
  Serial.print(dht.readTemperature()); Serial.print(" °C  ");
  Serial.print(dht.readHumidity());     Serial.println(" %RH");
  delay(2000);
}

Schematic

The AM2302 module reference design (sensor + pull-up + cap) is in the datasheet PDF.

Last updated: 2026-05-13 · Source on GitHub