const int lm35_pin = 34; /* LM35 O/P pin */
void setup() {
Serial.begin(115200);
delay(1000);
pinMode(lm35_pin, INPUT);
}
void loop() {
int temp_adc_val= 0;
float temp_val;
float temp_val2;
temp_adc_val = analogRead(lm35_pin); /* Read Temperature */
temp_val = (temp_adc_val/4095*3300); /* Convert adc value to equivalent voltage */
temp_val2 = (temp_val/10); /* LM35 gives output of 10mv/°C */
Serial.print("Temperature = ");
Serial.print(temp_val2);
Serial.print(" Degree Celsius\n");
delay(1000);
}