Introduction
In this tutorial we learn about KY-015 Temperature and Humidity DHT11 Sensor with Arduino, The KY-015 Temperature and Humidity Sensor Module is a compact and easy-to-use module that measures both temperature and humidity in the surrounding environment. This module is compatible with most microcontrollers, including Arduino and Raspberry Pi, and provides accurate and reliable readings.
This module is compatible with popular electronic platforms like Arduino, ESP32, Raspberry Pi, and other microcontrollers. To detect the Temperature and Humidity and Display Results on Serial Monitor
Hardware Required
You will require the following Hardware Components for interfacing the KY-015 TEMPERATURE AND HUMIDITY SENSOR MODULE with Arduino.
Components | # | Buy From Amazon |
---|---|---|
Arduino UNO | 1 | Buy Now |
KY-015 SENSOR MODULE | 1 | Buy Now |
Jumper Wires | 3 | Buy Now |
Breadboard | 1 | Buy Now |
What is the KY-015 SENSOR MODULE?
The KY-015 Temperature and Humidity Sensor Module is a sensor that measures the temperature and humidity of the surrounding environment. It uses a DHT11 sensor and a resistor to measure the temperature and humidity, respectively. The module has a compact design and can be easily integrated into various projects.
![KY-015-Temperature-and-Humidity-Sensor-Module](http://arduinocircuit.com/wp-content/uploads/2023/03/KY-015-Temperature-and-Humidity-Sensor-Module.webp)
Specifications
The DHT11 module is equipped with a digital temperature and humidity sensor, a 1 kΩ resistor, and 3 male header pins. This sensor is designed to detect the temperature and humidity of its surroundings using an internal thermistor and capacitive humidity sensor. The readings are then converted to a digital signal through an internal chip.
Operating Voltage | 3.3V to 5.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 |
Features
- Easy to use and integrate with most microcontrollers
- Compact design and low power consumption
- Provides accurate temperature and humidity readings
- Comes with a 3-pin male header for easy connection
- Suitable for various applications, including weather stations, smart homes, and environmental monitoring systems
Pinout
![KY-015-Temperature-and-Humidity-Sensor-Pinout](http://arduinocircuit.com/wp-content/uploads/2023/03/KY-015-Temperature-and-Humidity-Sensor-Pinout-.webp)
Pin Configuration
Pin Name | Pin Type |
---|---|
SIG | Signal Pin |
VCC | Positive supply Pin |
GND | Ground Pin |
Circuit Diagram
The following circuit shows you the connection of the KY-015 TEMPERATURE AND HUMIDITY SENSOR MODULE with Arduino Please make the connection carefully
![Interfacing-KY-015-Temperature-and-Humidity-Sensor-Module-with-Arduino-circuit](http://arduinocircuit.com/wp-content/uploads/2023/03/Interfacing-KY-015-Temperature-and-Humidity-Sensor-Module-with-Arduino-circuit-1024x597.webp)
Circuit Connections
Place the Moduel on the Breadboard and Connect the Power line (middle) of the module on +5 of the Arduino and ground (-) to the GND of Arduino and last Connect signal (S) to pin 8 of the Arduino respectively.
Arduino | Module |
---|---|
Pin 8 | S Pin |
+5V | VCC Pin |
GND | GND Pin |
Installing Arduino IDE Software
First, you will require to Download the updated version of Arduino IDE Software and Install it on your PC or laptop. if you Learn How to install the Arduino step-by-step guide then click on how to install Arduino Button given Blow
Code
//For more Projects: www.arduinocircuit.com
int DHpin = 8; // input/output pin
byte dat[5];
byte read_data()
{
byte i = 0;
byte result = 0;
for (i = 0; i < 8; i++) {
while (digitalRead(DHpin) == LOW); // wait 50us
delayMicroseconds(30); //The duration of the high level is judged to determine whether the data is '0' or '1'
if (digitalRead(DHpin) == HIGH)
result |= (1 << (8 - i)); //High in the former, low in the post
while (digitalRead(DHpin) == HIGH); //Data '1', waiting for the next bit of reception
}
return result;
}
void start_test()
{
digitalWrite(DHpin, LOW); //Pull down the bus to send the start signal
delay(30); //The delay is greater than 18 ms so that DHT 11 can detect the start signal
digitalWrite(DHpin, HIGH);
delayMicroseconds(40); //Wait for DHT11 to respond
pinMode(DHpin, INPUT);
while(digitalRead(DHpin) == HIGH);
delayMicroseconds(80); //The DHT11 responds by pulling the bus low for 80us;
if(digitalRead(DHpin) == LOW)
delayMicroseconds(80); //DHT11 pulled up after the bus 80us to start sending data;
for(int i = 0; i < 5; i++) //Receiving temperature and humidity data, check bits are not considered;
dat[i] = read_data();
pinMode(DHpin, OUTPUT);
digitalWrite(DHpin, HIGH); //After the completion of a release of data bus, waiting for the host to start the next signal
}
void setup()
{
Serial.begin(9600);
pinMode(DHpin, OUTPUT);
}
void loop()
{
start_test();
Serial.print("Humdity = ");
Serial.print(dat[0], DEC); //Displays the integer bits of humidity;
Serial.print('.');
Serial.print(dat[1], DEC); //Displays the decimal places of the humidity;
Serial.println('%');
Serial.print("Temperature = ");
Serial.print(dat[2], DEC); //Displays the integer bits of temperature;
Serial.print('.');
Serial.print(dat[3], DEC); //Displays the decimal places of the temperature;
Serial.println('C');
byte checksum = dat[0] + dat[1] + dat[2] + dat[3];
if (dat[4] != checksum)
Serial.println("-- Checksum Error!");
else
Serial.println("-- OK");
delay(1000);
}
Applications
- Weather stations
- Smart homes and home automation systems
- HVAC (Heating, Ventilation, and Air Conditioning) systems
- Environmental monitoring systems
- Agriculture and greenhouse monitoring systems
- Food storage monitoring systems
Conclusion
The KY-015 Temperature and Humidity Sensor Module is a versatile and reliable sensor module that provides accurate temperature and humidity readings. Its compact design and easy-to-use interface make it suitable for a wide range of applications, including weather stations, smart homes, and environmental monitoring systems.