Skip to content
A project ofgwark.dev

Aosong · Integrated circuit

DHT22 / AM2302 Humidity and Temperature Sensor

Humidity and temperature on one wire, in a plastic grille you can read in about ten lines of code. Slow, cheap and everywhere.

Cheat sheet (SVG)
Logic level
3.3-5.5 V
Package
4-pin single row, 2.54 mm

1.Pinout diagram

Highlight a signalhover to preview, click to keep

Grille facing you, left to right

DHT22

Pin detail

Hover a pin for its mappings and gotchas. Click to keep it here.

Logic level
3.3-5.5 V
Package
4-pin single row, 2.54 mm

Fig. 1. DHT22 / AM2302 Humidity and Temperature Sensor, 4-pin single row, 2.54 mm. Hover or tap a signal to light up every pin that carries it.

2.Watch out

3.Minimum circuit

What has to go around the chip before it will run.

VCCGNDDHT221 kOhm between DATA (2) and VCC1 kOhm100 nF ceramic between VDD (1) and GND100 nFceramicVDD (1) to VCCGND (4) to GNDVDD 1VDD 1DATA 2GND 4
Fig. 2. Minimum circuit, drawn from Table 1. Dashed parts are optional. Crossing wires are not connected.
Table 1. External parts, and why each one is there.
PartBetween
1 kOhmDATA (2) to VCC
100 nF ceramicoptionalVDD (1) to GND

That is the whole circuit. Data goes to any GPIO, and the sensor needs a second between power-up and the first read.

4.Full pin reference

Every pin, alias and mapping. This is the table that prints.

Table 2. Pin assignments.

Complete pin reference for DHT22 / AM2302 Humidity and Temperature Sensor
PinNameFunctions

Looking for a substitute?

Primary sources

Found a wrong pin? The whole board is one file, data/boards/dht22.json.

Edit this file on GitHubReport it instead