Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use DHT11: Examples, Pinouts, and Specs

Image of DHT11
Cirkit Designer LogoDesign with DHT11 in Cirkit Designer

Introduction

The DHT11 is a widely used digital temperature and humidity sensor that provides reliable and accurate readings with a dedicated NTC temperature sensor and a capacitive humidity sensor. It is a basic and low-cost sensor that is suitable for hobbyist and educational projects. The DHT11 is commonly used in weather stations, home environmental control systems, and IoT applications where monitoring of ambient temperature and humidity is required.

Explore Projects Built with DHT11

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
ESP8266 NodeMCU with DHT11 Sensor for Temperature and Humidity Monitoring
Image of temperature and humidity sensore : A project utilizing DHT11 in a practical application
This circuit connects a DHT11 Humidity and Temperature Sensor to an ESP8266 NodeMCU microcontroller. The DHT11 sensor's data pin is interfaced with the D5 pin on the NodeMCU for digital signal communication, while both the sensor and the NodeMCU share a common ground (GND). The sensor is powered by the NodeMCU's VIN pin, which likely supplies the required voltage for the DHT11 to operate.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32 and DHT11 Wi-Fi Enabled Temperature and Humidity Sensor
Image of Practical-9: A project utilizing DHT11 in a practical application
This circuit uses an ESP32 microcontroller to read temperature and humidity data from a DHT11 sensor. The ESP32 provides power to the DHT11 and receives the sensor data through its GPIO pin G33.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO-Based Temperature and Humidity Monitor with DHT11 Sensor
Image of DHT11: A project utilizing DHT11 in a practical application
This circuit consists of an Arduino UNO microcontroller connected to a DHT11 temperature and humidity sensor. The DHT11 sensor is powered by the 3.3V and GND pins of the Arduino, and its data output is connected to the A0 analog input pin of the Arduino. The Arduino is programmed to read data from the DHT11 sensor.
Cirkit Designer LogoOpen Project in Cirkit Designer
Raspberry Pi 3B with DHT11 Temperature and Humidity Sensor
Image of temp-humidity: A project utilizing DHT11 in a practical application
This circuit connects a DHT11 temperature and humidity sensor to a Raspberry Pi 3B. The DHT11's data output pin is connected to GPIO pin 11 on the Raspberry Pi for digital signal communication. The sensor is powered by the Raspberry Pi's 5V and ground pins.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with DHT11

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of temperature and humidity sensore : A project utilizing DHT11 in a practical application
ESP8266 NodeMCU with DHT11 Sensor for Temperature and Humidity Monitoring
This circuit connects a DHT11 Humidity and Temperature Sensor to an ESP8266 NodeMCU microcontroller. The DHT11 sensor's data pin is interfaced with the D5 pin on the NodeMCU for digital signal communication, while both the sensor and the NodeMCU share a common ground (GND). The sensor is powered by the NodeMCU's VIN pin, which likely supplies the required voltage for the DHT11 to operate.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Practical-9: A project utilizing DHT11 in a practical application
ESP32 and DHT11 Wi-Fi Enabled Temperature and Humidity Sensor
This circuit uses an ESP32 microcontroller to read temperature and humidity data from a DHT11 sensor. The ESP32 provides power to the DHT11 and receives the sensor data through its GPIO pin G33.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of DHT11: A project utilizing DHT11 in a practical application
Arduino UNO-Based Temperature and Humidity Monitor with DHT11 Sensor
This circuit consists of an Arduino UNO microcontroller connected to a DHT11 temperature and humidity sensor. The DHT11 sensor is powered by the 3.3V and GND pins of the Arduino, and its data output is connected to the A0 analog input pin of the Arduino. The Arduino is programmed to read data from the DHT11 sensor.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of temp-humidity: A project utilizing DHT11 in a practical application
Raspberry Pi 3B with DHT11 Temperature and Humidity Sensor
This circuit connects a DHT11 temperature and humidity sensor to a Raspberry Pi 3B. The DHT11's data output pin is connected to GPIO pin 11 on the Raspberry Pi for digital signal communication. The sensor is powered by the Raspberry Pi's 5V and ground pins.
Cirkit Designer LogoOpen Project in Cirkit Designer

