#define lm35_data_pin A0 /* LM35 O/P pin */
void setup() {
Serial.begin(9600);
}
void loop() {
int temp_adc_value;
float temp_value;
temp_adc_value = analogRead(lm35_data_pin); /* Read Temperature */
temp_value = (temp_adc_value * 4.88); /* Convert adc value to equivalent voltage */
temp_value = (temp_value/10); /* LM35 gives output of 10mv/°C */
Serial.print("Temperature = ");
Serial.print(temp_value);
Serial.println(" Degree Celsius");
delay(1000);
}