Skip to content
DHT11

Temperature & Humidity

Interfacing DHT11 Temperature & Humidity with Arduino Uno

What is the DHT11?

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)

DHT11 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

Setting Up DHT11 with Arduino Uno

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)

Library guide

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.

Related Components

Related Guides & Projects