Plug it and Arduino senses temperature !
Based on thermistor, this Temperature Sensor Module measures the environment temperature and input data to Arduino through the analog IO port of Sensor Shield. Great tool for gardening projects, home alert system etc.
Building interactive work is as easy as piling bricks, just plug it to our Arduino Sensor Shield with a buckled cable, and make it looks professional and neat.
A simple program below converts data from Temperature Sensor Module to Fahrenheit and displays it in Serial Monitor. This function utilizes the Steinhart-Hart Thermistor Equation to convert “Thermistor Resistance” to “Temperature in Degrees Kelvin.” For details, please read here.
#include
double Thermister(int RawADC) {
double Temp;
Temp = log(((10240000/RawADC) - 10000));
Temp = 1 / (0.001129148 + (0.000234125 * Temp) + (0.0000000876741 * Temp * Temp * Temp));
Temp = Temp - 273.15; // Convert Kelvin to Celcius
return Temp;
}
void setup() {
Serial.begin(115200);
}
void loop() {
Serial.println(int(Thermister(analogRead(0)))); // display Fahrenheit
delay(100);
}
Recent Comments