Skip to content
Temperature & Humidity

DHT11 Temperature & Humidity Sensor

The most popular entry-level temperature and humidity sensor — cheap, simple, and widely supported.

DHT11 Temperature & Humidity Sensor

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 voltage3.3V – 5.5V DC
Operating current0.3 mA (measuring), 60 µA (standby)
Temperature range0°C to 50°C
Temperature accuracy±2°C
Humidity range20% to 90% RH
Humidity accuracy±5% RH
Resolution8-bit (1°C / 1% RH steps)
Sampling rate1 Hz max (once every 2s recommended)
InterfaceSingle-wire digital (proprietary, not I2C/SPI)

Pinout

PinNameDescription
1VCCPower, 3.3V–5.5V DC
2DATASingle-wire digital I/O — needs a 10kΩ pull-up to VCC
3NCNot connected — leave floating
4GNDGround

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.

VariantTemp rangeHum rangeAccuracyProtocolPrice
DHT110–50°C20–90% RH±2°C / ±5% RHSingle-wire, 1 Hz~$1–2
DHT22 (AM2302)-40–80°C0–100% RH±0.5°C / ±2% RHSingle-wire, 0.5 Hz~$3–5
DHT21 (AM2301)-40–80°C0–100% RH±0.3°C / ±3% RHSingle-wire, 0.5 Hz~$4–6

Board Integration

Library

DHT sensor library by Adafruit

Arduino IDE → Tools → Manage Libraries → search "DHT sensor library" by Adafruit → Install (accept the prompt to also install the "Adafruit Unified Sensor" dependency)

Wiring

Component pinArduino Uno pinNote
VCC5V
DATAD2Add a 10kΩ pull-up resistor between DATA and VCC if you are using the bare 4-pin sensor — most 3-pin breakout modules already have one built in.
GNDGND

Example code

C++
  • The very first read after power-up is often invalid — that's normal, not a wiring fault. Give it a couple of seconds.
  • Keep the sensor lead under ~1m unless you're using shielded cable; the single-wire protocol has no error correction and is sensitive to noise on long runs.
  • dht.readTemperature(true) returns Fahrenheit directly if you'd rather not convert yourself.
View full Arduino Uno guide