Electronic – arduino – Hooking up an LCD to Arduino Diagram

-setuparduinodiagramlcd

Has anyone got a really clear diagram of the way to link up a 16×2 LCD screen to an Arduino?

Basically I have an LCD for which the back light is coming on, but I am not getting any words appearing on the screen.

Which Pins should I be focusing on to test this?

This is the screen i'm using

http://www.littlebirdelectronics.com/products/basic-16×2-character-lcd-yellow-on-blue-5v

Best Answer

Check this link out - very good tutorial exactly what you want from LadyAda. Her LCD has a block of pins at the end, most LCDs have 16 pins along the top with pin 1 at the top left (looking from the front). Note LadyAda pins are reversed from normal but if you have the back light sorted then the code below will help a lot.

Also another tutorial but no wiring diagram

From here I copied this -

// my pinout from L (LCD pin) to A (Arduino pin):
// LCD pin 1: Vss --> to Arduino GND
// LCD pin 2: Vdd --> to Arduino +5V
// LCD pin 3: V0 (contrast) --> to GND (I chose the PWM pin 10, see below)
// LCD pin 4: RS (register select) --> to Arduino pin 11
// LCD pin 5: R/W- (read/write) --> to Arduino pin 2
// LCD pin 6: E (H/L enable) --> to Arduino pin 3
// LCD pin 7: DB0 (data bit 0) --> to Arduino PIN 4
// LCD pin 8: DB1 (data bit 1) --> to Arduino PIN 5
// LCD pin 9: DB2 --> to Arduino PIN 6
// LCD pin 10: DB3 --> to Arduino PIN 7
// LCD pin 11: DB4 --> to Arduino PIN 14
// LCD pin 12: DB5 --> to Arduino PIN 15
// LCD pin 13: DB6 --> to Arduino PIN 16
// LCD pin 14: DB7 --> to Arduino PIN 17
// LCD pin 15: A/Vee (backlight+) --> to a 4.2Vcc source (see documentation)
// LCD pin 16: K (backlight-) --> to Arduino GND

note you can ignore the R/W line (connect it to ground) and use 4 bit mode (with the LCD 4bit library) by disconnecting LCD pin 7, 8, 9 & 10. The pin assignments for the 4-bit library are mentioned in the library code. The mistake I made initially here was to wire up the lower nibble (DB0 to DB3) instead of the high nibble (DB4 to DB7).

// --------- PINS -------------------------------------
//is the RW pin of the LCD under our control?  If we're only ever going to write to the LCD, we can use one less microcontroller pin, and just tie the LCD pin to the necessary signal, high or low.
//this stops us sending signals to the RW pin if it isn't being used.
int USING_RW = false;

//RS, RW and Enable can be set to whatever you like
int RS = 4;
int RW = 11;
int Enable = 5;
//DB should be an unseparated group of pins  - because of lazy coding in pushNibble()
int DB[] = {6, 7, 8, 9};  //wire these to DB4~7 on LCD.