3 Pin HD44780 LCD for Arduino - Works of Rowan Simms

2
Search Login Welcome to Works of Rowan Simms Wednesday, September 04 2013 @ 07:10 PM EST 3 Pin HD44780 LCD for Arduino Monday, April 09 2012 @ 02:15 AM EST Contributed by: Rowan Adding an LCD display to Arduino projects can add real value but the cost of doing so can be significant. Not a financial cost - you can pick up 16 (characters) x 2 (rows) LCD for as little as £3.50. The cost is the pin count it can take to drive them. Using the built-in LiquidCrystal Display library it can take as many as 6 pins! That does not leave much for your sensors, motors and other components. There are many projects that discuss using alternatives - such as a much more expensive Serial LCD (£10 up). Other projects discuss using two-wire interfaces, increasing the complexity of your code. The simplest way to drive the HD44780 style LCDs, in my opinion, is to use a 74HC595 shift register, taking the pin count down to 3. Stephen Hobley has adjusted the LiquidCrystal Library so it works brilliantly with the 595 Shift Register. I have further extended this library, made it compatible with Arduino 1.x and re-assigned some of the shift register pinouts to make it easier to prototype. This is now a Google hosted code project to allow for great collaboration. You can download the latest code from LiquidCrystal595 Arduino Library. It is feature complete and should be a drop-in replacement for any project you already have. Alternatively you can download directly from the Google Project here. The components needed are commonly available from all electronics stores and should cost no more than £1 if bought individually - you can get this down to half that if you buy in bulk. Component List 1 x 74HC595 Shift Register 1 x BC547 NPN (or MOFSET or similar NPN) 1 x 10k Trimmer Potentiometer Hookup wire Breadboard to Shield I recommend connecting all this up on a breadboard to have a play around with this approach. Once you are satisfied you can create your own easy prototyping shield to make future prototyping super easy - connect power, three wires from the Arduino and you are done. Details on shield creation are in this article: Hookup a 16-pin HD44780 LCD to an Arduino in 6 seconds Connecting the 16 pins of the LCD display to the shift register does take quite a bit of cabling because we use nearly every pin, plus allowing the the contrast to be set on the display and enable the Arduino to control the on/off of the backlight. The LCD has 16 pins - we use 12 of them. 1. GND Ground 9. D2 no connection 2. Vcc 5v 10. D3 no connection 3. Vo Contrast (via Pot) 11. D4 ShiftReg pin 4 4. RS ShiftReg pin 7 12. D5 ShiftReg pin 3 5. R/W Ground 13. D6 ShiftReg pin 2] 6. E ShiftReg pin 15 14. D7 ShiftReg pin 1] 7. D0 no connection 15. LED+ 5v 8. D1 no connection 16. LED- ShiftReg pin 5 via NPN Now that everything is connected up, using Stephen's library is very easy, here is the "hello world" style beginners sketch: /* * 3-pin Arduino interface for HD44780 LCDs via 74HC595 Shift Register * by Rowan Simms [email protected] * License: Creative Commons - Attribution. * Full Documentation and Description: http://rowansimms.com/article.php/lcd-hookup-in-seconds * * This sketch allows Arduinos to use a shift register to control an LCD, allowing * a reduction in pins it requires from 6 to 3 while still retaining full control * including backlight on/off. NAVIGATION SUBSCRIBE New Articles New Comments New Forum Posts New Downloads POPULAR TAGS api arduino authentication branding code editor glfusion itunesu lcd metadata podcast quicklinks reporting rss shield syntax taxonomy textstar training tutorial QUICKLINKS Open in new window. TextStar LCD PHP Manual (Au Mirror) Download QuickLinks... TextStar LCD Datash... glFusion Plugin Dev... Arduino Syntax High... MooTools Docs glFusion TextMate Yahoo Page: 1 2 3 Home Arduino glFusion Solutions iTunes U Training Downloads Home Downloads Topics 3 Pin HD44780 LCD for Arduino - Works of Rowan Simms http://rowansimms.com/article.php/lcd-hookup-in-seconds 1 of 2 9/4/2013 5:11 PM

description

3 Pin HD44780 LCD for Arduino - Works of Rowan Simms

Transcript of 3 Pin HD44780 LCD for Arduino - Works of Rowan Simms

Page 1: 3 Pin HD44780 LCD for Arduino - Works of Rowan Simms

Search

LoginWelcome to Works of Rowan Simms

Wednesday, September 04 2013 @ 07:10 PM EST

3 Pin HD44780 LCD for ArduinoMonday, April 09 2012 @ 02:15 AM EST

Contributed by: Rowan

Adding an LCD display to Arduino projects can add real value but the

cost of doing so can be significant. Not a financial cost - you can pick

up 16 (characters) x 2 (rows) LCD for as little as £3.50. The cost is the

pin count it can take to drive them. Using the built-in LiquidCrystal

Display library it can take as many as 6 pins! That does not leave

much for your sensors, motors and other components.

There are many projects that discuss using alternatives - such as a

much more expensive Serial LCD (£10 up). Other projects discuss using two-wire interfaces, increasing the

complexity of your code. The simplest way to drive the HD44780 style LCDs, in my opinion, is to use a 74HC595 shift register, taking the pin

count down to 3.

Stephen Hobley has adjusted the LiquidCrystal Library so it works

brilliantly with the 595 Shift Register. I have further extended this library,

made it compatible with Arduino 1.x and re-assigned some of the shift

