The DH-11 Sensor by Kuongshun Electronics is a reliable and cost-effective device designed to measure ambient temperature and humidity levels. It is widely used in applications such as weather monitoring systems, HVAC (Heating, Ventilation, and Air Conditioning) systems, and smart home automation. The sensor provides digital output, making it easy to interface with microcontrollers like Arduino, Raspberry Pi, and other embedded systems.
This sensor is ideal for projects requiring basic environmental monitoring, offering a balance of accuracy, simplicity, and affordability.
The following are the key technical details of the DH-11 Sensor:
The DH-11 Sensor has a 4-pin interface, but typically only 3 pins are used in most applications. Below is the pinout:
Pin Number | Pin Name | Description |
---|---|---|
1 | VCC | Power supply (3.3V to 5.5V DC) |
2 | DATA | Digital data output (1-wire protocol) |
3 | NC | Not connected (leave unconnected) |
4 | GND | Ground (0V reference) |
Note: Some DH-11 modules may include a pull-up resistor on the DATA pin. If not, you may need to add an external 10kΩ pull-up resistor.
Below is an example of how to connect the DH-11 Sensor to an Arduino UNO:
Here is a sample Arduino sketch to read data from the DH-11 Sensor using the DHT
library:
#include <DHT.h>
// Define the pin where the DH-11 DATA pin is connected
#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 serial communication at 9600 baud
dht.begin(); // Initialize the DHT sensor
Serial.println("DH-11 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 DH-11 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");
}
No Data Output:
Incorrect or NaN Readings:
Sensor Not Responding:
Q1: Can the DH-11 Sensor measure negative temperatures?
No, the DH-11 Sensor is designed to measure temperatures in the range of 0°C to 50°C.
Q2: How accurate is the DH-11 Sensor?
The temperature accuracy is ±2°C, and the humidity accuracy is ±5%. For applications requiring higher precision, consider using the DHT22 sensor.
Q3: Can I use the DH-11 Sensor outdoors?
The DH-11 Sensor is not waterproof and is intended for indoor use. If used outdoors, ensure it is housed in a protective enclosure.
Q4: What is the maximum cable length for the DH-11 Sensor?
The recommended maximum cable length is 20 meters. For longer distances, use a shielded cable and reduce the pull-up resistor value to 5kΩ.
By following this documentation, you can effectively integrate the DH-11 Sensor into your projects for reliable temperature and humidity monitoring.