

The KY-005 is a digital temperature sensor module that utilizes the DS18B20 sensor to provide accurate and reliable temperature readings. This module is widely used in electronic projects for temperature monitoring and control due to its ease of use and compatibility with microcontrollers like Arduino. The KY-005 supports a wide temperature range and features a digital output, making it suitable for applications such as weather stations, HVAC systems, and industrial temperature monitoring.








The KY-005 module has three pins, as described in the table below:
| Pin Number | Pin Name | Description |
|---|---|---|
| 1 | GND | Ground pin, connects to the ground of the circuit |
| 2 | VCC | Power supply pin, connects to 3.3V or 5V |
| 3 | DOUT | Digital output pin, communicates temperature data |
Wiring the KY-005:
Pull-Up Resistor:
Programming:
Below is an example of how to use the KY-005 with an Arduino UNO:
#include <OneWire.h>
#include <DallasTemperature.h>
// Define the pin connected to the KY-005 DOUT pin
#define ONE_WIRE_BUS 2
// Initialize the OneWire and DallasTemperature libraries
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
void setup() {
Serial.begin(9600); // Start serial communication at 9600 baud
sensors.begin(); // Initialize the DS18B20 sensor
Serial.println("KY-005 Temperature Sensor Initialized");
}
void loop() {
sensors.requestTemperatures(); // Request temperature data from the sensor
float temperature = sensors.getTempCByIndex(0); // Get temperature in Celsius
// Check if the temperature reading is valid
if (temperature != DEVICE_DISCONNECTED_C) {
Serial.print("Temperature: ");
Serial.print(temperature);
Serial.println(" °C");
} else {
Serial.println("Error: Sensor not detected!");
}
delay(1000); // Wait 1 second before the next reading
}
No Temperature Reading:
Incorrect Temperature Values:
Sensor Not Detected:
Interference on the 1-Wire Bus:
Q: Can the KY-005 be powered with 3.3V?
Q: How many sensors can I connect to a single 1-Wire bus?
Q: Is the KY-005 suitable for outdoor use?
Q: What is the maximum cable length for the 1-Wire bus?
This concludes the documentation for the KY-005 module.