2011

LCD breakout user manual

Author: Manoj.j Reviewer: Ram Revision: 1.3 Tenet Technetronics 1/8/2011

Contents
Introduction
Introduction to LCD breakout

Hardware Overview
LCD breakout features Components overview Schematic

Software Overview
Flow Chart Pseudo code Code

Demo Application References and further reading

i

Introduction
This breakout board is designed to simplify the physical connection in interfacing an LCD with an Arduino. The breakout board is compatible for both 16x2 character LCD and graphical LCD. All power and control pins necessary to connect it to the Arduino/Comet board are broken out using long wire-wrap headers which extend through the shield. The breakout can be reset through reset button on top of the breakout. Separate variable potentiometer is provided for both 16x2 character LCD and graphical LCD to control the backlight contrast.

Hardware Overview

Figure1: The LCD breakout

2

LCD breakout features
   The breakout supports both Graphical LCD and 16x2 Text LCD. The LCD breakout shield can be mounted on Arduino/Comet board. The backlight contrast can be adjusted through potentiometer.

Components overview

Components

Brief specificatio n Resistance: 10 kilo ohm

Product link

References

Potentiometer

http://tenettech.com/ product.php?id_pro duct=1498

http://en.wikipedia.org/wiki/Potentiometer

Reset button

Normal push http://tenettech.com/ button product.php?id_pro duct=1499 http://tenettech.com/ product.php?id_pro duct=517

http://en.wikipedia.org/wiki/Push-button

Extended LCD 16x2 LCD berg connectors

http://en.wikipedia.org/wiki/Liquid_crystal_dis play

Graphical LCD 128x64 LCD http://www.tenettec http://www.dfrobot.com/wiki/index.php?title= h.com/product.php?i 128x64_Graphic_LCD_%28SKU:FIT0021%29 d_product=1523

Table1: components overview

3

Schematic

Figure 2: 16x2 text LCD and graphical LCD breakout schematic

4

Software overview
Flowchart 16x2LCD Graphical LCD

Start

Start

Initialization of LCD functional pins

Initialization of LCD functional pins

Set the (cursor, clear screen) status

Initialization of bitmap position/system font

Print statements to display

Add shapes to images
Start

End

Print
Initialization of LCD functional pins

End
Set the (cursor, clear screen) status

Print statements to display End

5

Pseudo code 16x2LCD
   Include header files for LCD Global declaration: LCD pins initialization. Function name : Setup Return type : Void Description : Initialization Body : Print statement that is to be displayed on LCD. Function name : Loop Return type : Void Description : Infinite Body : Set the cursor and rate at which it is to be displayed.

Graphical LCD
  Include header files for LCD Function name : Setup Return type : Void Description : Initialization Body : LCD pins initialization. Set up the Bitmap position Set the system font Function name : Loop Return type : Void Description : Infinite Body : Include the shapes which you need to add to images Include number of iterations in one second.

6

code
(i) 16x2 LCD // include the library code: #include <LiquidCrystal.h> // initialize the library with the numbers of the interface pins LiquidCrystal lcd(12, 11, 5, 4, 3, 2); void setup() { // set up the LCD's number of columns and rows: lcd.begin(16, 2); // Print a message to the LCD. lcd.print("hello, world!"); } void loop() { // set the cursor to column 0, line 1 // (note: line 1 is the second row, since counting begins with 0): lcd.setCursor(0, 1); // print the number of seconds since reset: lcd.print(millis()/1000); }

(ii) Graphical LCD #include <ks0108.h> // library header #include <Arial14.h> // font definition for 14 point Arial font. #include "SystemFont5x7.h" // system font #include "ArduinoIcon.h" // bitmap unsigned long startMillis; unsigned int iter = 0;

7

void setup() { GLCD.Init(NON_INVERTED); // initialise the library GLCD.ClearScreen(); GLCD.DrawBitmap(ArduinoIcon, 32,0, BLACK); //draw the bitmap at the given x,y position delay(3000); GLCD.ClearScreen(); GLCD.SelectFont(System5x7); // select fixed width system font } void loop() { // run over and over again startMillis = millis(); while( millis() - startMillis < 1000) { // loop for one second GLCD.DrawRect(0, 0, 64, 61, BLACK); // rectangle in left side of screen GLCD.DrawRoundRect(68, 0, 58, 61, 5, BLACK); // rounded rectangle around text area for(int i=0; i < 62; i += 4) GLCD.DrawLine(1,1,63,i, BLACK); // draw lines from upper left down right side of rectangle GLCD.DrawCircle(32,31,30,BLACK); // draw circle centered in the left side of screen GLCD.FillRect(92,40,16,16, WHITE); // clear previous spinner position GLCD.CursorTo(5,5); // locate curser for printing text GLCD.PrintNumber(++iter); // print current iteration at the current cursor position } // display number of iterations in one second GLCD.ClearScreen(); // clear the screen GLCD.CursorTo(13,2); // positon cursor GLCD.Puts("FPS= "); // print a text string GLCD.PrintNumber(iter); // print a number }

8

Demo Application
LCD breakout shield

Figure3: The breakout

LCD shield is mounted on Comet through extended headers from the breakout

Figure4: The breakout with Comet

16x2 text LCD is connected to breakout

Figure5: The breakout with LCD
9

The result image shows characters are printed on LCD

Figure6: character displayed on LCD

Graphical LCD is interfaced to Comet using the breakout shield

Figure7: The breakout with graphical LCD

The result showing coded images in graphical LCD

Figure8: images displayed on graphical LCD

10

References and Further Reading
    www.arduino.cc www.tenettech.com/comet http://www.youtube.com/user/tenetworld?blend=2&ob=5#p/u/3/NJHPJblpkRU http://tenettech.com/category.php?id_category=283

11

Sign up to vote on this title
UsefulNot useful