The KY-015 module is based on the DHT11 sensor, which combines a humidity sensor and a temperature sensor into a single chip used for measuring ambient temperature and humidity.
It has relatively low accuracy compared to more advanced sensors like the DHT22 or the SHT series. Additionally, it has a slow response time and can be sensitive to external factors such as airflow and condensation.
The module provides digital output signals that can be easily interfaced and read by microcontrollers such as Arduino, Raspberry Pi, ESP32, etc. The data is transmitted using a single-wire digital protocol.
This article will provide detailed information about the digital DHT11 temperature & humidity sensor module KY-015, including specifications, pinout, circuit & connection diagram, and how to interface with Arduino, and more. Let's get started!
KY-015 Module Specifications
The quick specifications of the KY-015 temperature and humidity sensor module is given below:
- Type: Digital
- Module: Temperature and Humidity Sensor
- Operating Voltage: DC 3.3V to 5V
- Humidity Measurement Range: 20% to 90% RH
- Humidity Measurement Accuracy: ±5% RH
- Humidity Measurement Resolution: 1% RH
- Temperature Measurement Range: 0°C to 50°C [32°F to 122°F]
- Temperature Measurement Accuracy: ±2°C
- Temperature Measurement Resolution: 1°C
- Signal transmission range: 20m
- Board Dimantions (L x W x H): 15.5mm x 12mm x 5.5mm
- Weight: 8gm
KY-015 Module Pinout
The module has 3 male header pins those are -
- Pin (S): Digital Signal
- Pin (Middle): DC +5V
- Pin (-): GND
KY-015 Module Circuit Diagram
Schematic of the ky-015 (dht11) temperature and humidity sensor module circuit is shown below.
Components are used in the circuit - S1: DHT11 Sensor, and R1: 10kΩ Resistor.
KY-015 Module Interfacing with Arduino
Connection diagram of the KY-015 temperature and humidity sensor module with an Arduino is shown below.
Connect the power pin (middle) and ground pin (-) of the ky-015 module to +5V and GND on the Arduino, respectively. The module signal pin (s) connect to digital pin 2 on the Arduino.
Arduino Source Code
Here's a basic Arduino sketch for the KY-015 temperature and humidity sensor module.
Make sure you have the DHT library installed in your Arduino IDE before uploading the sketch.
To install the library, go to "Sketch" > "Include Library" > "Manage Libraries" and search for "DHT", then click "Install" next to the "DHT sensor library" by Adafruit.
The following sketch will read the temperature and humidity values from the sensor and display them on the serial monitor.
#include <DHT.h> // Include the DHT library
#define DHTPIN 2 // Pin connected to the KY-015 sensor
#define DHTTYPE DHT11 // Define the type of KY-015 sensor being used DHT11
DHT dht(DHTPIN, DHTTYPE); // Create a DHT object
void setup() {
Serial.begin(9600); // Initialize the serial communication at a baud rate of 9600
dht.begin(); // Initialize the KY-015 sensor
}
void loop() {
delay(2000); // Delay for 2 seconds
float temperature = dht.readTemperature(); // Read temperature value in Celsius
float humidity = dht.readHumidity(); // Read humidity value
if (isnan(temperature) || isnan(humidity)) {
Serial.println("Failed to read from KY-015 sensor!"); // Print an error message if the readings are not valid
return;
}
Serial.print("Temperature: ");
Serial.print(temperature); // Print the temperature value
Serial.print(" °C\t"); // Print a tab character
Serial.print("Humidity: ");
Serial.print(humidity); // Print the humidity value
Serial.println(" %"); // Print a new line
}
After uploading the sketch to your Arduino board, open the serial monitor at a baud rate of 9600. You should see the temperature and humidity readings displayed in the serial monitor every 2 seconds.
No comments
If you have any doubts or questions, please let me know. Don't add links as it goes to spam. Share your valuable feedback. Thanks