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

How to Use DHT11-2: Examples, Pinouts, and Specs

Image of DHT11-2
Cirkit Designer LogoDesign with DHT11-2 in Cirkit Designer

Introduction

The DHT11-2 is a digital temperature and humidity sensor designed to provide accurate and reliable readings of environmental conditions. It features a single-wire communication interface, making it simple to integrate with microcontrollers and other digital systems. The DHT11-2 is widely used in applications such as weather stations, HVAC systems, greenhouses, and other projects requiring temperature and humidity monitoring.

Key features of the DHT11-2 include:

  • Digital output for temperature and humidity data
  • Compact design for easy integration
  • Low power consumption
  • Ideal for both hobbyist and professional applications

Explore Projects Built with DHT11-2

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Arduino and ESP8266 Based Environmental Monitoring System with LoRa Communication
Image of MP50: A project utilizing DHT11-2 in a practical application
This circuit is a multi-sensor data acquisition system with wireless communication capabilities. It uses an Arduino 101 to interface with a DHT11 temperature and humidity sensor, an MQ2 gas sensor, a flow rate sensor, and a PH meter. The data collected from these sensors is transmitted via a LoRa Ra-02 SX1278 module, and the system can also communicate with an ESP8266 module for additional wireless functionality.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino Mega 2560 with Multiple DHT Sensors for Environmental Monitoring
Image of Schematic Diagram: A project utilizing DHT11-2 in a practical application
This circuit is designed to monitor temperature and humidity using two DHT22 sensors and one DHT11 sensor, all controlled by an Arduino Mega 2560. The sensors are powered by the Arduino and communicate with it through digital pins D2, D3, and D4. The provided code is a template for implementing the sensor data acquisition logic.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP8266 NodeMCU-Based Weather Monitoring Station with LCD Display
Image of IOT: A project utilizing DHT11-2 in a practical application
This is an environmental monitoring system that uses an ESP8266 NodeMCU to collect data from a DHT11 temperature and humidity sensor, an LDR light sensor, and a rain sensor. The data is displayed on a 16x2 LCD screen, interfaced through an I2C module for simplified communication.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Based Wi-Fi Connected Temperature and Humidity Sensor
Image of motor dc: A project utilizing DHT11-2 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 data through its GPIO pin D2.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with DHT11-2

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 MP50: A project utilizing DHT11-2 in a practical application
Arduino and ESP8266 Based Environmental Monitoring System with LoRa Communication
This circuit is a multi-sensor data acquisition system with wireless communication capabilities. It uses an Arduino 101 to interface with a DHT11 temperature and humidity sensor, an MQ2 gas sensor, a flow rate sensor, and a PH meter. The data collected from these sensors is transmitted via a LoRa Ra-02 SX1278 module, and the system can also communicate with an ESP8266 module for additional wireless functionality.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Schematic Diagram: A project utilizing DHT11-2 in a practical application
Arduino Mega 2560 with Multiple DHT Sensors for Environmental Monitoring
This circuit is designed to monitor temperature and humidity using two DHT22 sensors and one DHT11 sensor, all controlled by an Arduino Mega 2560. The sensors are powered by the Arduino and communicate with it through digital pins D2, D3, and D4. The provided code is a template for implementing the sensor data acquisition logic.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of IOT: A project utilizing DHT11-2 in a practical application
ESP8266 NodeMCU-Based Weather Monitoring Station with LCD Display
This is an environmental monitoring system that uses an ESP8266 NodeMCU to collect data from a DHT11 temperature and humidity sensor, an LDR light sensor, and a rain sensor. The data is displayed on a 16x2 LCD screen, interfaced through an I2C module for simplified communication.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of motor dc: A project utilizing DHT11-2 in a practical application
ESP32-Based Wi-Fi Connected 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 data through its GPIO pin D2.
Cirkit Designer LogoOpen Project in Cirkit Designer

Technical Specifications

The DHT11-2 sensor has the following technical specifications:

