KY-013 Temperature Sensor Module


The KY-013 Module is an Analog temperature sensor module that uses a small NTC thermistor and an SMD resistor on the board, which form a voltage divider circuit to measure the ambient temperature.

It is a small, inexpensive circuit board that can be easily interfaced with microcontrollers such as Arduino, Raspberry Pi, ESP32, etc.

The output signal voltage of this sensor module is proportional to the temperature, and it can be measured by an Analog input pin of a microcontroller. This measurement can perform any necessary actions based on the temperature reading.

This article will provide detailed information about KY-013 analog temperature sensor module, including specifications, pinout, circuit & connection diagram, and how to interface with Arduino, and more. Let's get started!

KY-013 Module Specifications

The quick specifications of the KY-013 temperature sensor module is given below:

  • Type: Analog
  • Module: Temperature Sensor
  • Operating Voltage: DC 5V
  • Temprature Measurement Range: -55°C to 125°C [-57°F to 257°F]
  • Measurement Accuracy Range: ±0.5C (between the range -10°C to 85°C)
  • Board Dimantions (L x W x H): 24.5mm x 16mm x 7mm
  • Weight: 1gm

KY-013 Module Pinout

The module has 3 male header pins those are -

  1. Pin (S): Analog Signal
  2. Pin (-): GND
  3. Pin (Middle): +5V

KY-013 Module Circuit Diagram

Schematic of the ky-013 temperature sensor module circuit is shown below.

Components are used in the circuit - S1: 10kΩ NTC, and R1: 10kΩ Resistor.

KY-013 Module Interfacing with Arduino

Connection diagram of the KY-013 temperature sensor module with an Arduino is shown below.

Connect the power pin (middle) and ground pin (-) of the ky-013 module to +5V and GND on the Arduino, respectively. The module signal pin (s) connect to pin A0 on the Arduino.

Arduino Source Code

The following example is an Arduino sketch that utilizes the Steinhart-Hart equation to calculate the temperature in Celsius from the resistance value of a thermistor (S1) connected to a KY-013 module. The code will return the temperature in Celsius.

const int thermistorPin = A0;  // Connect signal pin (S) of ky-013 module to Arduino analog pin A0

// Thermistor parameters for Steinhart-Hart equation
const float A = 0.001125308852122;     // Steinhart-Hart coefficient A
const float B = 0.000234711863267;     // Steinhart-Hart coefficient B
const float C = 0.000000085663516;     // Steinhart-Hart coefficient C

void setup() {
  Serial.begin(9600);  // Initialize serial communication

void loop() {
  int rawValue = analogRead(thermistorPin);  // Read the raw sensor value
  float voltage = rawValue * (5.0 / 1023.0);  // Convert sensor value to voltage (assuming 5V reference)
  float resistance = (5.0 - voltage) / voltage;  // Calculate resistance of thermistor
  float steinhart;  // Temperature variable

  // Apply Steinhart-Hart equation to calculate temperature
  steinhart = 1.0 / (A + (B * log(resistance)) + (C * pow(log(resistance), 3)));
  steinhart -= 273.15;  // Convert temperature to degrees Celsius

  Serial.print("Temperature: ");
  Serial.println(" °C");

  delay(500);  // Wait for a second before taking the next reading

No comments