Arduino DHT11 temperature sensor projects
Read the room temperature and then do something about it — a thermometer, an alarm, a fan and a combined smart fan.
The DHT11 is a one-wire sensor: the Arduino asks for a reading over a single data pin and the sensor answers with a number, not a voltage. That makes it the easiest digital sensor to wire and the easiest to get subtly wrong, because a missing pull-up resistor produces a reading of zero rather than an error.
The projects here use it in two ways — read it and print it, or read it and decide something. The thermometer is the first, and it is enough to learn the protocol. The alarm adds a threshold and a decision. The fan adds an output. The smart fan combines it with an ultrasonic sensor, and that one is the first project on the site where two inputs have to agree before anything happens.
What you need
The parts below are the ones the most of these projects share. Each project page lists the full set for that build.
| Part | Used by | Why |
|---|---|---|
| Breadboard | 4 | Holds the circuit together without solder |
| 1× red LED | 3 | The output you can see working |
| 1× breadboard | 3 | Holds the circuit together without solder |
| 1× DHT11 sensor | 3 | Reads something about the world |
| 1× green LED | 2 | The output you can see working |
| 1× 9V battery | 2 | The supply the circuit runs on |
All 7 arduino dht11 temperature sensor projects
Easiest first. Each card links to the project's own page with the wiring, the parts and the code written out.
Read the room temperature every 2 seconds and print it
Read the room temperature on your laptop
Hot day, fan on. Cool day, fan off.
Too hot, too cold, or just right
Which material keeps heat in best?
Read 3 sensors at once and stream them to the Serial Monitor
Only blows when it is hot AND someone is within 100 cm
How to use these with a class
These 7 projects run from about 20 minutes to 60 minutes each, and 1 of them are Tier 1 — one component and one idea, which is what a class can finish in a single period.
Each project page carries the full build — the concept, the parts, the wiring one step at a time and the sketch — so a class can work through it without the teacher having to explain every wire.
Every one of them can be practised in the browser simulator first, with the real sketch and a real circuit solver behind it, and the first 15 projects are free with no account.
Common questions
Why do I need a 10k resistor on the DHT11 data pin?
The data line idles high, and the sensor pulls it low to talk. Without the pull-up the pin floats and the Arduino reads noise. The 10 kΩ resistor between the data pin and 5 V holds the line high between bits.
How accurate is the DHT11?
About ±2 °C, which is plenty for a classroom. It also has a resolution of 1 °C, so a reading of 24.3 °C is not meaningful — it will be 24 °C.
How often can I read it?
Once every two seconds is the recommended maximum. Reading it faster gives you the same value twice and costs the Arduino time for nothing.
Related
Try the full simulator with your class
103 guided circuit projects, 21 lessons and an in-browser Arduino simulator. The first 15 projects are free, no account needed. One licence covers a whole school.