Overview

The DHT11 is a basic, ultra-low-cost digital temperature and humidity sensor manufactured by Aosong Electronics (Guangzhou Aosong). It combines a resistive-type humidity measurement component and an NTC temperature measurement component connected to an 8-bit microcontroller.

It outputs calibrated 40-bit digital signals over a proprietary custom single-wire serial interface (DATA). It is standard in beginner Arduino and Raspberry Pi starter kits for basic environmental monitoring.

Quick reference

Operating voltage (VCC)3.0 V to 5.5 V DC (5 V recommended)
Humidity range20% to 90% RH (±5% RH\pm 5\%\text{ RH} accuracy)
Temperature range0C0^\circ\text{C} to +50C+50^\circ\text{C} (±2.0 C\pm 2.0\text{ }^\circ\text{C} accuracy)
Resolution8-bit (1% RH, 1 °C steps)
Sampling period1.0 second (do not sample faster than 1 Hz)
InterfaceCustom Single-Bus 1-Wire protocol
Active measuring current0.5 mA to 2.5 mA

Pinout

4-Pin Package / 3-Pin Breakout Module

PinNameTypeDescription
1VCCPowerSupply voltage (+3.0 V to +5.5 V DC)
2DATADigital I/OSingle-bus bidirectional data line (requires 4.7kΩ–10kΩ pull-up resistor)
3NCNot ConnectedNo connection (pin 3 omitted on 3-pin breakout modules)
4GNDPowerGround (0 V)

Specifications

ParameterSymbolMinTypMaxUnitConditions
Supply VoltageVCCV_{CC}3.05.05.5VDC
Measuring CurrentIDDI_{DD}0.51.02.5mADuring data transmission
Standby CurrentISBI_{SB}100120150µABetween measurements
Humidity Measuring RangeRHRH2090% RH0C to 50C0^\circ\text{C} \text{ to } 50^\circ\text{C}
Humidity AccuracyΔRH\Delta RH-5+5% RHAt 25C25^\circ\text{C}
Temperature Measuring RangeTT050°C
Temperature AccuracyΔT\Delta T-2.0+2.0°C
Data Response Timetreadt_{read}1.0sMinimum interval between reads

Communication protocol

The DHT11 uses a single-line bidirectional protocol. Every read operation consists of a 40-bit data packet (5 bytes) transmitted MSB first:

Data Packet=Humidity IntegralByte 0+Humidity DecimalByte 1 (0x00)+Temp IntegralByte 2+Temp DecimalByte 3 (0x00)+ChecksumByte 4\text{Data Packet} = \underbrace{\text{Humidity Integral}}_{\text{Byte 0}} + \underbrace{\text{Humidity Decimal}}_{\text{Byte 1 (0x00)}} + \underbrace{\text{Temp Integral}}_{\text{Byte 2}} + \underbrace{\text{Temp Decimal}}_{\text{Byte 3 (0x00)}} + \underbrace{\text{Checksum}}_{\text{Byte 4}}

  • Checksum verification: Byte 4=(Byte 0+Byte 1+Byte 2+Byte 3)(mod256)\text{Byte 4} = (\text{Byte 0} + \text{Byte 1} + \text{Byte 2} + \text{Byte 3}) \pmod{256}.
  • Communication timing:
    1. Microcontroller pulls DATA line LOW for at least 18 ms to initiate a start signal, then pulls HIGH for 20–40 µs.
    2. DHT11 responds by pulling DATA LOW for 80 µs, then HIGH for 80 µs.
    3. DHT11 transmits 40 data bits. Each bit starts with a 50 µs LOW pulse. A 26–28 µs HIGH pulse represents bit 0, whereas a 70 µs HIGH pulse represents bit 1.
text
MCU Start:   ───┐            ┌───────────────
                └─ 18ms LOW ─┘ 20-40µs HIGH
DHT Response:                                └── 80µs LOW ─── 80µs HIGH ─── Data Bits...

Wiring

DHT11 SensorMicrocontroller (Arduino Uno / ESP32)Notes
VCC5V (or 3.3V)Power supply
DATADigital GPIO Pin (e.g. GPIO2)Requires a 4.7 kΩ4.7\text{ k}\Omega to 10 kΩ10\text{ k}\Omega pull-up resistor to VCC
GNDGNDGround
Note

3-Pin Breakout Modules usually include an onboard 10 kΩ10\text{ k}\Omega pull-up resistor between DATA and VCC, making external resistors unnecessary.

Common mistakes

  • Polling faster than 1 Hz: The DHT11 requires at least 1.0 second between consecutive read requests. Polling faster will return stale data, checksum errors, or cause the sensor to freeze.
  • Missing pull-up resistor: The single-bus protocol relies on an open-drain/pull-up architecture. Operating a bare 4-pin DHT11 without a 4.7 kΩ4.7\text{ k}\Omega10 kΩ10\text{ k}\Omega pull-up resistor on the DATA line causes timeout errors.
  • Expecting sub-zero or fractional readings: The DHT11 returns integer-only values for temperature and humidity, and cannot measure temperatures below 0C0^\circ\text{C}. Use a DHT22 / AM2302 for sub-zero or decimal precision requirements.

Notes

  • Long cable runs (> 20 meters) require reducing the pull-up resistor value to 1 kΩ1\text{ k}\Omega to compensate for bus capacitance.

Assets & downloads