Phipps Electronics

Order within the next 

FREE SHIPPING OVER $199

50,000+ ORDERS

WORLDWIDE SHIPPING

SSL SECURED

← Back
You are here:
Print

DHT11 Temperature & Humidity Sensor Module – Support Documentation

Overview

The DHT11 is a basic, low-cost digital temperature and humidity sensor featuring a capacitive humidity sensor and a thermistor, controlled by an internal microcontroller and factory-calibrated for ready-to-use accuracy. It uses a single-wire serial interface, delivering reliable data with simplicity and stability.

Features

  • Measures temperature (0 °C to 50 °C) and relative humidity (20 % to 90 % RH)
  • Digital output via single-wire interface
  • Operating voltage: ~3.3 V to 5.5 V
  • Low power consumption (~0.3 mA active, ~60 µA standby)
  • Sampling rate: ~1 Hz (one reading per second)
  • Accuracy: ±2 °C (temperature), ±5 % RH (humidity)
  • Factory calibrated and ready for use

Specifications

Parameter Value
Power Supply 3.3 V – 5.5 V DC
Temperature Range 0 °C – 50 °C
Humidity Range 20 % – 90 % RH
Temperature Accuracy ±2 °C
Humidity Accuracy ±5 % RH
Resolution 1 °C / 1 % RH
Sampling Rate 1 Hz
Communication Interface Single-wire digital

Pin-Out Table

(For the standalone DHT11 sensor, not the module)

Pin Function
VCC 3.3 V – 5.5 V power
DATA Digital output (single-wire protocol)
NC No connection (unused)
GND Ground

Note: Module variants often have 3 pins—VCC, DATA, GND—and include pull-up resistor and LED.

Integration with Microcontrollers

1. Arduino (Uno, Nano, Mega)

  • Connect VCC → 5V
  • Connect GND → GND
  • Connect DATA → Digital Pin 2 (with 10 kΩ pull-up to VCC)
#include <DHT.h>
#define DHTPIN 2
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);

void setup() {
  Serial.begin(9600);
  dht.begin();
}

void loop() {
  float h = dht.readHumidity();
  float t = dht.readTemperature();
  if (!isnan(h) && !isnan(t)) {
    Serial.print("Humidity: "); Serial.print(h); Serial.print("%  ");
    Serial.print("Temp: "); Serial.print(t); Serial.println("°C");
  }
  delay(2000);
}

2. ESP8266 (NodeMCU, Wemos D1 Mini)

  • Connect VCC → 3.3V (Do NOT use 5V)
  • Connect GND → GND
  • Connect DATA → D4 (GPIO2)
#include <DHT.h>
#define DHTPIN 2   // GPIO2 = D4
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);

void setup() {
  Serial.begin(115200);
  dht.begin();
}

void loop() {
  Serial.print("Humidity: ");
  Serial.print(dht.readHumidity());
  Serial.print("% Temp: ");
  Serial.print(dht.readTemperature());
  Serial.println("°C");
  delay(2000);
}

3. ESP32

  • Connect VCC → 3.3V
  • Connect GND → GND
  • Connect DATA → GPIO 4 (or any free digital pin)
#include <DHT.h>
#define DHTPIN 4
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);

void setup() {
  Serial.begin(115200);
  dht.begin();
}

void loop() {
  float h = dht.readHumidity();
  float t = dht.readTemperature();
  Serial.printf("Humidity: %.1f %%  Temperature: %.1f °C\n", h, t);
  delay(2000);
}

4. Raspberry Pi (using Python)

  • Connect VCC → 3.3V
  • Connect GND → GND
  • Connect DATA → GPIO 4 (physical pin 7)
import Adafruit_DHT

DHT_SENSOR = Adafruit_DHT.DHT11
DHT_PIN = 4  # GPIO4

humidity, temperature = Adafruit_DHT.read(DHT_SENSOR, DHT_PIN)

if humidity is not None and temperature is not None:
    print("Temp={0:0.1f}°C  Humidity={1:0.1f}%".format(temperature, humidity))
else:
    print("Failed to retrieve data from DHT11")

Troubleshooting

Issue Possible Cause Solution
No readings / NaN Incorrect wiring or missing pull-up resistor Ensure DATA line has a 10 kΩ pull-up; check wiring
Inaccurate readings Outside measurement range or sensor degradation Use within 0–50 °C and 20–90 % RH range
Readings too slow Sensor sample rate limited to 1 Hz Account for 1 s delay between reads

Typical Applications

  • Home weather stations and DIY IoT climate logging
  • Indoor environment monitoring (HVAC, greenhouses)
  • Automation systems (fan control, humidifiers, dehumidifiers)

FAQs

  • Does the DHT11 require calibration?
    No—factory calibrated with coefficients stored in on-chip memory.
  • Can I use it outdoors?
    Not recommended. For outdoor use, DHT22 or SHT series are better suited.
  • Why only one reading per second?
    Internal signal processing limits sampling to ~1 Hz.

Safety Considerations

  • Do not exceed 5.5 V on VCC
  • Use 3.3 V only when integrating with ESP or Raspberry Pi
  • Keep away from condensation or water exposure
  • Observe correct pin order to avoid permanent damage
Was this article helpful?
Please Share Your Feedback
How Can We Improve This Article?
Table of Contents
Scroll to Top