LCD Interface Shield

From My WIki
Jump to: navigation, search


LCD Interface Shield Product Description

I designed this shield for anybody who wants to work with a classic Character LCD with parallel interface. You can fit a variety of sizes of LCDs on the shield, just in case the one that comes with is not good enough for you. To make this process even easier I designed the PCB with the demonstration code for "Hello World" silk screened on the back of it. Flip the PCB over type the code into your Arduino compiler and you should be up and running as soon as the firmware is loaded into the chip.

However typically once you get your LCD up and running shortly after you get it to say "Hello World". you will probably want to to do something slightly more challenge like create a user interface with some menus.

I personally really like Rotary encoders. I could not resist adding a Rotary encoder to the shield. As you can see a picture I have some very classic clunky retro knobs available to properly pimp out this masterpiece. Once you put your hands on this knob and feel the ku-chunk ku-chunk of the spring detents in this Rotary encoder you will then realize how essential it is to have a large clunky retro knob to properly reminisce of yesteryear when electronics were a little more repairable and a little less disposable.

For the younger gamer generation I put a footprint for a joystick navigation button. These buttons have five directions, up, down, right, left, and a standard pushbutton all built in. These joystick buttons are a little pricey, so for those on a budget I also included footprints in the printed circuit board for standard inexpensive pushbuttons in a navigation configuration.

To round out this user interface experience I also included a beeper. this way you have most of the senses covered, LCD gives you sites, the tactile buttons or not give you touch, the the beeper gives you sound, and whenever there is soldering involved sooner or later there are some smells.

I confess there is not quite enough IO pins on the Arduino to run the Rotary encoder and all the push buttons, so you may need to decide which interface you want to use. I added many solder tabs to make reconfiguring this board as easy as possible.


Potentiometer For Contrast Adjustment

Navigation Push-buttons

4 kHz Beeper

Rotary Encoder With Push-button


Where Can I Get It?

Assembly Instructions

First make sure you have everything

Put It Together

Programming Instructions

Example Code

LCD Hello World

LCD Back Light Fading

 This example shows how to fade an LED using the analogWrite() function.
 The circuit:
 * LED attached from digital pin 9 to ground.
 Created 1 Nov 2008
 By David A. Mellis
 Modified 17 June 2009
 By Tom Igoe
 This example code is in the public domain.
int ledPin = 9;    // LED connected to digital pin 9
void setup()  { 
  // nothing happens in setup 
void loop()  { 
  // fade in from min to max in increments of 5 points:
  for(int fadeValue = 0 ; fadeValue <= 255; fadeValue +=5) { 
    // sets the value (range from 0 to 255):
    analogWrite(ledPin, fadeValue);         
    // wait for 30 milliseconds to see the dimming effect    
  // fade out from max to min in increments of 5 points:
  for(int fadeValue = 255 ; fadeValue >= 0; fadeValue -=5) { 
    // sets the value (range from 0 to 255):
    analogWrite(ledPin, fadeValue);         
    // wait for 30 milliseconds to see the dimming effect    

LCD Back Light Control

/* Spin8 - manually spin running lights in a sideways figure eight
Requires the Bounce, Turn, Trixel and LiquidCrystal libraries,
a phase quadrature encoded control knob
and a 10x2 or better LCD display
with 5 or more characters of font RAM.
#include <Turn.h>
#include <Bounce.h>
#include <LiquidCrystal.h>
/* initialize LiquidCrystal library with the interface pin numbers
Arduino <===> MotherboardShield <===> Mama's LCD Card
Arduino <===> USB Serial <===> Programmer
Arduino	Hard-	Silk-	Sketch
pin	ware	screen	symbol
----	------	------	------
D0	Serial	RX
D1	Serial	TX
D2	Knob	EA
D3	Knob	EB
D10     NavB    Center
D12	LCD	Enable
D13     NavB    Down
A0      NavB    Right
A1      NavB    Up
A2      BUZZER
A3      NavB    Left
Serial uses pins 0, 1
Knob uses pins 2*, 3**, 8
LCD uses pins 4, 5, 6, 7, 11, 12
* Arduino pin D2 triggers interrupt 0
** Arduino pin D3 triggers interrupt 1
//                RS  Enable D4 D5 D6 D7
LiquidCrystal lcd(12,     11, 5, 4, 6, 7);
//        interrupt EA interrupt EB EA EB
Turn knob(           0,           1, 2, 3);
const int KNOB_PRESS = 8;
//                       5ms debounce time
Bounce press(KNOB_PRESS, 5);
int LCD_LED = 9; // Back light for LCD display. you must cut the solder jumper from 5V to use this
void setup()
  pinMode(KNOB_PRESS, INPUT);   	// knob click input
  digitalWrite(KNOB_PRESS, HIGH);	// ... with pullup
  pinMode(LCD_LED, OUTPUT);
  digitalWrite(LCD_LED, HIGH);
  lcd.begin(16, 2);		// first LCD size in columns and rows
  knob.count();			// seems to quell some bug
  knob.sleep();			// ... until user turns knob
  //lcd.clear();			// mimic the Arduino[tm] logo
  Serial.begin (9600);
  Serial.println("start");                // a personal quirk
int old_count = 0;
void loop ()
  int count = knob.count() / 4;	// four phases per click of this particular knob
  int delta = count - old_count;
  old_count = count;
int positiveLimit = 30 + 1;//this is an optional limit in the positive direction
int negativeLimit = 30 + 1;//this is an optional limit in the negative direction
    if ( count >= positiveLimit ) { //this is an optional limit in the positive direction
      knob.reset(positiveLimit - 1);
      count = positiveLimit - 1;
    if ( count <= -negativeLimit ) { //this is an optional limit in the negative direction
      knob.reset(-negativeLimit + 1);
      count = -positiveLimit + 1;
    int fadeValue = map( count, 0, 30, 0, 255);
    analogWrite(LCD_LED, fadeValue);
    lcd.setCursor(0, 0);

Navigation Buttons

Rotary Encoder



Hardware Source Files and Revision History

The latest revision is 0.1v

Known Issues

Personal tools