Archive | HD44780

Quick Project – Arduino Backlit LCD shield

In this tutorial learn how to make your own backlit-LCD Arduino shield.

Updated 18/03/2013

Let’s see how simple it is to make your own Arduino LCD shield. Sure – you can just buy one, but where’s the fun in that?

Getting Started

Our LCD is a two line, sixteen character backlit LCD. It has a typical HD44780-compatible interface, which makes it very easy to use with Arduino. The other parts required are laid out along with the LCD:3

partsss

We have the LCD, a Freetronics Protoshield Basic, a button, a 0.1 uF capacitor and some header pins. We also need some solid core, thin wire to make jumpers.

Next is the plan – our schematic. Even for the smaller projects, this is a wise step. You can iron out the bugs before soldering. From experience with these backlit LCDs, there are two ways to wire them up. Either with a trimpot so you can adjust the display contrast, or without. With my example screen, the display was only clear with the trimpot turned all the way to one side, however your screen may vary.

Please note that the voltage for LCD backlights can vary, some are 5V, some are 3.3V. Check your data sheet and plan accordingly!

Consider the following schematics:

schembss1

and

If you are making this circuit without the protoshield, the 0.1 uF capacitor is for decoupling, so place it between 5V and GND. It would be wise to test your LCD using the setup on pin 3 as shown in the second schematic. Then you will have a good idea about the display brightness and contrast. This was done with the usual breadboard setup, but not before soldering the pins into the LCD:

lcdpinsss

which allowed the LCD to slot into the breadboard nicely:

breadboardss

The brightness shown in the image above is satisfactory, so I measured the resistance between each of the outside pins of the trimpot and the centre. The resulting resistance between the centre and ground was around 15 ohms, so basically nothing. So for this LCD, there will not be any adjustments – and the full schematic above will be used (with LCD pin 3 going straight to GND).

The sketch to drive this LCD is quite simple, for example this will do:

For more information about using LCD modules with your Arduino, please refer to my series of Arduino tutorials.

The next step is to consider the plan for the shield. Thankfully this is a pretty simple operation, and minimal extra components to worry about. There is a catch with regards to the LCD module itself, it has six large metal tabs that need to be avoided if the LCD is to sit flush on the shield:

tabsss

Kudos to the engineers who had the pinouts printed on the back of the LCD. Thanks!

You can see that one of the tabs has been … removed. Just carefull use a pair of pliers and bend it slowly back and forth. Metal fatigue will take care of the rest. Anyhow, back to the shield. It is a simple task of soldering in some jumper wires to connect LCD pins 4, 6, 11~14 to the Arduino digital pins 4~9:

linksss

Also during this stage the reset button and the 0.1 uF capacitor were soldered in. When fitting the capacitor, leave around 5mm of length above the board, so you can push it over to one side, this is to give the LCD enough clearance. Furthermore, the lead from the 3.3V pad to LCD 15 is curved so as to avoid another metal tab on the rear of the LCD. The underside of the shield is quite simple:

linskrearss

To ensure a good solder joint when working with these shields – it is very important to heat the ring around the hole for two seconds if you need to create a solder bridge, or heat the wire for two seconds before attempting to solder it on. Otherwise you will either get a cold joint; or become frustrated and keep adding solder, at which point it leaks through to the other side and becomes a problem to remove.

Now to solder in the LCD. If you can, try and bend the LCD pins 1, 3, 5 and 16 towards the GND line, this will help when you need to connect them later. However, please be careful, if you position the LCD incorrectly you will have to basically start all over again with a new shield. When trimming the header pins, be sure to put a finger over the end to stop the cutting flying into your face:

lcdinss

Once you have the LCD module soldered in, and the ends trimmed – the final soldering task is to bridge the pins to the necessary points. This is relatively easy, just heat up one side of the junction and coax the solder across to the required spot. Sometimes the gap will be too large, so trim up the excess legs of the capacitor into small jumpers, say 3~4 mm long. You can then solder these in between the pads quite easily:

almostss

Now – the final soldering task. Snap off some header pins, two of six-pin, and two of eight-pin. Insert them into your Arduino or compatible board as such:

pinsinss

Then place your shield on top and solder the header pins to the shield. And we’re finished… well almost. Before you use the shield, use a multimeter or continuity tester to make sure none of the pins are shorted out, and generally double-check your soldering. You don’t want any mischievous short circuits ruining your new LCD or Arduino board.

Once you are satisfied, plug in your new shield and enjoy your success!

successss

So there you are, another useful Arduino shield ready for action. I hope you enjoyed reading about this project, and hopefully some of you have made one as well. High resolution images 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.

Posted in arduino, HD44780, LCD, microcontrollers, tutorial16 Comments

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.