Technical Specifications

Key Technical Details

  • Supply Voltage: 3 to 5.5 VDC
  • Output Signal: Digital signal via a single data pin
  • Humidity Measurement Range: 20 to 80% RH
  • Humidity Accuracy: ±5% RH
  • Temperature Measurement Range: 0 to 50°C
  • Temperature Accuracy: ±2°C
  • Resolution:
    • Humidity 1% RH
    • Temperature 1°C
  • Sampling Rate: ≤ 1 Hz (once every second)
  • Dimensions: 23mm x 12mm x 5mm (approx.)

Pin Configuration and Descriptions

Pin Number Name Description
1 VCC Power supply (3 to 5.5 VDC)
2 DATA Digital data output
3 NC Not connected
4 GND Ground

Usage Instructions

Integration with a Circuit

  1. Connect the VCC pin to a 3 to 5.5 V power supply.
  2. Connect the GND pin to the ground of the power supply.
  3. Connect the DATA pin to a digital input pin on a microcontroller, such as an Arduino UNO.
  4. A pull-up resistor (typically 4.7kΩ to 10kΩ) is required between the DATA pin and VCC.

Best Practices

  • Avoid placing the sensor in direct sunlight or near heat sources to prevent inaccurate readings.
  • Ensure that the sensor is not exposed to condensing levels of humidity.
  • Allow the sensor to acclimatize to the environment for accurate readings.
  • Use a cable length of less than 20 meters to prevent signal degradation.

Example Code for Arduino UNO

#include "DHT.h"

#define DHTPIN 2     // Digital pin connected to the DHT sensor
#define DHTTYPE DHT11 // DHT 11

DHT dht(DHTPIN, DHTTYPE);

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

void loop() {
  // Wait a few seconds between measurements.
  delay(2000);

  // Reading temperature or humidity takes about 250 milliseconds!
  float humidity = dht.readHumidity();
  float temperature = dht.readTemperature();

  // Check if any reads failed and exit early (to try again).
  if (isnan(humidity) || isnan(temperature)) {
    Serial.println("Failed to read from DHT sensor!");
    return;
  }

  // Compute heat index in Celsius (isFahrenheit = false)
  float heatIndex = dht.computeHeatIndex(temperature, humidity, false);

  Serial.print("Humidity: ");
  Serial.print(humidity);
  Serial.print("%  Temperature: ");
  Serial.print(temperature);
  Serial.print("°C  Heat index: ");
  Serial.print(heatIndex);
  Serial.println("°C");
}

Note: The above code uses the DHT sensor library, which can be installed via the Arduino Library Manager.

Troubleshooting and FAQs

Common Issues

  • Inaccurate Readings: Ensure the sensor is not affected by heat sources or direct sunlight. Allow it to acclimatize.
  • No Data: Check the wiring, especially the pull-up resistor on the DATA pin. Ensure the power supply is within the specified range.
  • Erratic Readings: Ensure there is no condensation on the sensor. Use shorter cables if possible.

FAQs

Q: Can the DHT11 sensor be used outdoors? A: Yes, but it should be protected from direct sunlight, rain, and condensation for accurate measurements.

Q: How long does the DHT11 sensor last? A: The DHT11 has a typical lifespan of 3-5 years, depending on usage conditions.

Q: Is calibration required for the DHT11 sensor? A: The DHT11 comes pre-calibrated from the factory and does not typically require additional calibration.

Q: Can I use the DHT11 sensor with a 3.3V supply? A: Yes, the DHT11 can operate with a supply voltage from 3 to 5.5 VDC.

For further assistance, consult the datasheet provided by the manufacturer or contact technical support.