DHT22 AM2302 Sensor - Digital Temperature and Humidity Module for Weather Stations and IoT Monitoring The DHT22, also known as AM2302, is a digital temperature and humidity sensor for indoor climate monitoring, weather-station prototypes, greenhouse experiments, and microcontroller data logging. It uses a single-wire digital signal, so only one GPIO pin is needed in addition to power and ground, making it easy to integrate into Arduino, ESP32, Raspberry Pi, and similar controller platforms. This version is a good upgrade from DHT11-class sensors when a wider measurement range and better humidity accuracy are needed. It is useful with the ELAB Nano V3, the Raspberry Pi Pico W, and larger classroom builds using an UNO R3 Prototype Expansion Board. For more advanced environmental sensing that includes gas and pressure, compare it with the BME680 Sensor Board. The DHT22 is best for low-rate environmental readings rather than fast control loops. Keep the sampling interval at about two seconds or longer, mount it where air can circulate, and avoid placing it directly beside heaters, voltage regulators, or sunlit enclosure walls. Technical Specifications Parameter Value SKU TB-DHT22 Model DHT22 / AM2302 Measured Parameters Temperature and relative humidity Output Signal Digital single-bus signal Supply Voltage 3.3V-6V DC Humidity Range 0-100% RH Temperature Range -40C to +80C Humidity Accuracy Typically +/-2% RH, max around +/-5% RH Temperature Accuracy Typically +/-0.5C Resolution 0.1C and 0.1% RH Recommended Sampling Period 2 seconds or longer Dimensions Approx. 15 x 25 x 7.7mm Long-Term Stability Approx. +/-0.5% RH/year Typical Applications Weather stations, indoor climate logs, greenhouse monitoring, smart-home sensors Board Layout & Label Guide VCC - Connect to 3.3V or 5V depending on the host system. DATA - Single digital data line connected to one microcontroller GPIO. GND - Ground reference shared with the controller. Sensor Housing - Keep exposed to ambient air for accurate temperature and humidity readings. Pull-Up Requirement - Many DHT22 circuits use a pull-up resistor on DATA; confirm whether your module already includes it. Airflow Area - Avoid blocking the front housing or placing the sensor inside a sealed box. Thermal Placement - Keep away from heat-generating components for better accuracy. Sampling Note - Read no faster than about every two seconds to avoid stale or failed measurements. Application Scenarios 1. Arduino Serial Temperature and Humidity Use the common DHT library to print readings every two seconds. #include #define DHTPIN 2 #define DHTTYPE DHT22 DHT dht(DHTPIN, DHTTYPE); void setup() { Serial.begin(115200); dht.begin(); } void loop() { float humidity = dht.readHumidity(); float tempC = dht.readTemperature(); Serial.print("Humidity: "); Serial.print(humidity); Serial.print("% Temp: "); Serial.println(tempC); delay(2000); } 2. Heat Index Warning Calculate heat index and light an LED when indoor conditions become uncomfortable. #include DHT dht(2, DHT22); const int ledPin = 13; void setup() { pinMode(ledPin, OUTPUT); dht.begin(); } void loop() { float h = dht.readHumidity(); float t = dht.readTemperature(); float index = dht.computeHeatIndex(t, h, false); digitalWrite(ledPin, index > 30.0 ? HIGH : LOW); delay(2000); } 3. Raspberry Pi Python Logger Log readings to CSV for room monitoring or greenhouse experiments. import time import board import adafruit_dht dht = adafruit_dht.DHT22(board.D4) with open("dht22_log.csv", "a", encoding="utf-8") as log: while True: try: log.write(f"{time.time():.0f},{dht.temperature},{dht.humidity}\n") log.flush() except RuntimeError: pass time.sleep(2) 4. MicroPython Basic Read Read a DHT22 on an ESP32 or compatible MicroPython board. import dht from machine import Pin import time sensor = dht.DHT22(Pin(4)) while True: sensor.measure() print(sensor.temperature(), sensor.humidity()) time.sleep(2) Packing List 1 x DHT22 AM2302 Temperature and Humidity Sensor FAQ Q: What does the DHT22 measure?A: It measures temperature and relative humidity. Q: How often can it be read?A: Use a sampling interval of about two seconds or longer. Q: Is it better than DHT11?A: Yes, it offers wider range and better accuracy than typical DHT11 sensors. Q: Does it output analog voltage?A: No. It outputs a digital single-bus signal. Q: Can it work with Raspberry Pi?A: Yes, with suitable libraries and correct GPIO wiring. Q: Does the DATA pin need a pull-up resistor?A: Many designs require one; check whether your module already includes it. Q: Can it be used outdoors?A: It can be used in outdoor projects only with proper weather protection and airflow. Q: What causes failed reads?A: Reading too fast, weak wiring, missing pull-up, long cable noise, or unstable power are common causes.