LM35D Temperature Sensor
This lesson will introduce you to the LM35D sensor
Last updated
int potPin = A0; //Pin A0
void setup()
{
Serial.begin(9600);//Set baud rate
}
void loop()
{
int val;//
int dat;//
val = analogRead(0);
// Read the analog value of the sensor and assign a value to Val
dat = (125 * val) >> 8; //Temperature calculation formula
Serial.print("Tep:");//The as-is output shows the Tep string for temperature
Serial.print(dat);//The output shows the value of the DAT
Serial.println("C");//The output displays the C string
delay(500);//delay 500ms
}