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 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) |
DHT11 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 |
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)
Wiring
| Component pin | Arduino Uno pin | Note |
|---|---|---|
| VCC | 5V | — |
| DATA | D2 | Add 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. |
| GND | GND | — |
Example code
- 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

Arduino Uno R3 Pinout: Every Pin Explained (Digital, Analog, PWM, Power)
Complete Arduino Uno R3 pinout reference: all 14 digital pins, 6 analog inputs, PWM, UART, SPI, I2C, AREF, and power rails explained with wiring tips and common mistakes.

Ultimate Arduino Mega 2560 Pinout Guide: Complete Power & I/O Reference
Master the Arduino Mega 2560 pinout. Detailed reference for all 54 digital pins, 16 analog inputs, PWM, UARTs, SPI, I2C, interrupts, and power. Includes a printable table and practical wiring tips.

Interfacing HC-SR04 Ultrasonic Sensor with Arduino
Measure distance accurately using ultrasonic sound waves and an Arduino Uno — no complex math, no expensive hardware.
HC‑SR04 Ultrasound Distance Measurement with Arduino – Parking Alert (LCD & Buzzer)
Learn HC‑SR04 ultrasound distance measurement with Arduino Uno. Build a parking alert system with 16x2 LCD and buzzer – shows distance and beeps faster as you approach.