Function: what the DHT11 does in a circuit
Measures air temperature (0 to 50 °C) and relative humidity (20 to 90%) and sends both as numbers on one data wire.
- Measures air temperature
- Measures relative humidity
- Feeds weather stations and room monitors
DHT11 key facts
| Supply | 3.3 V to 5.5 V |
|---|---|
| Temperature | 0 to 50 °C, ±2 °C, whole numbers |
| Humidity | 20 to 90%, ±5%, whole numbers |
| Reading rate | one every 1 to 2 seconds |
| Pins | S (data), + (VCC), − (GND) |
| Library | DHT (Adafruit) |
DHT11 pinout
The legs from left to right, as the part is drawn in the simulator:
| No. | Name |
|---|---|
| 1 | S (data) |
| 2 | + (VCC) |
| 3 | − (GND) |
How it works
Inside the blue case are a humidity-sensing layer between two electrodes, a thermistor and a small chip. The chip measures both, then sends 40 bits on the S pin: humidity, temperature and a checksum. The timing is too fast to read with digitalRead, so sketches use the DHT library: dht.readTemperature() and dht.readHumidity(). It gives whole numbers and a new reading at most once every 1 to 2 seconds.
What it is made of
- Humidity element: A polymer film that takes up water, between metal electrodes CHOAu
- Temperature element: NTC thermistor (metal oxide ceramic) MnNiO
- Case: ABS plastic CHN
Where the materials come from: Plastics from oil and natural gas; gold from gold mines; nickel and manganese from their ores.
The chemistry
Water molecules are polar. When the film absorbs them from humid air its ability to hold charge changes, and the chip measures that change.
Biology connection
Your lungs add water vapour to the air you breathe out, which is why breath turns to mist on a cold day and why a DHT11 reads higher when you breathe on it. Breathing →
Safety and the environment
Do not read it faster than once a second. Keep it away from water drops: it measures humid air, not liquid water. A reading of "nan" means the wiring or the pin number is wrong.
Did you know? Its bigger brother, the white DHT22, uses the same wiring and library but measures −40 to 80 °C with one decimal place.
Gas laws simulatorHeating curve simulator Elements inside: CHOAuMnNiN
Try it in the simulator
Build and code a circuit with a Temperature and humidity sensor in these practice projects:
Questions students ask
What does the DHT11 do?
Measures air temperature (0 to 50 °C) and relative humidity (20 to 90%) and sends both as numbers on one data wire. Main functions: measures air temperature; measures relative humidity; feeds weather stations and room monitors.
Why does my DHT11 print nan?
nan means no answer came from the sensor. Check that S goes to the pin named in DHT dht(pin, DHT11), that + and − are on 5V and GND, that dht.begin() is in setup(), and that you wait about 2 seconds between readings.
What are the connections of the DHT11?
In order: S (data), + (VCC), − (GND).
How does the DHT11 work?
Inside the blue case are a humidity-sensing layer between two electrodes, a thermistor and a small chip. The chip measures both, then sends 40 bits on the S pin: humidity, temperature and a checksum. The timing is too fast to read with digitalRead, so sketches use the DHT library: dht.readTemperature() and dht.readHumidity(). It gives whole numbers and a new reading at most once every 1 to 2 seconds.
What is the DHT11 made of?
Humidity element: A polymer film that takes up water, between metal electrodes. Temperature element: NTC thermistor (metal oxide ceramic). Case: ABS plastic.
Is the DHT11 safe? How should it be recycled?
Do not read it faster than once a second. Keep it away from water drops: it measures humid air, not liquid water. A reading of "nan" means the wiring or the pin number is wrong.
More sensors
Connected tools
The same idea from another angle, across the site.