Please, carry out the following steps:
1. Be sure that the LM35 is wired as per following diagram:
2. Note down that the following is the response equation for LM35 Sensor with Reference Voltage set at 1.1V INTERNAL:
T0C = 100*(1.10/1024.00)*analogRead(A0); //LM35 has only gain and no offset
3. Upload the following program and check that the Serial Monitor shows approx. correct temperature at 2-sec interval.
void setup()
{
Serial.begin(9600);
analogReference(INTERNAL);
}
void loop()
{
float temp = 100*(1.10/1024)*analogRead(A0); //temp is directly calibrated in deg celsius
Serial.print(temp, 2); //two digit after decimal point
Serial.println(" *C");
delay(2000);
}