Connecting LCD display to Arduino

At first I thought that connecting and controlling a LCD display with Arduino is something complex and can be done only by people with good electronics background. I was wrong. It took me half an hour to figure out the steps to do to connect a newly bought LCD display. The only thing to note - the LCD display should be Hitachi HD44780 compatible. I bought my two LCD displays on eBay: LCD Display HD44780. Why did I buy two of them? Just because of the shipping costs and for some reserve for future projects.

Ok, let's get to basics of connection. You don't need any resistors, capacitors or anything, just plain wires. I used the prototyping jumper set that I bought at the local electronics store - something like this one: WJW70: Assorted Jumper Set. Had to bend some of the jumpers to connect the display with Arduino Diecimila. I did no soldering just because I wanted to test the connection and find out how it works before doing something wrong. To connect a LCD display to Arduino board you need 8 free arduino digital output pins. Which should all be connected to correct LCD display pins + you need 2 power and 2 ground connections for the LCD - as far as I understood - one of each for the backlight and one for the letters themselves. If you don't want to adjust LCD contrast, you can free one Arduino digital output pin by grounding the LCD contrast pin. That will set the LCD display to maximum contrast. Ok, enough talking, let's start connecting. Each display has an explanation about the pins. Mine had a small table on the eBay page:

LCD Pin Number Symbol Function
1 Vss Display power ground
2 Vdd Display power +5V
3 Vo Contrast Adjust. Altered by adjusting the voltage to this pin, grounding it sets it to maximum contrast.
4 RS Register select
5 R/W Data read/write selector. Its possible to read information from a display however there's no need for it here so grounding it sets it permanently write.
6 E Enable strobe
7 DB0 Data Bus 0
8 DB1 Data Bus 1
9 DB2 Data Bus 2
10 DB3 Data Bus 3
11 DB4 Data Bus 4
12 DB5 Data Bus 5
13 DB6 Data Bus 6
14 DB7 Data Bus 7
15 A

LED backlight power +5V
16 K LED backlight power ground

If we look at the Arduino LiquidCrystal library that you can use to interact with the LCD display, all we need from this table is:

LiquidCrystal(rs, rw, enable, d4, d5, d6, d7)

Which means that we need to connect the 4th, 5th, 6th, 11th, 12th, 13th and 14th LCD display pin to arduino digital output pins (be sure you are not using the 1 and 0 pins on Arduino, as these are reserved for serial communication and as far as I understood can't be used here. Besides connecting these LCD pins to Arduino, you also need to connect the +5V power and ground from Arduino board to respective pins on LCD display. And .. don't forget to ground the LCD contrast pin.

To be sure I connect everything correctly I put up a small table on a sheet of paper that held LCD and Arduino pin relations:

Arduino Pin LCD Pin LCD Pin Name
2 4 RS
3 5 RW
4 6 Enable
5 3 Contrast (could be simply grounded, but I chose to manually adjust contrast using the analogWrite function)
9 11 Data 4
10 12 Data 5
11 13 Data 6
12 14 Data 7

When you're done with this, just connect the Arduino board and upload a sketch from LiquidCrystal documentation page with the correct pin numbers:

#include <LiquidCrystal.h>
LiquidCrystal lcd(2, 3, 4, 9, 10, 11, 12);
void setup(){
  lcd.print("hello, world!");
}
void loop() {}

.. and the result is:


Cheap Xanax

Buy Valium

Cheap Phentermine

Xanax

Cheap Valium

Buy Xanax

Tramadol

Tramadol

Cheapest Cialis

Buy Tramadol

Buy Viagra

Cheap Phentermine

Cialis

Buy Viagra online

Buy Ambien

Xanax

Buy Valium

Viagra

Buy Valium

Buy Tramadol

Viagra

Buy Cialis

Cialis

MbdTBpQ

YvSSAzrV MbdTBpQ