AM2302 / DHT22 humidity and temperature sensor connection guide
AM2302 / DHT22 humidity and temperature sensor (Four-position sensor interface) connection guide. Read humidity and temperature.
Four-position sensor interface
4 contacts Current packageRead humidity and temperature
RequiredFor the 5 V circuit shown, use a GPIO compatible with 5 V and a 5.1 kΩ SDA pull-up to 5 V for cables under 30 m. Leave pin 3 (NC) open. With a 3.3 V supply and compatible GPIO, pull SDA up to 3.3 V and keep the cable at 1 m or less to limit supply voltage drop.
- +5 V
- Host 5 V
- R1.1
- Ground
- Host ground
- Data line
- ↔
- Host GPIO
- R1.2
Bench checks
- Wait more than 2 s after power-up before sending a command. Drive SDA low for 1 ms (Table 7 allows 0.8–20 ms), then release SDA to high impedance and listen for the response.
- Each reply contains the previous measurement. After a long pause, read twice at least 2 s apart and use the second reply for a fresh value.
- Check that the low eight bits of the sum of the first four bytes equal the fifth byte before decoding.
- Decode humidity as an unsigned big-endian value in tenths of percent. Decode temperature as sign and magnitude in tenths of a degree Celsius.
Aosong / ASAIR AM2302 Technical Manual V1.0, pp. 4–6, §§ 3, 5.1–5.3, and Table 7.
Four-position sensor interface wiring map
Four-position sensor interface
1 · VDD
Device supply. Place the bypass capacitor close to this pin.
Models and documents
Aosong also markets AM2302 as DHT22. This map shows the four positions in the manufacturer manual. Pin 3 carries no signal.
- AM2302 / DHT22
- Equivalent product names for the documented Aosong sensor.
- AM2302 manufacturer documentation· Aosong / ASAIR AM2302 Technical Manual V1.0, pp. 4–6, §§ 3, 5.1–5.3, and Table 7.
