Measures relative humidity (RH) from 20% to 90% with an accuracy of 5%.
Measures relative humidity (RH) from 20% to 90% with an accuracy of 5%.
Measures temperature from 0C to 50C with an accuracy of 2C.
Sends digital signals to the microcontroller or other compatible devices.
| Single-Bus Digital Interface | Uses a single bus for communication, which simplifies the connection and reduces the number of pins required. |
Operates at a low voltage (3.3V to 5V) and consumes minimal power (typically 0.5mA).
Has a small form factor, making it suitable for use in compact devices and designs.
Provides high accuracy and reliability in various environments.
Technical Specifications
3.3V to 5V
0.5mA
20% to 90% RH
0C to 50C
| + Humidity | 5% RH |
| + Temperature | 2C |
| + Humidity | 5 seconds |
| + Temperature | 15 seconds |
Single-bus digital interface
15mm x 12mm x 5.5mm
Approximately 2g
Typical Applications
Weather stations
Home automation systems
IoT projects
Environmental monitoring
Industrial automation
Medical devices
Interface and Connection
| The DHT11 sensor has four pins | |
| VCC (Power supply) | Connect to a 3.3V or 5V power source. |
| GND (Ground) | Connect to the ground. |
| DATA (Data output) | Connect to a digital input pin on the microcontroller or other compatible devices. |
| NC (No connection) | Not used. |
Notes and Precautions
The DHT11 sensor is sensitive to environmental factors, such as air pressure and airflow. Ensure proper installation and calibration for accurate measurements.
Avoid exposing the sensor to direct sunlight, high temperatures, or extreme humidity levels, which may affect its performance and accuracy.
Use a voltage regulator or a power supply module to ensure a stable power supply to the sensor.
DHT11 Humidity and Temperature Sensor DocumentationThe DHT11 is a low-cost, digital humidity and temperature sensor that provides precise and reliable measurements. This sensor is widely used in IoT applications, such as weather stations, home automation, and industrial control systems.Technical Specifications:Temperature Range: 0C to 50C (32F to 122F)
Humidity Range: 20% to 80% RH
Temperature Accuracy: 2C (3.6F)
Humidity Accuracy: 5% RH
Operating Voltage: 3.3V to 5.5V
Communication Protocol: 1-WirePinout:The DHT11 sensor has three pins:VCC (Pin 1): Connect to 3.3V or 5V power supply
DATA (Pin 2): Connect to digital pin on the microcontroller
GND (Pin 3): Connect to groundCode Examples:### Example 1: Using the DHT11 with an Arduino BoardIn this example, we will use the DHT11 library for Arduino to read the temperature and humidity values.```c++
#include <DHT.h>#define DHTPIN 2 // Digital pin connected to the DHT11 sensor
#define DHTTYPE DHT11 // DHT 11DHT dht(DHTPIN, DHTTYPE);void setup() {
Serial.begin(9600);
dht.begin();
}void loop() {
int h = dht.readHumidity();
int t = dht.readTemperature();if (isnan(h) || isnan(t)) {
Serial.println("Failed to read from DHT sensor!");
return;
}Serial.print("Humidity: ");
Serial.print(h);
Serial.print(" % ");
Serial.print("Temperature: ");
Serial.print(t);
Serial.println(" C");
delay(2000);
}
```### Example 2: Using the DHT11 with a Raspberry Pi (Python)In this example, we will use the python-dht library to read the temperature and humidity values using a Raspberry Pi.```python
import Adafruit_DHTsensor = Adafruit_DHT.DHT11
pin = 4 # GPIO pin connected to the DHT11 sensorwhile True:
humidity, temperature = Adafruit_DHT.read_retry(sensor, pin)if humidity is not None and temperature is not None:
print("Humidity: {:.1f}%".format(humidity))
print("Temperature: {:.1f}C".format(temperature))
else:
print("Failed to retrieve data from sensor!")
```Note: Make sure to install the necessary libraries and dependencies before running the code examples.Tips and Tricks:Make sure to connect the DHT11 sensor to a 3.3V or 5V power supply and avoid using it with 1.8V or lower voltages.
Use a 1k resistor between the VCC and DATA pins to prevent voltage spikes and ensure reliable communication.
The DHT11 sensor has a built-in pull-up resistor, so you don't need an external pull-up resistor.
The sensor's accuracy and reliability can be affected by temperature and humidity fluctuations, so make sure to provide a stable operating environment.