Arduino LM35 temperature sensor with LCD Display

Sunday, December 11th, 2011

I added my LM35 Temperature Sensor to my Arduino again and added a display to show how hot it is… ;)

I have used the LM35 already some month ago; It is a very easy to setup device.

Here is my Code:

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

float temp;
int tempPin = 0;

void setup() {
  lcd.begin(16, 2);
  lcd.print("Temperature:");
}

void loop() {
  temp = analogRead(tempPin);
  temp = temp * 0.48828125;
  lcd.setCursor(0, 1);
  lcd.print(temp);
  delay(1000);
}

Some other sources:

Have fun with it… ;)

Tags: , , , , , , , , , ,

Posted in: DIY

Comments

$Date: 2011-12-11 16:42:45 +0100 (Sun, 11 Dec 2011) $