register pinouts to make it easier to prototype. This is now a Google

hosted code project to allow for great collaboration.

You can download the latest code from LiquidCrystal595

Arduino Library. It is feature complete and should be a

drop-in replacement for any project you already have.

Alternatively you can download directly from the Google Project

here.

The components needed are commonly available from all electronics

stores and should cost no more than £1 if bought individually - you can get

this down to half that if you buy in bulk.

Component List

1 x 74HC595 Shift

Register

1 x BC547

NPN (or MOFSET

or similar NPN)

1 x 10k Trimmer

Potentiometer

Hookup wire

Breadboard to Shield

I recommend connecting all this up on a breadboard to have a play around with this approach. Once you are satisfied you can

create your own easy prototyping shield to make future prototyping super easy - connect power, three wires from the Arduino and

you are done. Details on shield creation are in this article: Hookup a 16-pin HD44780 LCD to an Arduino in 6 seconds

Connecting the

16 pins of the

LCD display to

the shift register

does take quite a

bit of cabling

because we use

nearly every pin,

plus allowing the

the contrast to be

set on the display

and enable the

Arduino to control

the on/off of the backlight.

The LCD has 16 pins - we use 12 of them.

1. GND Ground 9. D2 no connection 2. Vcc 5v 10. D3 no connection

3. Vo Contrast (via Pot) 11. D4 ShiftReg pin 4

4. RS ShiftReg pin 7 12. D5 ShiftReg pin 3

5. R/W Ground 13. D6 ShiftReg pin 2]

6. E ShiftReg pin 15 14. D7 ShiftReg pin 1]

7. D0 no connection 15. LED+ 5v

8. D1 no connection 16. LED- ShiftReg pin 5 via

NPN

Now that everything is connected up, using Stephen's library is very easy, here is the "hello world" style beginners sketch:

/*

* 3-pin Arduino interface for HD44780 LCDs via 74HC595 Shift Register

* by Rowan Simms [email protected]

* License: Creative Commons - Attribution.

* Full Documentation and Description: http://rowansimms.com/article.php/lcd-hookup-in-seconds

*

* This sketch allows Arduinos to use a shift register to control an LCD, allowing

* a reduction in pins it requires from 6 to 3 while still retaining full control

* including backlight on/off.

NAVIGATION

SUBSCRIBE

New Articles

New Comments

New Forum Posts

New Downloads

POPULAR TAGS

api arduino

authentication branding

code editor glfusion

itunesu lcd metadata

podcast quicklinks

reporting rss shield syntax

taxonomy textstar

training tutorial

QUICKLINKS

Open in new window.

TextStar LCD

PHP Manual (Au Mirror)

Download QuickLinks...

TextStar LCD Datash...

glFusion Plugin Dev...

Arduino Syntax High...

MooTools Docs

glFusion

TextMate

Yahoo

Page: 1 2 3

Home

Arduino

glFusion Solutions

iTunes U Training

Downloads

Home Downloads Topics

3 Pin HD44780 LCD for Arduino - Works of Rowan Simms http://rowansimms.com/article.php/lcd-hookup-in-seconds

1 of 2 9/4/2013 5:11 PM

Page 2: 3 Pin HD44780 LCD for Arduino - Works of Rowan Simms

WHAT'S RELATED

http://www.instructable...

here

More by Rowan

More from Arduino

* This requires the use of the LiquidCrystal595 library

* available at: http://code.google.com/p/arduino-lcd-3pin/

*/

#include <LiquidCrystal595.h> // include the library

LiquidCrystal595 lcd(7,8,9); // datapin, latchpin, clockpin

void setup() {

lcd.begin(16,2); // 16 characters, 2 rows

lcd.clear();

lcd.setCursor(0,0);

lcd.print("Wow. 3 pins!");

lcd.setCursor(0,1);

lcd.print("Fabulous");

}

void loop() {

// not used.

}

You should now be basking in the glorious glow of your LCD.

If you are going to use LCDs on a regular basis, I suggest you save yourself the hassle of wiring this up each and every time. I created a

great little board, some would say a shield, that saves all this hookup work - simply connect power and the three Arduino pins to the board

and you are set. To create your own, have a look at Hookup a 16-pin HD44780 LCD to an Arduino in 6 seconds.

Big thanks go to Stephen Hobley for his great work on the original library, to the Arduino team for such a great product and Fritzing Project

for making designing and sharing electrical circuits just so easy.

Tag: arduino tutorial shield code

Trackback

Trackback URL for this entry: http://rowansimms.com/trackback.php/lcd-hookup-in-seconds

Here's what others have to say about '3 Pin HD44780 LCD for Arduino ':

Hookup an LCD to an Arduino in 6 seconds with 3, not 6 pins - Arduino for ProjectsArduino for Projects

[...] without any soldering. That layout, more code and wiring explanations are available from http://rowansimms.com/article.php/lcd-hookup-

in-secondsThat’s it. Enjoy your sub-6-second hookups! Major Components in Project 1 x 74HC595 Shift [...] [read more]

Tracked on Saturday, April 20 2013 @ 03:15 PM EST

0 comments

Home Search Contact Us Top

© 2013 Works of Rowan Simms • Terms of Use • Privacy Policy • RSS • Page created in 0.47 seconds by glFusion

3 Pin HD44780 LCD for Arduino - Works of Rowan Simms http://rowansimms.com/article.php/lcd-hookup-in-seconds

2 of 2 9/4/2013 5:11 PM