Let’s make another Arduino LCD shield

In this tutorial we make an LCD shield for using 20 character by four row LCD modules with Arduino Uno.

Updated 18/03/2013

In this article you can follow the process of making another LCD shield for the Arduino Uno or compatible boards. In the past (which explains the word another in this title) I made a 16 x 2 character LCD shield, however it was not backlit, nor large enough. Recently I acquired a 20 x 4 character backlit LCD for use in my Arduino tutorials, therein making this project necessary. To refresh your memories, here is the original shield:

p1070054small

However this time, I cannot mount the display on the shield, it is just too large. Furthermore, it is preferable to be able to stack other shields on top of the new LCD shield. Therefore the display will be external and connected with lengths of wire. So time to get cracking. The first step was to assemble all the parts together. The new LCD has a standard 16-pin  HD44780 interface, and is very easy to connect:

partssm

What we have: one 20×4 character backlit LCD, a Freetronics basic protoshield, some stacking pin headers, a button, 10k ohm trimpot for contrast adjustment, and some spacers and matching screws to give the LCD some legs. Afterwards I got some 0.1uF ceramic capacitors as well, to smooth supply current on the 5V rail of the shield. Here is the data sheet for the LCD: 2004 LCD.pdf.

As usual the first thing to do was to make a plan. The LCD interface is easy enough, but I still like to have something on paper to refer to:

schematic12

The next step is to breadboard it – to make sure it works. However I did solder in the wires to the LCD at this stage:

lcdwiressmall

And after assembling the circuit, a brief test:

testingsm

Success. The demonstration sketch is the example provided with the Arduino IDE, modified for a 20×04 LCD. During the test above, I used an external 5 V power supply for the breadboard. Remember to connect the ground line from the Arduino to the ground line of your breadboard, otherwise it will not work. At this point I was wondering how much current the LCD used by itself. The data sheet claimed it was five milliamps… I think not. Mr Multimeter had a different opinion:

ammetersm

Now it was time to finish the soldering work. Instead of trying to jam all the wires together along the digital pins, I used some wire jumpers to spread out the landing points for the wires from the LCD:

solder1s1

Furthermore, I decided to install a power LED and 560 ohm resistor – you can never have too many LEDs. :) The rear of the protoshield was also quite neat, dollops of solder easily bridged pads when required. Then after a visual inspection it was time to solder in the header pins. The easiest way to do this is to use an existing shield:

solder2s

After soldering in the pins, the first attempt of using the display was unsuccessful. I had confused a couple of wires, but some reprogramming of the sketch fixed that. (It was Saturday night and my eyes were tired). But once the error had been fixed – success!

worldclocksm

If this shield/display needed a name, I would call it the Dog’s breakfast. Now, hardware is only half of the solution – there are one or two things to take into account when writing your sketch. Also, when using .setCursor(x,y); to position the cursor, the top left position on the LCD is 0,0; and the bottom right is 19,3. For example, the image below was created by:

abcdsm

Now to make something slightly more useful to take advantage of the screen area – another clock (I like clocks) using my DS1307 real time clock shield. Here is the sketch, (doesn’t allow for DST):

… and an action shot:

worldclocksm

So there you have it. Another way to use an LCD with an Arduino, and show how you can do things yourself. High resolution photos are available from flickr.

In the meanwhile have fun and keep checking into tronixstuff.com. Why not follow things on twitterGoogle+, subscribe  for email updates or RSS using the links on the right-hand column? And join our friendly Google Group – dedicated to the projects and related items on this website. Sign up – it’s free, helpful to each other –  and we can all learn something.

The following two tabs change content below.

John Boxall

Founder, owner and managing editor of tronixstuff.com.

3 Responses to “Let’s make another Arduino LCD shield”

  1. David says:

    I have been reading through a few tutorials and like the way you have been explaining things.
    One area i do have trouble is writing sketches. For instance i purchased an arduino and the Anderson serial lcd interface& 20×4 LCD. My soldering is good the demo sketches work and the self test works . My problem is getting past compiling errors in my programming. Do you have an archive of your complete sketches so that I can compare to see where I am going wrong?
    Is there a tutorial on sketch writing so I can stop blundering along and write my own with confidence and get my own projects up and running?

Trackbacks/Pingbacks

  1. [...] This post was mentioned on Twitter by tronixstuff. tronixstuff said: New post: Let's make another Arduino LCD shield: http://wp.me/pQmjR-CD [...]


Leave a Reply

Receive notifications of new posts by email.

The Arduino Book

Arduino Workshop

Für unsere deutschen Freunde

Dla naszych polskich przyjaciół ...

Australian Electronics!

Buy and support Silicon Chip - Australia's only Electronics Magazine.

Use of our content…

%d bloggers like this: