Measure the Temperature and Show It on a LCD Display

12,419

27

6

I made a little arduino sketch, that displays the temperature on a LCD display measured by a LM35. I used a 16X1 LCD Display. The Code is quite easy and can send the value via serial connection, too.

What you need:

Arduino Board
LCD Display
LM35 temperature sensor
resistor (for backlight)

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1:

Here’s my source coude (based on the example LCD code on arduino.cc):



#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
#define LCD_CLEAR 0b00000001 // 0×01
float temp;
int tempPin = 0;

void setup() {
Serial.begin(9600);
lcd.begin(16, 2);
//lcd.print(“”);
}

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

Serial.println(temp);

}

Share

Recommendations

  • Indoor Lighting Contest

    Indoor Lighting Contest
  • Make It Fly Challenge

    Make It Fly Challenge
  • Growing Beyond Earth Maker Contest

    Growing Beyond Earth Maker Contest

6 Discussions

0
None
jani.kljun

4 years ago on Introduction

why give me these errors :

This report would have more information with

"Show verbose output during compilation"

enabled in File > Preferences.

Arduino: 1.0.6 (Windows 7), Board: "Arduino Uno"

sketch_jan20a:21: error: stray '\' in program

sketch_jan20a:21: error: stray '\' in program

sketch_jan20a.ino: In function 'void loop()':

sketch_jan20a:21: error: 'u201dC' was not declared in this scope

0
None
EET1982

6 years ago on Introduction

Hi. Very cool project. I will be making this soon. May I ask why the 5v is pulled to the outer rail if nothing connects to the rail?

0
None
knuppelamandaghassaei

Reply 6 years ago on Introduction

i did something like this: http://www.opensketches.org/temperatur-messen-mit-einem-lm35-und-anzeige-auf-einem-lcd-display-processing-anzeige-mysql/

0
None
knuppelamandaghassaei

Reply 6 years ago on Introduction

In used it to display the temperature on the computer (via processing) and then, when the computer is online it sends the temperature to a webserver,and the temperature can be seen in the internet.