Overview

DHT11 and DHT22 are popular digital temperature and humidity sensors that measure ambient temperature and humidity levels. These sensors are ideal for weather stations, climate control systems, and environmental monitoring projects. They provide calibrated digital output and are easy to interface with microcontrollers like Arduino and ESP32.

Technical Specifications

DHT11 vs DHT22 Comparison

Feature DHT11 DHT22
Temperature Range 0-50°C -40-80°C
Temperature Accuracy ±2°C ±0.5°C
Humidity Range 20-90% 0-100%
Humidity Accuracy ±5% ±2-5%
Operating Voltage 3-5.5V 3.3-6V
Sampling Rate 1Hz (1s) 0.5Hz (2s)

Key Features

  • Digital output with calibrated values
  • Single-wire communication protocol
  • Low power consumption
  • Long-term stability
  • No external components required
  • Easy Arduino library support
  • Cost-effective solution
  • Compact size for easy integration

Wiring Diagram

Basic Connection (Arduino Uno)

DHT Pin Arduino Pin
VCC 5V (or 3.3V)
GND GND
DATA Digital Pin 2

Note: Add a 10kΩ pull-up resistor between DATA and VCC pins for reliable communication.

Common Applications

Weather Stations

Local weather monitoring and data logging

Climate Control

HVAC systems and smart thermostats

Greenhouse Monitoring

Plant growth environment optimization

Indoor Air Quality

Home and office environmental monitoring

Quick Info

Difficulty: Beginner
Price Range: ₹50-350
Interface: Digital (Single-wire)

Sample Code

#include "DHT.h"

#define DHTPIN 2
#define DHTTYPE DHT22

DHT dht(DHTPIN, DHTTYPE);

void setup() {
  Serial.begin(9600);
  dht.begin();
}

void loop() {
  float h = dht.readHumidity();
  float t = dht.readTemperature();
  
  Serial.print("Humidity: ");
  Serial.print(h);
  Serial.print("%  Temperature: ");
  Serial.print(t);
  Serial.println("°C");
  
  delay(2000);
}