This wiki has been archived and made read-only.
For up-to-date information about TkkrLab and it's projects please visit our main website at tkkrlab.nl.

Arduino LM35

From

Jump to: navigation, search

LM35 is a tempature sensor common TO-92 temperature sensor.

See also : instructables

Specifications


Schematic

  • Arduino Analoog 0 -->
  • Arduino GND -->
  • Arduino +5V -->

Example code

//Example code for LM35
//Done by TkkrLab
 
// named constant for the pin the sensor is connected to
const int sensorPin = A0;
float tempC;
int reading;
 
void setup(){
  // open a serial connection to display values
  Serial.begin(9600);
  //Setup LM35
  analogReference(INTERNAL);
}
 
void loop() {
  reading = analogRead(sensorPin);
  tempC = reading / 9.31;
  // send the sensor value out the serial port
  Serial.print("sensor Temp: ");
  Serial.println(tempC);
 
  delay(100);
}