Learn Interfacing Analog Temperature Sensor Module KY-013 in Arduino. Analog Temperature module measures ambient temperature based on the resistance of the thermistor. Analog Temperature module consists of an NTC thermistor and a 10 kΩ resistor. The resistance of the thermistor varies with the surrounding temperature, we’ll use the Steinhart–Hart equation to derive the precise temperature of the thermistor. So, let’s start learning to interface Analog Temperature Sensor KY-013 in Arduino
Step 1: Required Components
Step 2: Circuit Time
Firstly, connect analog pin (the s pin) of the module to analog pin A0 of Arduino. Then, connect the VCC pin and GND pin of the Temperature sensor to the +5v and GND pin of Arduino.
Step 3: Code Time
The main part of the code is the implementation of the Steinhart-Hart equation. This equation is implemented in the ‘Steinhart’ function. The setup function will start the serial monitor as usual. Loop will be used to send analog values from the module to Steinhart function and appropriate temperature value will be calculated.
Step 4: Upload the code to Arduino
Set components as per the Circuit Diagram and upload the code to the Arduino UNO Board. As outside temperature changes, resistance will change and provide an analog output, which is the temperature.
Learn about uploading code to Arduino Board.