What is a DHT11 sensor ?
The DHT11 is an ultra-simple digital humidity and temperature sensor to use.
It combines:
- a capacitive humidity sensor,
- an integrated thermistor,
- and an analog-to-digital converter (ADC),
- all controlled by a small internal chip that transmits data in a 1-wire digital format.
It is an ideal choice for beginner projects, basic weather stations, or DIY home automation.
Operating principle
The sensor performs an internal conversion every 1 to 2 seconds.
The temperature and humidity values are then transmitted bit by bit via a single data pin (DATA), according to a precise timing protocol.
Message structure:
[8 bits HR int] [8 bits HR decimal] [8 bits T int] [8 bits T décimal] [8 bits checksum]
💡 Each measurement lasts about 20 ms, with a minimum cycle of 1 second between two readings.
Example of digital conversion (Arduino)
#include "DHT.h" #define DHTPIN 2 #define DHTTYPE DHT11 DHT dht(DHTPIN, DHTTYPE); void setup() { Serial.begin(9600); dht.begin(); } void loop() { float h = dht.readHumidity(); float t = dht.readTemperature(); Serial.print("Humidité: "); Serial.print(h); Serial.print("% Température: "); Serial.print(t); Serial.println("°C"); delay(2000); }
✅ Example:
Humidity: 56.0 % Temperature: 23.0 °C
Principle diagram
+5V │ [DHT11] │ DATA ─────┐ │ NC │ │ GND ──────┘ │ └── Pull-up resistance 10 kΩ on DATA
💡 The DATA pin requires a pull-up resistor between DATA and VCC.
Application areas
🌦️ Mini weather stations
🏠 Home automation projects (ventilation, air conditioning)
🧠 Educational IoT and ambient sensors
🧪 Prototypes and electronic models
🔋 Non-critical low-power systems