Objective:
To measure the amount of temperature present in the atmosphere
Components Required
- Arduino Uno
- Temperature Sensor (LM35)
Connection Diagram
Program
int sensorPin = A0;
int sensorValue = 0;
void setup()
{
pinMode(sensorPin, INPUT);
Serial.begin(9600);
}
void loop()
{
sensorValue = analogRead(sensorPin);
float temperatureC=sensorPin/2.048;
float temperatureF= ((temperatureC ) * 9.0 / 5.0) + 32.0;
Serial.println(Temperature (F));
Serial.print(temperatureF);
Serial.println(Temperature(C));
Serial.print(temperatureC);
}
Working
The Temperature sensor is nothing but a thermistor whose resistance changes in accordance with the temperature. The change in resistance varies the amount of current flow through it and there by the voltage also.
Output
Room Temperature : 28 C