Thermometers are useful apparatus being used since long time for temperature measurement. In this project, we have made and arduino based digital thermometer to display current ambient temperature and temperature changes on a LCD unit in real time.It can be deployed in houses, offices etc. to measure the temperature. This project is based on arduino which communicates here with LM35 temperature sensor and 16*2 LCD display unit we can divide this arduino into three sections -the first senses the temperature by using temperature sensor LM35, the second section converts the temperature value into suitable numbers in celcius scale which is done by using arduino, and the last part of the system display temperature on LCD.
code
#include<LiquidCrystal.h>
LiquidCrystal lcd(7,6,5,4,3,2);
const int sensor=A1; // Assigning analog pin A1 to variable 'sensor'
float tempc; //variable to store temperature in degree Celsius
float tempf; //variable to store temperature in Fahreinheit
float vout; //temporary variable to hold sensor reading
int sensor_input;
void setup()
{
pinMode(sensor,INPUT); // Configuring pin A1 as input
Serial.begin(9600);
lcd.begin(16,2);
delay(500);
}
void loop()
{
sensor_input=analogRead(sensor);
vout=(sensor_input*5.0)/1023.00;
tempc=vout*100; // Storing value in Degree Celsius
tempf=(tempc*1.8)+32; // Converting to Fahrenheit
lcd.setCursor(0,0);
lcd.print("DegreeC= ");
lcd.print(tempc);
lcd.setCursor(0,1);
lcd.print("Fahrenheit=");
lcd.print(tempf);
delay(1000); //Delay of 1 second for ease of viewing in serial monitor
}