Interfacing KY-013 Analog Temperature Sensor module with Arduino


In this tutorial, we Interfacing KY-013 Analog Temperature Sensor module with Arduino, The KY-013 Analog Temperature Sensor module can measure the ambient temperature based on the resistance of the thermistor that is placed on the module.

This module is compatible to interfacing with popular electronic platforms like Arduino, ESP32, Raspberry Pi, and other microcontrollers.

Hardware Required

You will require the following Hardware Components for the Interfacing KY-013 Analog Temperature Sensor module with Arduino

Components#Buy From Amazon
Arduino UNO1Buy Now
KY-013 Analog Temperature Sensor module1Buy Now
37 in 1 Sensors kitBuy Now
Jumper WiresBuy Now
Breadboard1Buy Now

What is a KY-013 Analog Temperature Sensor module?

The KY-013 Analog Temperature Sensor module is a device used to measure the temperature of a surrounding environment. It consists of a thermistor, which is a type of resistor that changes its resistance value based on temperature, and an amplifier circuit that amplifies the small changes in resistance caused by temperature to produce an output voltage that can be easily read by an analog-to-digital converter (ADC).



This module includes a 10 kΩ resistor, an NTC thermistor, and 3 male header pins. The thermistor resistance changes according to its surrounding temperature. The value of resistance can be operated to measure the actual temperature.

Operating Voltage5V
Temperature measurement range-55°C to 125°C [-67°F to 257°F]
Measurement Accuracy±0.5°C



Pin Configuration

Pin NamePin Type
SSignal Pin
middleVCC (+5v)
Ground Pin

Circuit Diagram

The following circuit shows you the connection of the KY-013 Analog Temperature Sensor module with Arduino Please make the connection carefully


Circuit Connections

Place the module on the BreadBoard and connect the power line pin (middle) of the module to the 5V pin of the arduino and the ground (-) pin to the GND pin of the Arduino and finally connect the signal (S) pin of the module to A0 pin of the Arduino respectively.

A few KY-013 modules have different pin configurations, before using that module please check their connections.


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


The following Arduino code will operate the temperature from the thermistor utilizing the Steinhart-Hart equation. The code will return the temperature in Celcius, uncomment line 17 to get the temperature in Fahrenheit.

int ThermistorPin = A0;
int Vo;
float R1 = 10000; // value of R1 on board
float logR2, R2, T;
float c1 = 0.001129148, c2 = 0.000234125, c3 = 0.0000000876741; //steinhart-hart coeficients for thermistor
void setup() {
void loop() {
  Vo = analogRead(ThermistorPin);
  R2 = R1 * (1023.0 / (float)Vo - 1.0); //calculate resistance on thermistor
  logR2 = log(R2);
  T = (1.0 / (c1 + c2*logR2 + c3*logR2*logR2*logR2)); // temperature in Kelvin
  T = T - 273.15; //convert Kelvin to Celcius
 // T = (T * 9.0)/ 5.0 + 32.0; //convert Celcius to Farenheit
  Serial.print("Temperature: "); 
  Serial.println(" C"); 


  1. Temperature control in HVAC (heating, ventilation, and air conditioning) systems: The sensor can monitor a room’s temperature and send signals to control the heating or cooling system to maintain a desired temperature.
  2. Temperature monitoring in refrigeration systems: The sensor can monitor the temperature inside a refrigerator or freezer to ensure that food and other perishable items are stored at the proper temperature.
  3. Overheating protection in electronics: The sensor can monitor the temperature of electronic components and devices, shut them down, or activate a cooling system if the temperature exceeds a safe limit.
  4. Environmental monitoring: The sensor can be used to monitor the temperature in various outdoor environments, such as agriculture or meteorology, to track changes in temperature over time.
  5. Thermostatic control: The sensor can be used in thermostats to control the temperature of a room or environment, turning on heating or cooling systems as needed.

Leave a Comment