Interfacing KY-001 Temperature Sensor with Arduino


In this tutorial, we are going to Interfacing KY-001 Temperature Sensor with Arduino, The KY-001 Temperature Sensor Module enables measuring the atmosphere’s ambient temperature by operating the digital serial bus. It is possible to attach more than one sensor module on the same bus.

This module is compatible with popular electronic platforms like Arduino, ESP32, Raspberry Pi, and other microcontrollers. To interface with them and sense the input temperature from the atmosphere and display results on the monitor.


Hardware Required

You will require the following Hardware Components for the Interfacing KY-001 Temperature Sensor with Arduino.

Components#Buy From Amazon
Arduino UNO1Buy Link
KY-001 Temperature Sensor Module1Buy Link
Jumper Wires1Buy Link
Breadboard1Buy Link


This module includes the single-bus DS18B20 digital temperature sensor, a resistor, an LED, and 3 male header pins.

Operating Voltage3.0V to 5.5V
Temperature Measurement Range-55°C to 125°C [-57°F to 257°F]
Measurement Accuracy Range±0.5°C
Board Dimensions18.5mm x 15mm [0.728in x 0.591in]

Technical Data

MODELTemperature sensor
Communication Protocol1-Wire
Accuracy9 to 12 Bit
Measuring range-55 °C to +125 °C
Measurement accuracy±0.5 °C from -10 °C to +85 °C



Pin Configuration

Pin NamePin Type
SIGSignal Output
+5VPower Supply Pin
GNDGround Pin

Circuit Connections

Now attach the power supply line (middle) and ground (-) of the module to the +5V pin and GND pin on the Arduino side respectively. and then connect the signal pin (S) of the module to pin 2 of the Arduino.

ArduinoKY-001 Module
Pin 2Signal

Circuit Diagram

The following circuit shows you the connection of the KY-001 Module with Arduino Please make the connection carefully


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

Installing Libraries

Now when you are Ready to upload the code, to the Arduino Board you will need first to add the Following Libraries in Arduino, If you Learn How to add the library in the Arduino step-by-step guide click on how to install the library Button given Blow


The given below Arduino code will operate the OneWire library to communicate serial with the module and it will output the temperature read by the device.

//For more Projects:
#include <OneWire.h>
#include <DallasTemperature.h>
// Data wire is plugged into pin 2 on the Arduino
#define ONE_WIRE_BUS 2
// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature. 
DallasTemperature sensors(&oneWire);
void setup(void)
  // start serial port
  Serial.println("Dallas Temperature IC Control Library Demo");
  // Start up the library
  sensors.begin(); // IC Default 9 bit. If you have troubles consider upping it 12. Ups the delay giving the IC more time to process the temperature measurement
void loop(void)
  // call sensors.requestTemperatures() to issue a global temperature 
  // request to all devices on the bus
  Serial.print("Requesting temperatures...");
  sensors.requestTemperatures(); // Send the command to get temperatures
  Serial.print("Temperature for Device 1 is: ");
  Serial.print(sensors.getTempCByIndex(0)); // Why "byIndex"? You can have more than one IC on the same bus. 0 refers to the first IC on the wire


  1. Weather Stations and Environmental Monitoring: The KY-001 Temperature Sensor Module is an excellent choice for weather stations and environmental monitoring systems. It allows you to measure ambient temperature accurately, enabling you to track temperature variations over time and analyze climate patterns.
  2. Home Automation and HVAC Control: In home automation projects, the KY-001 Temperature Sensor Module plays a crucial role in regulating heating, ventilation, and air conditioning (HVAC) systems. By monitoring indoor temperature, you can create a smart HVAC control system that ensures optimal comfort while also saving energy.
  3. Temperature-Dependent Alarms and Alerts: With the KY-001 Temperature Sensor Module, you can design temperature-dependent alarm systems. For example, in industrial settings or server rooms, if the temperature exceeds a predefined threshold, the sensor can trigger alarms or notifications, alerting personnel to take necessary actions.
  4. Aquatic and Terrarium Temperature Monitoring: For aquariums and terrariums, the KY-001 Temperature Sensor Module is an invaluable tool. It allows you to monitor the water or enclosure temperature, helping you maintain the ideal environment for aquatic life or specific reptile species.
  5. Agriculture and Greenhouse Automation: In agriculture and greenhouse applications, the KY-001 Temperature Sensor Module can be employed to control and optimize growing conditions. By tracking temperature fluctuations, you can automate irrigation, ventilation, and heating systems, ensuring the best possible environment for crops and plants.

1 thought on “Interfacing KY-001 Temperature Sensor with Arduino”

Leave a Comment