Humidity
DHT22
Single-wire temperature + humidity sensor — slower and pricier than a DHT11 but noticeably more accurate.
AM2302 · Aosong (Guangzhou)
🍌 Simulates in-browserOverview
The DHT22 (the sensor inside is also badged AM2302) reports temperature and humidity over a single timed digital line — not true Dallas 1-Wire, just a similar idea with its own proprietary protocol, so it needs a bit-bang library like DHT.h rather than digitalRead(). It's much more accurate than its cheaper sibling the DHT11, but also much slower: the datasheet caps sampling at 0.5Hz, so polling faster than once every 2 seconds just returns stale data. Most breakout modules already include the required pull-up resistor on DATA.
Wiring tip: single-wire data pin — poll no faster than every 2s, use the DHT library not digitalRead
Pins & wiring
DHT22
Module
Physical pin order shown left to right.
All pins
Hover · click to selectSelected pin
vcc
- Direction
- Power
Full pin table
| Pin | Name | Role | Direction | Note |
|---|---|---|---|---|
| 1 | Power | Power | — | |
| 2 | GPIO | Open-drain | Single-wire timed protocol — use a library like DHT.h, not digitalRead(). | |
| 3 | Other | No connect | No connection on the bare 4-pin DHT22/AM2302 sensor. | |
| 4 | Ground | Passive | — |
Wiring examples
5V host (Arduino Uno)
arduino-uno pinout →| DHT22 pin | Connects to | Note |
|---|---|---|
| VCC | 5V | — |
| DATA | D2 | — |
| GND | GND | — |
You also need
- Optional10 kΩ resistor between DATA and VCC — Only needed if wiring the bare 4-pin AM2302 sensor directly — 3-pin breakout modules already include this resistor.
3.3V host (ESP32)
esp32-devkit-v1 pinout →| DHT22 pin | Connects to | Note |
|---|---|---|
| VCC | 3V3 | — |
| DATA | GPIO4 | — |
| GND | GND | — |
- Works fine down to 3.3V but with a bit less noise margin on the timed protocol — keep the DATA wire short.
Specifications
Footprint
No independently verified physical footprint is on file for this part yet.
Alternatives
Upgrades
Strictly better on the headline spec, but expect to touch firmware or wiring to actually use the difference.
I2C instead of a fussy timed protocol, adds barometric pressure, and samples much faster.
Compare with DHT22- Interface: digital (timed, single-wire) → i2c
- Measures: temperature, humidity → temperature, humidity, pressure
Budget options
Cheaper, with a stated tradeoff — read the reason before swapping.
Cheaper and more precise if you only need temperature — no humidity, but 1-wire and multi-drop capable.
Compare with DHT22- Measures: temperature, humidity → temperature
- Accuracy: ±0.5°C → ±0.5°C (better resolution, 12-bit configurable)
Documents
Datasheets
- DHT22/AM2302 DatasheetAosong
Frequently asked questions
What voltage does the DHT22 run at?
The DHT22 runs at 3.3–6V, per the spec sheet below. Always double-check against the specific board you have — some breakouts add an onboard regulator that changes the usable input range.
How many pins does the DHT22 have?
The DHT22 has 4 pins, communicating over Digital. See the full pinout table in Pins & wiring for each pin's role.
Can I simulate the DHT22 before ordering hardware?
Yes — the DHT22 has a live in-browser simulation model, so you can exercise the circuit before ordering any hardware.
Where is the DHT22 datasheet?
Linked in the Documents section on this page, and cited on every spec that came from it.
Related references
Build it, do not just look it up
Describe your circuit in one sentence and Banana Board wires it to these exact pins, validates it, and lays out a fab-ready PCB.