As an Amazon Associate we earn from qualifying purchases.
The DHT11 is a low-cost digital sensor that measures relative humidity and air temperature. It is one of the most common parts in beginner electronics, and you will find it in weather stations, plant monitors, home automation builds and classroom projects. This guide explains what the DHT11 does, how the bare sensor differs from the module version, how to wire it, and where its limits are.
DHT11 Humidity & Temperature Sensor
Inside the blue plastic case are a humidity-sensing element and a thermistor for temperature. A small chip converts both readings into a digital signal and sends them over a single data wire. That means you do not need an analog-to-digital converter, and a microcontroller can read it with just one pin.
Key specifications
These figures come from the typical DHT11 datasheet. Exact values can vary a little between manufacturers, so check the sheet for the part you buy.
- Humidity range: about 20% to 80% relative humidity, with roughly ±5% accuracy.
- Temperature range: about 0 °C to 50 °C, with roughly ±2 °C accuracy.
- Resolution: 1% RH and 1 °C, so readings are whole numbers.
- Sampling rate: up to one reading per second (1 Hz).
- Supply voltage: roughly 3.3 V to 5.5 V, so it works with both 3.3 V and 5 V boards.
- Output: a single-wire digital signal.
DHT11 Temperature and Relative Humidity Sensor Module
DHT11 parts are sold in two forms: the bare four-pin sensor and a small module board. The module has the same sensor on a circuit board with the supporting parts already fitted.
Bare sensor or module?
- Bare sensor (4 pins): the pins are power, data, an unused pin and ground. It needs an external pull-up resistor on the data line, commonly somewhere around 4.7 kΩ to 10 kΩ.
- Module (3 pins): the pull-up resistor is usually already on the board, so you connect power, data and ground directly. Many modules also include a power indicator LED.
For a first project, the module is the easier choice because there is less to get wrong. Pin order differs between boards, so always check the labels printed on the PCB before connecting power.
How to wire the DHT11
- Connect the VCC (or +) pin to 3.3 V or 5 V on your board.
- Connect the GND (or –) pin to ground.
- Connect the DATA (or S) pin to a digital input pin.
- If you use the bare sensor, add a pull-up resistor between the data pin and VCC.
Keep the wires short and the power supply stable. Long wires or a noisy supply are a common cause of failed readings.
Reading the DHT11 with a microcontroller
The DHT11 uses its own timing-based protocol, so it is easiest to use a library rather than write the timing code yourself. On Arduino, the widely used DHT sensor library handles this for you. If you want a full walkthrough, see our guide on how to read the sensor with an Arduino, or the broader tutorial on how to measure temperature and humidity with Arduino.
A few habits will save you trouble:
- Wait at least one second between readings. Polling faster returns errors or repeated values.
- Check for invalid results (NaN in most libraries) before using a value.
- Give the sensor a moment to settle after power-up before the first read.
Accuracy and limitations
The DHT11 is good enough to show whether a room feels dry, comfortable or damp. It is not a precision instrument. The ±5% humidity error and whole-number resolution mean it is a poor fit for anything that needs tight control or fine changes.
- It does not read below about 20% or above about 80% humidity reliably.
- It cannot measure temperatures below 0 °C, so it is not suitable for outdoor use in winter or for freezers.
- It is slow, which is fine for room conditions but not for fast-changing air.
If you need better numbers, the DHT22 (also sold as AM2302) covers a wider range with finer resolution and better accuracy, at a slightly higher cost. It works with the same wiring and libraries, so swapping is usually simple. For more options, see our comparison of other sensors for Arduino projects.
Placement tips for better readings
- Keep the sensor away from heat sources such as regulators, power supplies, motors and direct sunlight. Heat from your own board can skew the temperature reading.
- Allow some airflow around it. A sensor sealed in a tight box reports the conditions inside the box, not the room.
- Avoid direct contact with water and condensation. The DHT11 is meant for air, not spray or splashes.
Common DHT11 projects
- Indoor temperature and humidity displays on an LCD or OLED screen.
- Plant, greenhouse or grow-box monitors.
- Simple alerts when a room becomes too humid, for example in a basement or bathroom.
- Home automation nodes that send readings over Wi-Fi.
Once the basics work, you can log the readings over time to see how conditions change through the day. If you would rather not build anything, a ready-made smart humidity sensor may suit you better.
FAQ
Is the DHT11 accurate enough for home use?
For a general idea of room conditions, yes. With about ±5% humidity and ±2 °C temperature error, it is fine for casual monitoring but not for anything that needs precise values.
What is the difference between the DHT11 and DHT22?
The DHT22 measures a wider range, offers finer resolution and is more accurate. The DHT11 is cheaper and works well for basic projects.
Do I need a resistor with the DHT11?
The bare four-pin sensor needs a pull-up resistor on the data line. Most three-pin modules already include one on the board.
How often can I read the DHT11?
About once per second at most. Reading it more often usually gives errors or stale values, and room conditions rarely change that fast anyway.