KY-015 Temperature and Humidity DHT11 Sensor with Arduino


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 UNO1Buy Now
Jumper Wires3Buy Now
Breadboard1Buy 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.



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 Voltage3.3V to 5.5V
Humidity measurement range20% to 90% RH
Humidity measurement accuracy±5% RH
Humidity measurement resolution1% RH
Temperature measurement range0ºC to 50ºC [32ºF to 122ºF]
Temperature measurement accuracy±2ºC
Temperature measurement resolution1ºC
Signal transmission range20m


  1. Easy to use and integrate with most microcontrollers
  2. Compact design and low power consumption
  3. Provides accurate temperature and humidity readings
  4. Comes with a 3-pin male header for easy connection
  5. Suitable for various applications, including weather stations, smart homes, and environmental monitoring systems



Pin Configuration

Pin NamePin Type
SIGSignal Pin
VCCPositive supply Pin
GNDGround 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


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.

Pin 8S Pin
+5VVCC 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


//For more Projects:

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()
  pinMode(DHpin, OUTPUT);
void loop()
  Serial.print("Humdity = ");
  Serial.print(dat[0], DEC); //Displays the integer bits of humidity;
  Serial.print(dat[1], DEC); //Displays the decimal places of the humidity;
  Serial.print("Temperature = ");
  Serial.print(dat[2], DEC); //Displays the integer bits of temperature;
  Serial.print(dat[3], DEC); //Displays the decimal places of the temperature;
  byte checksum = dat[0] + dat[1] + dat[2] + dat[3];
  if (dat[4] != checksum) 
    Serial.println("-- Checksum Error!");
    Serial.println("-- OK");


  1. Weather stations
  2. Smart homes and home automation systems
  3. HVAC (Heating, Ventilation, and Air Conditioning) systems
  4. Environmental monitoring systems
  5. Agriculture and greenhouse monitoring systems
  6. Food storage monitoring systems


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.

Leave a Comment