Parameter Value
Operating Voltage 3.3V to 5.5V
Temperature Range 0°C to 50°C
Temperature Accuracy ±2°C
Humidity Range 20% to 90% RH
Humidity Accuracy ±5% RH
Communication Protocol Single-wire (digital)
Sampling Period 1 second (minimum)
Dimensions 15mm x 12mm x 5mm

Pin Configuration

The DHT11-2 has four pins, as described in the table below:

Pin Number Name Description
1 VCC Power supply (3.3V to 5.5V)
2 DATA Digital data output (connect to microcontroller)
3 NC Not connected (leave unconnected)
4 GND Ground

Usage Instructions

Connecting the DHT11-2 to a Circuit

  1. Power Supply: Connect the VCC pin to a 3.3V or 5V power source and the GND pin to ground.
  2. Data Line: Connect the DATA pin to a digital input pin on your microcontroller. Use a 10kΩ pull-up resistor between the DATA pin and the VCC pin to ensure stable communication.
  3. NC Pin: Leave the NC pin unconnected.

Important Considerations

  • Ensure the sensor is placed in an environment within its operating range (0°C to 50°C and 20% to 90% RH).
  • Avoid exposing the sensor to water or condensation, as this may damage the internal circuitry.
  • Allow a 1-second delay between consecutive readings to ensure accurate data.

Example Code for Arduino UNO

Below is an example of how to use the DHT11-2 with an Arduino UNO. This code requires the DHT library, which can be installed via the Arduino Library Manager.

#include <DHT.h>

// Define the pin connected to the DHT11-2 sensor
#define DHTPIN 2  // Connect DATA pin of DHT11-2 to digital pin 2

// Define the type of DHT sensor
#define DHTTYPE DHT11  // DHT11-2 is compatible with the DHT11 library

// Initialize the DHT sensor
DHT dht(DHTPIN, DHTTYPE);

void setup() {
  Serial.begin(9600);  // Start serial communication at 9600 baud
  Serial.println("DHT11-2 Sensor Test");
  dht.begin();  // Initialize the DHT sensor
}

void loop() {
  delay(2000);  // Wait 2 seconds between readings

  // Read temperature and humidity
  float humidity = dht.readHumidity();
  float temperature = dht.readTemperature();

  // Check if the readings are valid
  if (isnan(humidity) || isnan(temperature)) {
    Serial.println("Failed to read from DHT sensor!");
    return;
  }

  // Print the results to the Serial Monitor
  Serial.print("Humidity: ");
  Serial.print(humidity);
  Serial.print(" %\t");
  Serial.print("Temperature: ");
  Serial.print(temperature);
  Serial.println(" °C");
}

Best Practices

  • Use a pull-up resistor (10kΩ) on the DATA line to ensure stable communication.
  • Place the sensor in a location with good airflow for accurate readings.
  • Avoid long wires between the sensor and the microcontroller to minimize signal degradation.

Troubleshooting and FAQs

Common Issues

  1. No Data Output:

    • Ensure the sensor is powered correctly (3.3V to 5.5V).
    • Verify the pull-up resistor is connected between the DATA pin and VCC.
    • Check the wiring and ensure the DATA pin is connected to the correct microcontroller pin.
  2. Incorrect Readings:

    • Ensure the sensor is operating within its specified temperature and humidity range.
    • Avoid placing the sensor in direct sunlight or near heat sources.
    • Allow the sensor to stabilize for a few seconds after powering it on.
  3. "Failed to Read from DHT Sensor" Error:

    • Verify the sensor is connected to the correct pin defined in the code.
    • Check for loose or faulty connections.

FAQs

Q: Can the DHT11-2 measure negative temperatures?
A: No, the DHT11-2 can only measure temperatures in the range of 0°C to 50°C.

Q: How long does the sensor take to provide a reading?
A: The DHT11-2 requires a minimum sampling period of 1 second between readings.

Q: Can I use the DHT11-2 with a 3.3V microcontroller?
A: Yes, the DHT11-2 operates within a voltage range of 3.3V to 5.5V, making it compatible with 3.3V systems.

Q: Is the DHT11-2 waterproof?
A: No, the DHT11-2 is not waterproof and should not be exposed to water or condensation.