HOME > > SENSING AND CONTROL MAIN PAGE > > ACTUATORS > > ALPHANUMERIC DISPLAYS

Assembling the LCD controller from ModernDevice.com- Specs and Assembly

Specs

The controller is a felicitous combination of the pre-programmed PIC created (and still available from) Peter Anderson, a well made PCB (ModernDevice's contribution), and a full kit of the "bits and pieces" needed to assemble it... not a difficult job. Note that in addition to the kit, you will need an LCD panel. This is to accomodate people who already have one. The controller can control a wide variety of LCD panels.

You just hook the controller to whatever you want to drive it (which I will call the "host" from now on) via a single input to the controller. (You need to power it, too, of course: 5v. To quote from Peter Anderson's site: "a minimum current of 10 mA is required for this design. This excludes any backlight current. If the interfacing LCD's LED backlight feature is used, the backlight current must be limited to less than 250 mA.")

Both the BasicStamp and the Arduino can put "Hello world" on the LCD with no additional electronics. With the Arduino, it is really simple: just two lines of code... one in the program init setting the baud rate of the built- into- the- host's- native-language serial capabilities, and, in the main body of the host's program....

Serial.print("Hello world")

With the BasicStamp things are almost as easy. See Peter Anderson's examples.

If you use the host's built in serial routines, I do think that ties you to sending the data via the host's TX pin. I'm betting that with just a little digging around the "already invented wheels" on the internet you could find ways to send your data to your LCD controller via a less "valuable" output of the host.

But! Not only can you put text on the LCD panel, but you can send a large number of commands via ASCII strings. For example, "?f" will clear the LCD and leave cursor at home position. (Commands are distinguished from test- to- display by a preceeding "?". As usual, if you want to display a "?", you just send "??". (A list of the commands is available at http://www.moderndevice.com/Docs/LCD117CommandSummary.doc), and you can get a guide at Peter Anderson's page about the chip at the heart of the ModernDevice kit.

Which FINALLY brings me to the little thing I wanted to mention! The following is an edited version of some material on Peter Anderson's page....

The LCD #117 provides general purpose TTL outputs. Any of these outputs may be brought high or low using the 'H' and 'L' commands.

On power up, all outputs are at a high impedance (configured as inputs). As each output is addressed, it is taken out of the high impedance state. The initial high impedance state permits the user to use either pull up or pull down resistors to avoid "bounce" when the processor is powered.

The current (source or sink) by any output should be limited to 15 mA.

(End of quoted material)

I wanted THAT information to see if it was safe to attach a little piezo buzzer unit I have. Give it 5v and it will draw 1.3mA... so safe for the controller's outputs. I can connect it to one of the pad- provided- for- outputs (4-6). If I connect to 4, the Arduino code to beep it is:

Serial.print("?H4"); //start beeping
delay(500);  //beep for 1/2 second)
Serial.print("?L4"); //go quiet again.

Even better... if you don't mind "messing up" your controller a little, if you make a connection to pin 6 of the controller IC (as distinct from output 6 which is on pin12 of the IC), then if you send the controller command "?g" you get about half a second of a 500hz square wave. That was enough for my piezo- with- oscillator unit. With a suitable driving transistor, it would even be enough for a simpler piezo sounder.

So! For most of us, simply putting text on the LCD screen will be quite enough. But the controller can do a lot more, if you dig into its capabilities you may find things you want to use. Because of the limitations of the link to the host... limitations which minimized the overheads imposed on the host... the controller is strictly and output device.

So! On to what this page was originally all about: Assembling your kit.


Assembling the board...

...not Rocket Science.

This guide is presented not because the assembly/ initial testing is difficult but rather to save you having to do almost any thinking. With this guide, you can just zip through the not complex task without having to worry about what order would be best, what choices you need to make and when.

This guide does NOT come from ModernDevice.com... just a satisfied customer. I didn't even get an evaluation unit by way of persuasion! (Although toys to try are always welcome... but anything I review gets reviewed because I liked it, not by way of payment to the producer.)

I should also add: Anything YOU do (or don't do) is YOUR responsibility. While I've tried to make this as helpful as possible, I accept no responsibility for anything in your life, including consequences of doing or not doing anything based on this document or on anything else! Making the wrong connections, for whatever reason, can damage things. There. Now can we get back to something worthwhile?

Almost all components go on the side of the board with the writing on it. Only the connector for attaching the board to the LCD panel goes on the other side.

For what follows, "up" is with that side of the board facing you, and all of the text EXCEPT the "PHANDERSON.COM" the right way up. In other words, with the double row of 7 holes at the right hand side. I don't know what they are for, by the way, but strongly suspect that they are for an alternate line of LCD panels, or an alternate way of connection to to them.

This page is a "work in progress". While, as far as I know, there's nothing WRONG here, there are scraps of notes to myself, unfinished paragraphs, etc. Just skim over things that make no sense. It's still worth at least what you've paid me for providing it to you.

Examine the board....

Ohm meter across 5v and 0v wherever you see it. Check as best you can that the through plating has been successful. The board I received was one of the best I've seen as a hobbyist... but check each one. There is not better time in the assembly process. Take 5 minutes now and save an hour later.

Clean.

You will have a strip of inter-pcb connecting pins in your parts kit, and a stip of "socktets", which the pins could go into. You have both so that whether your LCD panel has pins or sockets on it, you can still connect your PCB to the panel... and if your panel doesn't have pins or sockets, you can give it (The panel) them. I'd suggest putting the pins on the LCD panel, the sockets on your PCB. If, like mine was, your strip of pins is more than 14 pins long, cut it down. You can cut between the pins. If your strip of sockets is more than 14 sockets long, you will cut that down to, but it is pointless to try to avoid sacrificing a socket in the process.... you WILL lose one. Cut in the middle of the hole, and get a good result.

Resistors have colored bands on them to tell you their resistivity. If in doubt, you can always test your guess with an ohm meter... before the resistors are soldered in place is by far the best. Read them from the end where they come closest to the end. The end AWAY from the gold or silver band, if one happens to be present. I like to put my resistors in the board so that the bands read from left to right, but that isn't essential. If you put one in "backwards", don't go back to reverse it.

Start your assembly with the resistors. The separation of the holes is adequate if you bend the leads carefully.... but do. In each case, the resistor you have will probably have a fourth band, of gold. Insert (by which I mean to imply solder, as well, here and hereafter. It is not, by the way, necessary to apply heat or solder to both sides of the board.)

(Put all three into the board; solder after all are in place... that way if you put one in the wrong place, and can't find it to put it in the right place, you'll have less trouble moving it!)

In the position marked "10k": The brown-black-orange resistor In "RG": orange-orange-brown (330 ohm) In RBL: The slightly larger yellow-purple-gold resistor (4.6 ohm)

(The 4.6 ohm reisitor will be right if you are going to use 5v to power the backlight, and want a nominal 200mA current through the backlight. Even if you are not using an LCD panel with backlight, ther's no harm in installing the resistor.)

My kit came with an extra (I hope!) resistor: orange-black-black, (30 ohm). I believe this is for limiting the current to the LCD's backlight (RBL) for alternative circumstances- different panel, or different VBL. (My kit also had an extra (I hope) diode.)

Next insert the diode in the spot marked "D" at the left end of the board. This has to be the "right way up. There's a band on the diode, It should go "up", i.e. away from the IRL530's position. This is indicated by the markings on the board, too.

Insert the socket for the PIC. Note that it will have some marking to indicate the "pin 1" end. Insert the socket so that this end is at the right, to coincide with the coresponding small half circle in the end of the socket's outline on the board. While soldering the socket, do the odd numbered pins first, then the even numbered pins. This helps reduce over-heating. Be sure the socket is tight against the PCB. (You may have to push the 10k resistor down (i.e. sideways, away from the socket) slightly to achieve this. (Do opposite corners, carefully, first.) Do not insert the IC into the socket until you are told to, later.

Insert the capacitor. (This, like everything unless I say otherwise, can go either way "up".) It goes in the two holes just to the right of "104" in the middle of the PCB's bottom edge.

Insert the three legged square "thing" (potentiometer) in the position labelled "Contrast". The "odd" pin (one on it's own on one side) goes at "3 o'clock".

Insert the two four legged square things. (Either can go in either position.) They go in the positions marked "reset" and "op".

It would be difficult, but not impossible, to insert them wrongly. Be careful that you have not rotated them 90 degrees from how they ought to be. The "feet, or "claws" should be "gripping" inward left and right, not up and down. The devices (switches) are actually not quite square, and you will be okay, unless you force the "square" peg into the rectangular hole rotated 90 degrees from where it ought to be. As with the IC socket, take care that the switches are flush to the PCB.

The big transistor (three legged thing with metal tab) goes on the board with the metal tab down, against the PCB. Bend the legs carefully to get the left/right position right; solder in place.

Solder the 4 pin right angle connector into it's position on the left of the board.

This would be the time to clean the underside of the board, to remove the "gunk" from your soldering. IMS (alcohol) does not harm the white solder mask. Look for shorts... especially between the connections joining the capacitor to the board.

Depending on whether your LCD panel has pins or sockets, solder sockets or pins into the row of 14 holes across the top right edge of the PCB. THIS GOES ON THE BOTTOM OF THE PCB... the only thing not on the top. Take care... check after the first and second holes are done... to install it at right angles to the PCB.

Carefully inspect the board for bad solder joints, shorts caused by "whiskers" of solder, etc. Don't install IC yet. Put an ohm meter across the 5v and G pins of the 4 pin connector. I got 4.2k, regardless of the setting of the "contrast" potentiometer. You will probably get something slightly different, but investigate if you see less than 3k or more than 5k. Put the potentiometer about half way between full on and full off.

Don't worry about backlight or "messages to the LCD panel" issues yet.

Read all of this paragraph before starting to do what it says. Bring 5v and ground to the board via the 4 pin connector on the left hand edge. (That's 5v IN, not out!) . As quickly as you can, check that you are GETTING 5v on the board. If not, unplug the power again quickly and look for a short. If you're getting 5v okay, then leave it connected for a bit, and check that nothing is getting hot.

Disconnect the power. Insert the IC, being careful to put pin 1 (the end with a little notch, or flatened corner, or little dimple.... but be sure not to confuse the latter with the circular marks often present at BOTH ends of a chip.

Inserting the chip is something of an art. You have to be quite firm... but still careful! Be sure that all the pins are correctly started into a hole before pressing down on the chip. It may help to lay the chip on its side on a hard surface, and very carefully bend the pins in a bit. When you press down, it is important that the plane of the chip stay parallel to the plane of the PCB during the whole of the insertion process. You want to avoid the equivalent of a drawer sliding into a dresser crookedly, and thus jamming.

Cross fingers and reconnect the power. Recheck that 5v is maintained and that nothing, including the newly inserted IC, is getting hot.

Disconnect power. Add LCD panel to the circuit. The board from Badger has "pin 1" marked (near corner of PCB), and with luck, your panel's "pin 1" will also be marked.

Cross fingers and toes and re-power the completed project.

Don't be alarmed if at first the panel remains blank, or if it goes black. Try adjusting the contrast potentiometer. If all is well, even before you connect anything to the RX or VBL pins, you should, once the contrast setting is right, see a winking cursor in the upper left of the LCD panel.

I had exactly that experience the first time I tried (and the second... of two attempts to date). I don't say that to blow my own trumpet, but to reassure you that the board seems to be well made, and assembly easy.

If the winking cursor doesn't appear, even after you adjust the contrast, then head over to phanderson.com/lcd106/lcd107.html. About 60% of the way down that there are troubleshooting instructions under a heading saying "Troubleshooting the LCD circuitry". Peter Anderson is the source of the pre-programmed PIC which is at the heart of the neat little board ModernDevice is selling.

If you press the reset button, you should briefly see the unit's power-on self test... a bit of text. You may have seen that the first time you switched the unit on, if you weren't looking at other things, and if the contrast setting was close enough to right. You should see it every time the unit is powered up.

The web page I cited a moment ago is a place you should visit in any case. Lots of information about how your unit works, "from the horse's mouth". There are also programs for running the LCD panel with a BAsicStamp. Note: To use those programs you only need connect the panel to a ground point (0v) shared with the BasicStamp, supply 5v, and connect the RX pin of the 4 pin connector of the LCD panel to the P0 pin of the BasicStamp.

The following program will put Hello World on the panel from an Arduino. Note that the LCD panel is capable of much, much more... I'm 99% sure... although I haven't tested this... that it is even able to give you at least 3 digital outputs for controlling things. (That, I think, is the point of the so-far "mysterious" holes marked "4", "5" and "6" on the ModernDevice PCB. See the section "General Purpose Outputs" on the Peter Anderson page already mentioned. (I'm not sure ehat happened to output 7, also mentioned there.)

Peter Anderson's page will also tell you about the commands that the LCD panel will accept. Here, I'll give you just enough to get you started using an Arduino. Peter already has an Arduino example on his site.. it was his mention of the device that got me started with it! (What follows was adapted from his example.)

For the following example, connect your LCD panel to a ground point (0v) shared with the Arduino, supply 5v, and connect the RX pin of the 4 pin connector of the LCD panel to the TDX/ PD1 pin of the Arduino.

Put the following program into the Arduino.

Note: that I have transcribed this from another computer, and have not run EXACTLY the following. There may be a typo or two in it. Please email me if you have successfully run this via copy/ paste to the Arduino development environment, so that I can take out this caveat?

Note: The Arduino programming language is case sensitive. "serial.begin" will not do. It must be "Serial.begin" (Capital "S")

Note: No #include is needed... the following is ALL that you need, although any sensible programmer includes comments, not least a brief note about the hardware needs of the program.

Note for ModernDevice/LCD.shtml: program should also have Serial.begin(9600) in setup to

//==== Arduino code:
void setup()
{
  Serial.begin(9600);
}

void loop()
{
  Serial.print("Hello World ");
}
//====

That's it! Put a space after World for the nicest result.

That should give you a working LCD panel driven by the Arduino. The nest steps are beyond the scope of this essay, but resources exist out there. Go play!!

===== ===== BL link....

What you see in photo on badgerboards page.

Accetpable voltages? Pins 4,5,6? Access to programming info. Arduino, BAsicStamp interfacing?


Ad from page's editor: Yes.. I do enjoy compiling these things for you... hope they are helpful. However.. this doesn't pay my bills!!! If you find this stuff useful, (and you run an MS-DOS or Windows PC) please visit my freeware and shareware page, download something, and circulate it for me? At least (please) send an 'I liked the parallel port use page, and I'm from (country/ state)' email? (No... I don't do spam) Links on your page to this page would also be appreciated!
Click here to visit editor's freeware, shareware page.

Other projects

This is just one of the guides I have published on the net. Please visit any of the following that relate to interests you have....

Delphi Tutorials
Pascal programming tutorials
Electronics for hobbyists and schools
Main Home Page

Here is how you can contact this page's author, Tom Boyd.

Index of sensing and control pages (From there you can also go to other help from the editor of this page.)


Valid HTML 4.01 Transitional Page tested for compliance with INDUSTRY (not MS-only) standards, using the free, publicly accessible validator at validator.w3.org



-- Page ends --