Posts Tagged ‘ help

Arduino LCD HD44780 + LM335 Temperature Sensor

This was the next logical step in my home monitoring project.  I’ve simply added an LM335A temperature sensor to the breadboard and have the output being posted to the LCD every second.

 

First the drawing:

The next step was to write the code that reads the temperature on Analog Pin 0, then writes it the LCD.  This could not have been easier.

 

Code:

#include <LM335A.h>
#include <LiquidCrystal.h>
float raw;
 
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
 
LM335A InsideTemp(0); //pass the analog input pin number
void setup() {
  lcd.begin(16, 2);
}
 
void loop() {
  lcd.clear();
  //user must call ReadTemp before any valid temp data is available
  raw = analogRead(0);
  InsideTemp.ReadTemp();
  lcd.print(InsideTemp.Fahrenheit());
  lcd.print((char)223);
  lcd.print("F");
  lcd.setCursor(0, 1); // bottom left
  delay(1000);
}

Working project:

 

 

Things are coming along on the home monitor.  I’ll soon be using some multiplexers and 8bit shift registers to help reduce the number of pins used on the arduino.  Keep checking back for more updates!

Arduino LCD HD44780 Simple Tutorial

Connecting any LCD using the HD44780 standard to an arduino is extremely simple.  I’ve created a quick schematic showing how to connect the 16×2  HD44780 to an arduino.  I’ll be using this setup in my future projects, so this is simply for future reference.

 

Unfortunately you don't have Adobe Flash-Player.... Klicken Sie hier fü kostenlosen Adobe Flash-Player.