LCD Keypad Shield for Arduino Uno

I received my LCD Keypad Shield last week from Dealextreme. This post briefly summarises some useful information regarding the tweaks required to the standard Arduino library for controlling LCD panels.

I’ve previously described my new Arduino Uno, and running the Arduino IDE under WindowsXP/Virtualbox/FreeBSD.

Specs

The LCD Keypad module contains a 16×2 (characters x rows)  LCD display and assorted pushbuttons on a PCB designed to plug on to an Arduino Uno (and similar Arduino variants). With suitable external wiring, the module can also be driven by an Arduino Nano.

Dealextreme’s website says it has a “blue backlight with white words”. It does. However, the LCD panel’s contrast control (a multi-turn trim pot) needs to be twisted many turns before you can properly see the text if you’re running the underlying Arduino from a USB port (i.e. 5V supply).

PCB pinout & existing LCD library

The Arduino IDE 1.0.1 comes with a suitable LiquidCrystal library for driving LCD shields. However, the example sketches (such as Examples->LiquidCrystal->AutoScroll) assume different Arduino pins are being used to drive the LCD shield.

To drive this particular LCD Keypad Shield when plugged directly into your Uno, adjust the following configuration line in the example sketches:

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

to

LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

With this change made, the Examples->LiquidCrystal->HelloWorld and Examples->LiquidCrystal->AutoScroll sketches compiled and ran just fine.

The backlight brightness is tied to Arduino’s pin 10 (a PWM output), and can be adjusted with

analogWrite (10, fadeValue);

where 0 <= fadeValue <= 255.

Analog input A0 sees a voltage proportional to the button being pressed (use button = analogRead(0)). This is somewhat simplistic — each button puts a different analog voltage on A0, but it appears there’s no way to detect multiple concurrent button presses.

More information

The Dealextreme unit seems earily similar to this design from DFRobot, both in terms of PCB layout and which Arduino pins are mapped to what functions on the LCD panel itself.

See http://www.ladyada.net/learn/lcd/charlcd.html and http://www.freetronics.com/pages/16×2-lcd-shield-quickstart-guide for additional details about Arduino control of similar LCD panels.

Advertisements

11 comments

  1. Owen Vinall · ·

    Hi,

    Thanks for the info re the different pins that are used.
    I also had to cut one of the very fine tracks as there is an Interrupt conflict between my Ardunio Droid (UNO) board and the Lcd screen. They both use the same interrupt.
    Until I made both changes I could see the display blinking but no text.
    Now its fine.
    Thanks again.

  2. Glad you found the info helpful! 🙂

  3. Thanks, I was fighting with it off the specs from DX for a bit before I came across this.

  4. Thanks !!!

  5. Juan Pablo Muñoz · ·

    Thanks! i need this information for my shield from dx!

  6. Martin Maliska · ·

    I have strange problem, when I connect the power, after few seconds (10 – 15) right half of the LCD display loses the text ( I see only “Hello w”). It happens when I use USB only but also when I connect external power source (12V).

  7. Owen Vinall · ·

    HI Martin, Did you get any replies to your post ? Can you confirm if you use Usb power you loose the right half text BUT if you use external power (12V) its ok ?

  8. Martin Maliska · ·

    Hi Owen, I did not get any reply yet. I have the same problem with external power.

  9. Hi Martin, Owen, Just catching up on posts. Unfortunately I don’t really have any answer for the problem of the LCD loosing text 😦

  10. As you mention backlight control through analog write, please note that there are several versions of the shield which have a hardware wiring issue that can be dangerous to shield and arduino. Quoting from a very informative discussion thread on this matter:
    >> Yes the backlight is on and it “appears” to be working but it is massively overloading the Arduino pin which may eventually cause problems and perhaps even burn out the pin. <<

    Comprehensive information can be found in this thread:
    http://forum.arduino.cc/index.php?PHPSESSID=1960l9n1ba8spr78is3grtm870&topic=96747.0

  11. I’m using the keypad shield, but I also need my interrupt 0 pin on digital pin2, which is also being used by the shield. How can I go around this?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: