In this instructible we will learn how we can hook up an LCD based on the HD44780 chipset to the SPI bus and drive it with only 3 wires for less than $1. Although I will focus on the HD44780 alphanumeric display in this tutorial, the same principle will work pretty much the same for any other LCD which uses an 8 bit parallel data bus, and it can be very easily adapted to suit displays with 16 bit data buses.
The HD44780 (and compatible) based alphanumeric displays are usually available in 16x2 (2 lines consisting of 16 characters) and 20x4 configurations, but can be found in many more forms. The most 'complicated' display would be a 40x4 display, this sort of display is special as it has 2 HD44780 controllers, one for the upper two row and one for the bottom two rows. Some graphic LCDs have two controllers as well.

The HD44780 LCDs are great, they are very cheap, readable and quite easy to work with. But they also have some drawbacks, these displays take up a lot of I/O pins when connected to the Arduino. In simple projects this is not a concern, but when projects get big, with a lot of IO, or where certain pins are needed for things such as an Analog read or PWM, the fact these LCDs require a minimum of 6 pins can become a problem.

But we can solve this problem in a cheap and interesting way.

Step 1: Getting the Components

I used TaydaElectronics for most of the components I used in this project. You can get these parts on ebay as well, but for ease of use, I'll link you to Tayda.

Shopping List
2 - 74HC595 package DIP16
1 - Generic male header - 2 pins. This is not required, I used this as a way to permanently disable backlight.
3 - Ceramic Capacitor - capacitance 0.1µF; voltage 50V
1 - Electrolytic Capacitor - capacitance 10µF; voltage 35V
1 - Ceramic Capacitor - capacitance 220pF; voltage 50V
1 - NPN-Transistor - part # PN2222A*
1 - 1k Ω Resistor
1 - Trimmer Potentiometer - maximum resistance 5kΩ
1 - 470 Ω Resistor
* With an NPN transistor the backlight will stay off until it is turned on by software. If you want to have the backlight on by default, use a PNP type transistor. Changes in the code of the library provided will have to be made, though.

Sub total for this list is $0.744. The pin header is also not required, so you can save 15cents right there and the subtotal will be $0.6.
<p>Although I personally don't think this is the most effective method, I do applaud you for the amount of work that has gone into the PCB's, They look Amazing. Good job.</p>
Thanks. I've since figured out that doing this with a single 595 would be pretty much just as fast and the hardware would be much simpler.
I do like the addition of GPIO pins on the SMD version of the PCB
<p>one shift register has few free pins, can these be used for button inputs or maybe even temperature sensors?</p>
<p>The 595 is a serial in -&gt; parallel out device, it can't read in data.</p><p>You can use the remaining free pins to turn on LEDs, or for some other purposes, but as digital output only.</p>
<p>this might be a stupid question but what do you do with the &quot;keywords.txt&quot;, &quot;liquidcrystal_spi.cpp&quot;, and &quot;liquidcrystal_spi.h&quot; files?</p>
<p>I wrote an Arduino library to use with this backpack. You put the files in your Arduino libraries folder.</p>
Even though I have an entry in this contest, I think this is useful and helpful enough to warrant a &quot;hostile&quot; thumbs up, and a vote!
I have voted for both contests you are entered in. <br>I think I may even use this to add an LCD readout to the LED cube as a diagnostic readout, and information screen (what pattern is running on the cube, or in diag mode, the value os variables being used, etc).
Thanks a lot, I really appreciate it :) <br> <br>I've updated the article, check out the italic bold text on the last page :)
I've recently bought a similar LCD and found it an I/O hog for my project. This is definitely the solution I was looking for. Keep sharing such great stuff!

About This Instructable




More by ArthurTC:3-Wire HD47780 LCD for less than 1 dollar 
Add instructable to: