DHT11 vs DHT22
Pick the DHT22 when accuracy or cold matters: it reads 0 to 100 %RH at ±2 %RH and -40 to 80 °C at ±0.5 °C with 0.1 resolution (Aosong AM2302/DHT22 datasheet, p. 1), where the DHT11 reads 5 to 95 %RH at ±5 %RH and ±2 °C at 25 °C in whole-percent humidity steps (Aosong DHT11 manual V1.3, pp. 4, 6). Both run on 3.3 V to 5.5 V, use the same three wires and the same library, and must be read no faster than once every 2 seconds, so the DHT11 only wins on price.
Side by side
| DHT11 | DHT22 | |
|---|---|---|
| Humidity rangeAosong DHT11 manual V1.3, pp. 2, 4; Aosong AM2302/DHT22 datasheet, p. 1 | 5 to 95 %RH (20 to 90 %RH before V1.3) | 0 to 100 %RH |
| Humidity accuracyAosong DHT11 manual V1.3, p. 4; Aosong AM2302/DHT22 datasheet, p. 1 | ±5 %RH at 25 °C | ±2 %RH (±5 %RH max) |
| Temperature rangeAosong DHT11 manual V1.3, pp. 2, 4; Aosong AM2302/DHT22 datasheet, p. 1 | -20 to 60 °C (0 to 50 °C before V1.3) | -40 to 80 °C |
| Temperature accuracyAosong DHT11 manual V1.3, p. 4; Aosong AM2302/DHT22 datasheet, p. 1 | ±2 °C at 25 °C | ±0.5 °C |
| ResolutionAosong DHT11 manual V1.3, p. 6; Aosong AM2302/DHT22 datasheet, p. 1 | Whole-percent humidity (decimal byte always 0) | 0.1 %RH and 0.1 °C |
| SupplyAosong DHT11 manual V1.3, p. 5; Aosong AM2302/DHT22 datasheet, pp. 1, 2 | 3.3 V to 5.5 V | 3.3 V to 5.5 V |
| CurrentAosong DHT11 manual V1.3, p. 5; Aosong AM2302/DHT22 datasheet, p. 5 | 0.06 mA standby, 1.0 mA max measuring | 40 to 50 µA standby, 1 to 1.5 mA measuring |
| Fastest readingAosong DHT11 manual V1.3, p. 5; Aosong AM2302/DHT22 datasheet, p. 3 | More than 2 s between reads | 2 s minimum between reads |
| Data frameAosong DHT11 manual V1.3, p. 6; Aosong AM2302/DHT22 datasheet, p. 3 | 40 bits: RH integer, RH decimal, T integer, T decimal, checksum | 40 bits: 16-bit humidity, 16-bit temperature, checksum |
| Bare sensor pinoutAosong DHT11 manual V1.3, p. 3; Aosong AM2302/DHT22 datasheet, p. 2 | 1 VDD, 2 DATA, 3 NC, 4 GND | 1 VDD, 2 DATA, 4 GND |
Which one to pick
- Rough indoor monitoring where ±2 °C and ±5 %RH are close enough (Aosong DHT11 manual V1.3, p. 4).
- Classroom kits and first projects where the lowest part cost matters most.
- Rooms that stay above freezing: older DHT11s are only specified from 0 °C (manual V1.3, revision record, p. 2).
- Weather stations, greenhouses and anything outdoors: it reads down to -40 °C and across the full 0 to 100 %RH range (Aosong AM2302/DHT22 datasheet, p. 1).
- Humidity control with a tight band, such as a dehumidifier or incubator, where ±2 %RH and 0.1 %RH steps matter.
- Logging and graphs, where 0.1 °C resolution gives a smooth curve instead of 1 %RH stairs.
Swapping one for the other
What changes in the wiring and the code.
- The wiring does not change: VCC, DATA and GND on the same pins, 3.3 V to 5.5 V on both (DHT11 manual V1.3, p. 5; DHT22 datasheet, pp. 1, 2). Wire 3-pin breakouts by their printed labels, since the pin order differs between makers.
- Change one word in the code: construct the library object with the new type, DHT dht(PIN, DHT22) instead of DHT11. The two frames are decoded differently, so the wrong type gives nonsense readings.
- Keep the pull-up from DATA to VCC. Aosong recommends 4.7 kΩ for the DHT11 on cables under 5 m (manual V1.3, p. 5); 10 kΩ is the usual value on DHT22 boards, and most 3-pin breakouts already carry one.
- Keep the timing: wait 1 s after power-up and leave at least 2 s between reads on both (DHT11 manual V1.3, pp. 5, 7; DHT22 datasheet, pp. 2, 3).
DHT11 or DHT22: questions
Is the DHT22 a drop-in replacement for the DHT11?
Yes for the wiring: both take 3.3 V to 5.5 V and use VCC, DATA and GND (Aosong DHT11 manual V1.3, p. 5; AM2302/DHT22 datasheet, pp. 1, 2). In the code, change the sensor type in the library constructor from DHT11 to DHT22, because the two send their 40-bit frames in different formats.
Which is more accurate, the DHT11 or the DHT22?
The DHT22: ±2 %RH and ±0.5 °C (Aosong AM2302/DHT22 datasheet, p. 1) against the DHT11's ±5 %RH and ±2 °C at 25 °C (Aosong DHT11 manual V1.3, p. 4). The DHT22 also reports in 0.1 steps, while the DHT11's humidity decimal byte is always zero (p. 6).
Can the DHT11 measure below freezing?
Only a recent one. Aosong's manual V1.3 rates it from -20 °C, but its revision record shows earlier DHT11s were specified 0 to 50 °C, and many modules still follow that range (manual V1.3, pp. 2, 4). The DHT22 is rated -40 to 80 °C (datasheet, p. 1), so it is the safe choice outdoors.
Can I read either sensor faster than every 2 seconds?
No. Both need at least 2 seconds between reads (DHT11 manual V1.3, p. 5; DHT22 datasheet, p. 3). Faster polling returns the previous value or a checksum error. If you need fast temperature readings, neither DHT sensor fits.
Do both sensors work on a 3.3 V ESP32 or Raspberry Pi Pico?
Yes. Both run from 3.3 V to 5.5 V (DHT11 manual V1.3, p. 5; DHT22 datasheet, pp. 1, 2). Power the sensor and its pull-up from 3.3 V so DATA never rises above the board's logic level, and keep the cable short at 3.3 V.
The two references
Checked on 2026-10-29 against 2 sources, the makers’ datasheets first.
This comparison as plain Markdown. /compare/dht11-vs-dht22.md

