Components / Sensors / DHT22 Sensor

DHT22 Sensor

Digital sensor commonly used for approximate humidity and temperature sensing.

MeasuresTemperature and relative humidity
Range−40 to 80 °C; 0 to 100 %RH
Accuracy±0.5 °C; ±2 to 5 %RH
InterfaceSingle-wire digital (its own protocol, not 1-Wire)
SensorsReviewedMPN AM2302 (DHT22)Used in 43 projects
DHT22
In short

What is the DHT22 Sensor and what is it used for?

Digital sensor commonly used for approximate humidity and temperature sensing. Makers use it to display ambient measurements.

In the real world

Room climate monitoring

How it works

Sensors convert a physical quantity into an electrical signal. Calibrate, verify module supply, interfaces and environmental limits.

Key specifications

Sensor specValue
MeasuresTemperature and relative humidity
Range−40 to 80 °C; 0 to 100 %RH
Accuracy±0.5 °C; ±2 to 5 %RH
InterfaceSingle-wire digital (its own protocol, not 1-Wire)
Supply voltage3.3 to 6 V
Operating temperature−40 to 80 °C

Pinout

1VCC3.3 to 5 V
2DATASignal, with 10 kΩ pull-up to VCC (modules include it)
3NCNot connected
4GNDGround

How to use it

Read at most once every 2 seconds. On a 3-pin module the pull-up is already fitted. Use the DHT sensor library by Adafruit.

#include <DHT.h>
DHT dht(4, DHT22);
void setup() { Serial.begin(115200); dht.begin(); }
void loop() {
  Serial.printf("%.1f C  %.1f %%\n", dht.readTemperature(), dht.readHumidity());
  delay(2000);
}

Applications

Alternatives

Buy at

Common questions

What is the DHT22 Sensor used for?

In products: room climate monitoring. In maker projects: display ambient measurements.

How does the DHT22 Sensor work?

Sensors convert a physical quantity into an electrical signal. Calibrate, verify module supply, interfaces and environmental limits.

What voltage does the DHT22 Sensor need?

3.3 to 6 V.

How do I connect the DHT22 Sensor to an Arduino or ESP32?

Single-wire digital (its own protocol, not 1-Wire). Pins: 1 VCC (3.3 to 5 V), 2 DATA (Signal, with 10 kΩ pull-up to VCC (modules include it)), 3 NC (Not connected), 4 GND (Ground).

What can I use instead of the DHT22 Sensor?

BME280 Environmental Sensor.