Skip to content
Temperature & Humidity

DHT22 (AM2302) Temperature & Humidity Sensor

The upgrade pick for demanding projects — 4x better accuracy, wider range, and the same wiring as DHT11.

The DHT22 (also sold as the AM2302) is a digital temperature and humidity sensor built around a capacitive humidity element and a precision NTC thermistor, both read out over the same single-wire digital bus used by the rest of the DHT family. It's the sensor to reach for once a project outgrows the DHT11 — it holds calibration well, covers a genuinely wide operating range, and drops into the exact same code and wiring most makers already know.

The tradeoffs are modest: it samples at roughly half the rate of the DHT11 (about once every 2 seconds) and costs a couple of dollars more. In exchange you get ±0.5°C temperature accuracy, ±2% RH humidity accuracy, and reliable operation from -40°C up to 80°C — cold enough for an outdoor winter enclosure and hot enough for most indoor equipment bays. If your project only needs a rough indoor reading and you want a faster refresh, the pin- and library-compatible DHT11 is the cheaper, quicker option — see the variants table below.

Specifications

Operating voltage3.3V – 6V DC
Operating current1–1.5 mA (measuring), 40–50 µA (standby)
Temperature range-40°C to 80°C
Temperature accuracy±0.5°C
Humidity range0% to 100% RH
Humidity accuracy±2% RH
Resolution16-bit (0.1°C / 0.1% RH steps)
Sampling rate0.5 Hz max (once every 2s recommended)
InterfaceSingle-wire digital (proprietary, not I2C/SPI)

Pinout

PinNameDescription
1VCCPower, 3.3V–6V DC
2DATASingle-wire digital I/O — needs a 4.7kΩ–10kΩ pull-up to VCC
3NCNot connected — leave floating
4GNDGround

Most breadboard-friendly DHT22 modules (often labeled AM2302) expose only 3 pins (VCC, DATA, GND) because the pull-up resistor and a decoupling capacitor are already built onto the breakout PCB. If you're wiring the bare 4-pin sensor directly, add a 4.7kΩ–10kΩ resistor between DATA and VCC yourself — without it the data line floats and reads fail intermittently or return NaN. Longer cable runs (a few meters) tend to be more reliable with a stronger pull-up toward the 4.7kΩ end of that range.

Variants

DHT22 is the accuracy and range upgrade over the DHT11, at roughly double the price and half the sample rate. Wiring and library calls are identical between the two — just swap DHTTYPE — so it's a drop-in swap if a project needs sub-degree accuracy or has to survive outdoor or freezing conditions. If you want tighter accuracy still, the DHT21 sits between them but is harder to source.

VariantTemp rangeHum rangeAccuracyProtocolPrice
DHT22 (AM2302)-40–80°C0–100% RH±0.5°C / ±2% RHSingle-wire, 0.5 Hz~$3–5
DHT110–50°C20–90% RH±2°C / ±5% RHSingle-wire, 1 Hz~$1–2
DHT21 (AM2301)-40–80°C0–100% RH±0.3°C / ±3% RHSingle-wire, 0.5 Hz~$4–6

Board Integration

Library

DHT sensor library by Adafruit

Arduino IDE → Tools → Manage Libraries → search "DHT sensor library" by Adafruit → Install (accept the prompt to also install the "Adafruit Unified Sensor" dependency)

Wiring

Component pinArduino Uno pinNote
VCC5V
DATAD2Add a 4.7kΩ–10kΩ pull-up resistor between DATA and VCC if you are using the bare 4-pin sensor — most 3-pin AM2302 breakout modules already have one built in.
GNDGND

Example code

C++
  • The very first read after power-up is often invalid — that's normal, not a wiring fault. Give it a couple of seconds.
  • Keep the sensor lead under a few meters unless you're using shielded cable and a stronger pull-up; the single-wire protocol has no error correction and is sensitive to noise on long runs.
  • dht.readTemperature(true) returns Fahrenheit directly if you'd rather not convert yourself.
  • Because the DHT22 reports 0.1° / 0.1% resolution, don't round your Serial prints too aggressively if you want to see the improvement over a DHT11.
View full Arduino Uno guide