

The DHT11 is a digital sensor designed to measure both temperature and humidity. Manufactured by Arduino with the part ID UNO, this sensor provides reliable and accurate readings, making it a popular choice for a wide range of applications. Its compact size and ease of use make it ideal for projects such as weather monitoring, HVAC systems, and home automation.








The DHT11 sensor operates on digital communication and provides temperature and humidity data in a single package. Below are its key technical details:
| 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 (Relative Humidity) |
| Humidity Accuracy | ±5% RH |
| Sampling Period | 1 second |
| Communication Protocol | Single-wire digital signal |
The DHT11 sensor has four pins, but typically only three are used in most applications. Below is the pinout:
| Pin Number | Name | Description |
|---|---|---|
| 1 | VCC | Power supply (3.3V to 5.5V) |
| 2 | DATA | Digital data output |
| 3 | NC (Not Connected) | Not used |
| 4 | GND | Ground |
The DHT11 sensor is straightforward to use in a circuit. It communicates via a single-wire protocol, making it compatible with microcontrollers like the Arduino UNO. Below are the steps to use the DHT11 sensor:
Below is an example code to read temperature and humidity data from the DHT11 sensor using the Arduino UNO. This code uses the popular DHT library.
// Include the DHT library
#include <DHT.h>
// Define the DHT11 pin and type
#define DHTPIN 2 // Pin connected to the DATA pin of DHT11
#define DHTTYPE DHT11 // Specify the sensor type (DHT11)
// Initialize the DHT sensor
DHT dht(DHTPIN, DHTTYPE);
void setup() {
Serial.begin(9600); // Start serial communication
dht.begin(); // Initialize the DHT sensor
Serial.println("DHT11 Sensor Initialized");
}
void loop() {
delay(2000); // Wait 2 seconds between readings
// Read temperature and humidity
float humidity = dht.readHumidity();
float temperature = dht.readTemperature();
// Check if 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(" %\t");
Serial.print("Temperature: ");
Serial.print(temperature);
Serial.println(" °C");
}
No Data Output:
Incorrect Readings:
"Failed to Read from DHT Sensor" Error:
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. For outdoor applications, consider using a sensor with a wider operating range and better environmental protection.
Q: What is the difference between the DHT11 and DHT22?
A: The DHT22 offers a wider temperature and humidity range with higher accuracy compared to the DHT11. However, the DHT11 is more affordable and sufficient for basic applications.
By following this documentation, you can effectively integrate the DHT11 sensor into your projects and troubleshoot common issues with ease.