The KY-005 is a digital temperature and humidity sensor module that integrates the DHT11 sensor. Manufactured by ESP-32 with the part ID CINCO, this module is designed to provide accurate and reliable measurements of temperature and humidity. It is widely used in environmental monitoring, home automation, weather stations, and other applications requiring real-time climate data.
The KY-005 is compact, easy to use, and compatible with microcontrollers such as Arduino, Raspberry Pi, and ESP32. Its digital output simplifies integration into various projects, making it an excellent choice for both beginners and experienced developers.
The KY-005 module is built around the DHT11 sensor, which offers the following key specifications:
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 |
Communication Protocol | Single-wire digital signal |
Sampling Period | ≥1 second |
The KY-005 module has three pins, as described in the table below:
Pin | Name | Description |
---|---|---|
1 | VCC | Power supply pin (3.3V to 5.5V) |
2 | DATA | Digital signal output for temperature and humidity |
3 | GND | Ground connection |
Below is an example of how to use the KY-005 with an Arduino UNO:
#include <DHT.h>
// Define the pin connected to the KY-005 DATA pin
#define DHTPIN 2
// Define the type of DHT sensor (DHT11 for KY-005)
#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("KY-005 Temperature and Humidity Sensor");
}
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 KY-005 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 Readings:
Sensor Not Detected:
Q: Can the KY-005 measure negative temperatures?
A: No, the KY-005 (DHT11) has a temperature range of 0°C to 50°C and cannot measure negative temperatures.
Q: What is the maximum cable length for the KY-005?
A: The recommended maximum cable length is 20 meters, but shorter lengths are preferred to maintain signal quality.
Q: Can the KY-005 be powered with 3.3V?
A: Yes, the KY-005 operates within a voltage range of 3.3V to 5.5V.