Arduino – Getting my LCD Screen to work.

I’ve gotten hold of what I assumed was a compatible 16×2 LCD screen with my Arduino board – it’s a Powertip PC1602F and uses a compatible display driver for the...

I’ve gotten hold of what I assumed was a compatible 16×2 LCD screen with my Arduino board – it’s a Powertip PC1602F and uses a compatible display driver for the Hitachi HD44780 display chip. This is essentially what the Arduino LCD libraries are built around, so when I failed to get a display this is the first thing that I checked out. I also downloaded and installed Arduino 0017 which has a better and more up to date library for LCD stuff but you can update version 0015 with this library I think.

Unfortunately this LCD screen also cost me my first Arduino board, not sure if it was coindence or not, but the USB chip burnt out when I was connecting the LCD screen via various guides and the manufacturers pin layouts. Also turns out that you don’t actually need to use all the pins – for a start my screen isn’t back lit and you only need 4 out of the 8 jumpers.

Anyway, one new Arduino board later and I wire in my display and all I would get is a line of solid block characters, so it was working and I had tried various code snippets and Arduino versions but no luck in getting any text on the screen. Occaisonally I would also get a faint cursor or no display at all – which freaked me out slightly considering i had already potentially lost an Arduino board to this LCD screen and it was beginning to frustrate me.

So now I went for broke – I soldered some jumper wires on to the LCD board pins and hey presto when any program is run text is now displayed, although at first my connections weren’t great so makesure you solder the pins really well with no bridges! Turns out that whilst the wire ends fit snug in the LCD pin holes they still don’t form a decent connection and this was causing it to have random results. For whatever reason, I decided to leave the rubber ends on the jumper wires, but this seems to have turned out fine.

Now I just have to figure out what to do with the LCD screen! Below is the sketch that I used along with a picture of the wiring – I would recommend that you use as many different colour wires as possible for this as you could have up to 16 wires running from this board so you want save on any confusion as much as possible.

Arduino LCD Display Circuit

I didn’t bother using a potentiometer to control the contrast on the screen as recommended, so I stuck that pin to GND which seemed to work fine for the display. Other than that this is the standard circuit from the tutorials here

Arduino LCD Wiring:

arduino-lcd-screen-layout-key

Arduino LCD Display Sketch

/*
  LiquidCrystal Library - Hello World

 Demonstrates the use a 16x2 LCD display.  The LiquidCrystal
 library works with all LCD displays that are compatible with the
 Hitachi HD44780 driver. There are many of them out there, and you
 can usually tell them by the 16-pin interface.

 This sketch prints "Hello World!" to the LCD
 and shows the time.

  The circuit:
 * LCD RS pin to digital pin 12
 * LCD Enable pin to digital pin 11
 * LCD D4 pin to digital pin 5
 * LCD D5 pin to digital pin 4
 * LCD D6 pin to digital pin 3
 * LCD D7 pin to digital pin 2
 * 10K resistor:
 * ends to +5V and ground
 * wiper to LCD VO pin (pin 3)

 Library originally added 18 Apr 2008
 by David A. Mellis
 library modified 5 Jul 2009
 by Limor Fried (http://www.ladyada.net)
 example added 9 Jul 2009
 by Tom Igoe
 modified 25 July 2009
 by David A. Mellis

http://www.arduino.cc/en/Tutorial/LiquidCrystal

 */

// include the library code:
#include

// 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 rows and columns:
  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);
}

This content is published under the Attribution-Noncommercial-Share Alike 3.0 Unported license.

Technorati Tags: , , , , , , ,

  1. Controlling a Servo with Arduino
  2. Arduino: Controlling the Robot Arm
  3. Arduino + Processing – 3D Sensor Data Visualisation
  4. Arduino + Processing – Make a Radar Screen – Part 3: Visualising the Data from Sharp Infrared Range Finder
  5. Arduino – Using a Sharp IR Sensor for Distance Calculation
  6. Arduino – A Basic Theremin
  7. Obstacle avoidance Arduino robot – build your own larryBot
  8. Arduino – IR remote/ intervalometer for Nikon D80 DSLR (that means timelapse photography yarrr!)
  9. Control a DC motor with Arduino and L293D chip
  10. Arduino – Redefining the TV Remote