In this illustration we will going to wire the analog base temperature sensor module, this module is based on thermistor, a NTC Thermistor with a Multi-point temperature measurement to -55 Degree Celsius up to +125 Degree Celsius and has accuracy of +/-0.5 Degree Celsius. When resistance increase with ambient the temperature will change, a sense of a real time and to know the temperature of the surrounding environment change, this module works on Arduino Analog INPUT / OUTPUT, as we code the sketch we able to convert the sensor output data to Celsius temperature and display to our Serial monitor, this module also works on ESP8266, Raspberry, AVR and PIC and it is easy to used. It effectively and widely used in Home Automation, Gardening, Home Alarm System and other projects.
When the power connected to board it will send HIGH signal output going the end of the line, because the module output is an analog signal, when the signal output terminal connected to the Arduino analog IO it will turn HIGH the sampling, in that case we can read the temperature value on the environment.
Required Components
- Arduino Board
- Thermistor Analog Temperature Sensor
- Jumper Wire / DuPont Wire
- Solder Less Bread Board
Wiring Diagram
Arduino Sketch
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
#include <math.h> //Include Math Library int mySensor = A1; // A1 Analog where the temperature sensor will used double Thermistor(int RawADC) { double TEMP; TEMP = log(10000.0*((1024.0/RawADC-1))); TEMP = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 * TEMP * TEMP ))* TEMP ); TEMP = TEMP - 273.15; // To Convert Kelvin to Celcius //TEMP = (TEMP * 9.0)/ 5.0 + 32.0; // To Convert Celcius to Fahrenheit return TEMP; } void setup() { Serial.begin(9600); } void loop() { int readVal=analogRead(mySensor); double Temp = Thermistor(readVal); Serial.println(Temp); // Display the temperature //Serial.println(readVal); // Display the temperature delay(500); } |