Posted in arduino, HD44780, LCD, projects, tronixstuff, tutorial3 Comments

Let’s make an Arduino LCD shield

In this short tutorial we make an Arduino LCD shield.

Updated 18/03/2013

Today we are going to make an Arduino shield with an LCD module. More often than not I have needed to use an LCD shield in one of my projects, or with the Arduino tutorials. Naturally you can buy a pre-made one, however doing your own is always fun and nice way to pass an afternoon. Before we start, let me say this: “to fail to plan is to plan to fail”.  That saying is very appropriate when it comes to making your own shields.

The first step is to gather all of the parts you will need. In this case:

  • an LCD module (backlit if possible, but I’m being cheap and using a non-backlit module) that is HD44780-compatible
  • a 10k linear trimpot, used to adjust the LCD contrast
  • a blank protoshield that matches your Arduino board
  • various header pins required to solder into the shield (they should be included with your protoshield)
  • plenty of paper to draw on

For example:

p1070040small

Next, test your parts to ensure everything works. So, draw a schematic so you have something to follow:

lcdshieldschematic

And then build the circuit on a solderless breadboard, so you can iron out all the hardware bugs before permanently soldering into the shield. If you have a backlit LCD, pins 15 and 16 are also used, 15 for backlight supply voltage (check your data sheet!) and 16 for backlight ground:

p1070043small

Once connected, test the shield with a simple sketch – for example the “HelloWorld” example in the Arduino IDE. Make sure you have the library initialization line:

filled with the appropriate parameters. If you’re not sure about this, visit the LCD display tutorial in my Arduino tutorials.

Now to make the transition from temporary to permanent. Place your components onto the protoshield, and get a feel for how they can sit together. Whilst doing this, take into account that you will have to solder some jumper wires between the various pads and the digital pin contacts and the 5V strip at the top row, as well as the GND strip on the bottom row. You may find that you have to solder jumper wires on the bottom of the shield – that’s fine, but you need to ensure that they won’t interfere with the surface of your Arduino board as well.

Furthermore, some protoshields have extra functions already added to the board. For example, the shield I am using has two LEDs and a switch, so I will need to consider wiring them up as well – if something is there, you shouldn’t waste the opportunity to not use them. If your shield has a solder mask on the rear, a great way to plan your wiring is to just draw them out with a whiteboard marker:

p1070045small

 

Remember to solder these wires in *before* the LCD … otherwise you will be in a whole world of pain. The LCD should be soldered in second-last, as it is the most difficult thing to desolder if you have made any mistakes. The last items to solder will be the header pins. So let’s get soldering…

p1070046small

After every solder joint, I pushed in the LCD module – in order to check my placement. You can never check too many times, even doing so I made a small mistake. Having a magnifying glass handy is also a great idea:

p1070047small

Now just to soldier on, soldering one pad at a time, then checking the joint and its relationship with where it should be on the board. Be very careful when applying solder to the pads, they can act as a “drain” and let lots of solder flow into the other side. If this happens you will spend some time trying to remove that excess solder – a solder sucker and some solder wick is useful for this.

Finally all the wires and pads were connected, and I checked the map once more. Soldering in the LCD was  the easiest part – but it is always the most difficult to remove – so triple check your work before installing the display. Now it was time to sit in the header sockets, and test fit the shield into my arduino board. This is done to make sure there is sufficient space between the wires on the bottom of our shield and the top of the arduino:

p1070049small

Even though you wouldn’t normally put a shield on top of this shield, I used the header sockets to allow access to all of the arduino pins just in case. Soldering the sockets was easy, I used blu-tack to hold them into place. Crude but effective.

p1070053small

And we’re finished. Soldering is not the best of my skills, so I checked continuity between the pins on the LCD and where they were supposed to go, and also electrically checked for bridges between all the soldered pins to check for shorts. A multimeter with a continuity buzzer makes this easy. Naturally I had a short between LCD pin 14 and 13, but some solder wick helped me fix that. So electrically it was correct… time to see if it actually worked! At this point it is a good idea to clear up the workspace, switch off the soldering iron, put it somewhere safe to cool down, then wash your hands thoroughly. Here are some photos of the finished product on my arduino board:

p1070054small

 

p1070055small

As we’re using a Freetronics protoshield with onboard LEDs, the only thing to do was alter the demonstration sketch to take account for the pin placements, and insert some code to blink the LEDs.

I never need an excuse to make a video clip, so here is the result:

So there you have it. With a little planning and care, you too can make your own Arduino shield. An LCD shield would be useful for everyone, as they are great for displaying data and requesting input, yet quite fiddly to use with a solderless breadboard. High resolution photos are available on 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.

Posted in arduino, education, HD44780, LCD, projects, shield, tutorial0 Comments


Subscribe via email

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: