To sense and determine the Ambient Temperature using Temperature Sensor and Arduino.
Analog Temperature Sensor module KY-013 for Arduino, measures ambient temperature based on resistance of the thermistor. The KY-013 Analog Temperature Sensor module consists 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.
Specifications
Circuit
Program:
int ThermistorPin = A0;
int Vo;
float R1 = 10000;
float logR2, R2, T;
float c1 = 0.001129148, c2 = 0.000234125, c3 = 0.0000000876741;
void setup(){
Serial.begin(9600);
}
void loop() {
Vo = analogRead(ThermistorPin);
R2 = R1 * (1023.0 / (float)Vo - 1.0);
logR2 = log(R2);
T = (1.0 / (c1 + c2*logR2 + c3*logR2*logR2*logR2)); // temperature in Kelvin
T = T - 273.15;
Serial.print("Temperature: ");
Serial.print(T);
Serial.println(" C");
delay(500);
}
Result:The ambient temperature is determined using the KY-013 temperature sensor and arduino.
Get all latest content delivered to your email a few times a month.