#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#define ADC_VREF_mV 5000.0 // in millivolt
#define ADC_RESOLUTION 1024.0
#define PIN_LM35 A0
LiquidCrystal_I2C lcd(0x27, 20, 4);
void setup() {
Serial.begin(9600);
lcd.init();
lcd.backlight();
}
void loop() {
// get the ADC value from the temperature sensor
int adcVal = analogRead(PIN_LM35);
// convert the ADC value to voltage in millivolt
float milliVolt = adcVal * (ADC_VREF_mV / ADC_RESOLUTION);
// convert the voltage to the temperature in Celsius
float tempC = milliVolt / 10;
// print the temperature in the Serial Monitor:
Serial.print("Temperature: ");
Serial.print(tempC);
Serial.println("°C");
// print the temperature on the LCD:
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Temperature:");
lcd.setCursor(0,1);
lcd.print(tempC);
lcd.print(" C");
lcd.setCursor(0,3);
lcd.println( "project by arvind");
//lcd.print(" C");
delay(1000);
}