

The DHT11 Temperature & Humidity Sensor (Manufacturer: Duinotech, Part ID: XC4520) is a low-cost, digital sensor designed to measure temperature and humidity. It provides reliable and accurate readings, making it ideal for a variety of applications. The DHT11 is widely used in weather monitoring systems, HVAC (Heating, Ventilation, and Air Conditioning) systems, and home automation projects. Its compact size and ease of use make it a popular choice for both hobbyists and professionals.








The following table outlines the key technical details of the DHT11 sensor:
| Parameter | Value |
|---|---|
| Operating Voltage | 3.3V to 5.5V |
| Operating Current | 0.3mA (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 |
| Sampling Rate | 1 Hz (1 reading per second) |
| Communication Protocol | Single-wire digital signal |
| Dimensions | 15.5mm x 12mm x 5.5mm |
The DHT11 sensor has four pins, as described in the table below:
| Pin Number | Pin Name | Description |
|---|---|---|
| 1 | VCC | Power supply pin (3.3V to 5.5V) |
| 2 | DATA | Digital data output pin for temperature and humidity readings |
| 3 | NC | Not connected (leave unconnected) |
| 4 | GND | Ground pin |
Below is an example of how to use the DHT11 sensor with an Arduino UNO. This code uses the popular DHT library.
#include <DHT.h>
// Define the pin connected to the DHT11 sensor
#define DHTPIN 2
// Define the type of DHT sensor (DHT11 in this case)
#define DHTTYPE DHT11
// Initialize the DHT sensor
DHT dht(DHTPIN, DHTTYPE);
void setup() {
Serial.begin(9600); // Start the serial communication at 9600 baud
dht.begin(); // Initialize the DHT sensor
Serial.println("DHT11 Sensor Initialized");
}
void loop() {
delay(2000); // Wait 2 seconds between readings
// Read temperature and humidity values
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 readings to the Serial Monitor
Serial.print("Humidity: ");
Serial.print(humidity);
Serial.print("% Temperature: ");
Serial.print(temperature);
Serial.println("°C");
}
No Data or Incorrect Readings:
Sensor Not Responding:
DHTPIN in the example above).Inconsistent Readings:
Q: Can the DHT11 measure negative temperatures?
A: No, the DHT11 can only measure temperatures in the range of 0°C to 50°C.
Q: Can I use the DHT11 outdoors?
A: The DHT11 is not designed for outdoor use. Prolonged exposure to extreme conditions may damage the sensor.
Q: What is the difference between the DHT11 and DHT22?
A: The DHT22 offers a wider temperature and humidity range with higher accuracy but is more expensive than the DHT11.
Q: Do I need an external library to use the DHT11 with Arduino?
A: While you can write custom code, it is recommended to use the DHT library for simplicity and reliability.
By following this documentation, you can effectively integrate the DHT11 sensor into your projects and troubleshoot common issues with ease.