KY-013 Analog Temperature Sensor Module


Analog Temperature Sensor module KY-013 for Arduino, measures ambient temperature based on resistance of the thermistor.



KY-013 Specifications

The KY-013 Analog Temperature Sensor module consist of a NTC thermistor and a 10 kΩ resistor. The resistance of the thermistor varies with surrounding temperature, we'll use the Steinhart–Hart equation to derive precise temperature of the thermistor.

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


KY-013 Connection Diagram

Connect board's power line (middle) and ground (-) to 5V and GND respectively. Connect signal (S) to pin A0 on the Arduino.

S A0
middle 5V

Some KY-013 boards are labeled incorrectly,  if you are getting inverted readings (temperature drops when sensor is heated) try swapping signal (S) and ground (-).

Arduino KY-013 analog temperature sensor module connection diagramclick to enlarge

KY-013 Example Code

The following Arduino Sketch will derive the temperature of the thermistor using the Steinhart-Hart equation implemented in the function Thermister.

#include <math.h>

double Thermister(int RawADC) {
	double Temp;
	Temp = log(((10240000/RawADC) - 10000));
	Temp = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 * Temp * Temp ))* Temp );
	Temp = Temp - 273.15; // Convert Kelvin to Celcius
	return Temp;

void setup() {

void loop() {
	Serial.print(Thermister(analogRead(0))); //read pin A0


Leave a Reply

2 Comments on "KY-013 Analog Temperature Sensor Module"

newest oldest most voted

hi, iam using arduino IDE 1.8.5 and I get in the monitor serie a result of nanc (I believe the translation is “not a number” c) whats the problem?


A division by zero is the problem. You are receiving zero from pin A0.