DHT11 Temperature & Humidity Sensor
The most popular entry-level temperature and humidity sensor — cheap, simple, and widely supported.

The DHT11 is a low-cost digital temperature and humidity sensor with a built-in NTC thermistor and a resistive humidity element, both read out over a single proprietary digital bus. It's usually the first environmental sensor a maker wires up — it's inexpensive, needs no calibration, and has a mature library on every board in this guide.
Its limits are real: readings only refresh about once a second, accuracy is ±2°C / ±5% RH, and it won't survive freezing temperatures or long cable runs well. For anything more demanding, the pin- and library-compatible DHT22 trades a little cost and speed for roughly 4x the accuracy and a much wider operating range — see the variants table below.
Specifications
| Operating voltage | 3.3V – 5.5V DC |
| Operating current | 0.3 mA (measuring), 60 µA (standby) |
| Temperature range | 0°C to 50°C |
| Temperature accuracy | ±2°C |
| Humidity range | 20% to 90% RH |
| Humidity accuracy | ±5% RH |
| Resolution | 8-bit (1°C / 1% RH steps) |
| Sampling rate | 1 Hz max (once every 2s recommended) |
| Interface | Single-wire digital (proprietary, not I2C/SPI) |
Pinout
| Pin | Name | Description |
|---|---|---|
| 1 | VCC | Power, 3.3V–5.5V DC |
| 2 | DATA | Single-wire digital I/O — needs a 10kΩ pull-up to VCC |
| 3 | NC | Not connected — leave floating |
| 4 | GND | Ground |
Variants
DHT11 is the cheapest and fastest to sample, but the least accurate of the family. If your project needs sub-degree accuracy or has to survive outdoor winter temperatures, use the pin- and library-compatible DHT22 instead — same wiring, just swap DHTTYPE.
| Variant | Temp range | Hum range | Accuracy | Protocol | Price |
|---|---|---|---|---|---|
| DHT11 | 0–50°C | 20–90% RH | ±2°C / ±5% RH | Single-wire, 1 Hz | ~$1–2 |
| DHT22 (AM2302) | -40–80°C | 0–100% RH | ±0.5°C / ±2% RH | Single-wire, 0.5 Hz | ~$3–5 |
| DHT21 (AM2301) | -40–80°C | 0–100% RH | ±0.3°C / ±3% RH | Single-wire, 0.5 Hz | ~$4–6 |