Moving LED Sign

I've been working on this one for some time now and have been wanting to make one for many years. Only now, with my introduction to the microcontroller, do I have the tools and understanding to make one of these happen.

It all really started with something I ready about at Walt Disney World in Florida. A vertical column of LEDs had been set up in a room with almost no light. The lights appeared to be mostly on (dim). However, when you looked away from the vertical column, pictures would form. What was happening was they had drawn pictures and then would have the LEDs show vertical slices (sections) of that picture very quickly, scanning the picture from left to right. The human brain is slow enough to put all these vertical slices together into a picture.

About one year ago I decided to search the internet to see if there was a device like this. What I came up with was a new device nicknamed "propeller clock." Mr. Blick's site had quite a bit of information on it, including one or two he had made along with pictures of others people had sent to him. See this and other electronics projects of his by clicking on the following: Bob Blick's electronic projects. It was from his site I learned about programmable microcontrollers like the Basic Stamp and others.

On to the sign

Below is a simple drawing of my first (and only) attempt at this concept so far. Basically the 16C84 is stored with the message you wish to scroll across the sign and lights up the appropriate LEDs as the 4017's scan the display from left to right. The 16C84 also controls the 4017s, telling them when to move from one column to the next.

Current project status

Well, I don't have any pictures of the sign because I haven't completed one - yet. Just the other day I finally got the 4017's to cascade so the display could be longer than 10 columns. I still have an extra count between the 4017s. I don't know if I want to leave it in or fix it with my program. I guess as the sign gets longer, it will become a factor. But it isn't right now.

The following is a graphic of the circuit board I'm designing using Visio. Once that is completed, I'll print it out on some special paper that can be ironed on to copper-clad board. Then I'll etch the board and assemble it:

The following picture is a guide to the board layout above and a pinout of the dot-matrix LED components I'll be using:

Materials

The basic list of materials located on my Microcontroller Programming page.

LED matrixes (get those with the columns being the plus side of the LED)

4017 chips. Here's a data sheet on the 4017 in PDF format. It tells you how to use and cascade these chips.

A 7805 power supply chip isn't a bad idea to have, either.

The Program

Here is a copy of the current code: SIGN.TXT

Please note that at the top of the code are variables to make it easier when changing things. Note that the current width of the sign is 10 columns (thus, WIDTH=10). This is equal to using one 4017 chip. Just recently I got two 4017s to cascade. The message this program scrolls is my wife's name (Lisa). It has blank columns in front of the "L" and at the end so it will appear to scroll on from the right and then scroll off at the left.

How it works

The following is a picture of how the microcontroller displays the letter "L". Basically, the 16C84 tells the 4017 to go to the first column by resetting the 4017. Then the 16C84 grounds output pins 1 & 7, thus turning on the top and bottom LEDs (the 4017's output is high). Next the 16C84 puts output pins 1 & 7 high, effectively turning off the two LEDs. Then the 16C84 tells the 4017 to move to the next column by using output pin 8 (clock) and toggling it low and then back high. Next the 16C84 grounds output pins 1-7, thus turning all of the LEDs on. Then the 16C84 puts the output pins 1-7 high, turning the LEDs off and then tells the 4017 to move to the next column. This continues until the end of the display is reached, set by the WIDTH variable in the above code (in the picture below, WIDTH=5). Thus only one column is "live" at a time. However, this sequence is repeated so fast that it looks like an "L" is drawn, with all the appropriate LEDs lit at the same time. This is sometimes called "scanning" or "refresh".

So at this point we have a lovely "L" sitting on our display but it's not moving. That's where the next variable comes in: DELAY=5. What I did could be called a nested loop. There is a loop that is constantly refreshing the display to make it look like more than one column is on at a time. That refresh loop is nested within another loop that controls how long the display stays still before changing or scrolling. Thus my DELAY variable controls how fast the display scrolls. Since I don't know how to do interrupts, I use the refresh loop as my counter. When DELAY=5, that means to refresh or scan the display 5 times before moving the display one block to the right. This way, when you increase the number (DELAY=10), the display is scanned 10 times before the scroll, thus taking longer to scroll and effectively slowing the scroll down.

The only thing left to explain, then, is how we scroll the display. If you take a look at the code, you see there is a long line filled with a bunch of numbers. Each of these numbers represents one column in the display. For example, having no LEDs on is 127. Five of these (127,127,127,127,127) would fill up 5 columns on the display. The "L" in the above example is 62,0,62,63,31 with a 127 after it to leave a blank column between the "L" and the next letter. Remember, since the 4017 is high and grounding an output pin on the 16C84 turns an LED on, having all the output pins low turns all the LEDs on (second column of the "L" is 0 because all the LEDs need to be on). I have set up a pointer (x or b3 in my code) which points to the first column of the display. What the lookup function does is counts over x number of values and returns the number it finds. If we increment x, the lookup function skips the previous number it was returning and returns the next number in it's table. Thus it appears we shaved off the left-most column and slid everything to the left (i.e. we scrolled).

To make it easy for myself to change messages, I created the following Excel97 document with all the values pre-calculated for easy lookup. To change the message you simply change all of the values in that one long line, re-burn the 16C84, plug it into your circuit and your message it changed. And you can even do custom graphics, etc etc etc. The following file does have two macros in it (CTRL+Q for the first page and CTRL+W for the second page). These macros shade a cell red when you put a numeric '1' in it and turn off the shading when you remove the '1'. It's kind of handy when designing new characters and shapes. The values are automatically calculated for you at the bottom of each character grid. Also remember that a SPACE (when you blank out a cell) isn't the same as hitting the DELete key. Doing that will throw off your column values at the bottom.

Here's the file: SignReadout.xls

Conclusion

Well, I'm still working on this to get it going. When I do I'll update this page with pictures. Eventually I want to make a bigger sign with big bulbs, using transistors to drive the bulbs.

If I have totally confused you, then please contact me. All of the above didn't happen overnight and I have had many late-night headaches trying to figure it all out and get it to work - I'm still not even done with it yet!

Update 1/24/2001

The following is part of an e-mail that I sent to a person who was interested in knowing how this project was coming along:

"Yes I did build a prototype. however it didn't work as well as I wanted it to and other priorities have prevented me from "fixing" it. the reason it didn't work - I didn't have enough power to turn on all the LED's in a given column. if you turned on 1 or 2 they were nice and bright. the more you turned on (3 and up) the dimmer the LED's in the lighted column would get. a fix for this would be to place transistors on each column and each row. just small ones like 2n3904's and 2n3906's should work.

"this idea - a dot matrix sign - hasn't left me yet, though, and I'm currently building a much bigger sign. this will use C7 Christmas light bulbs instead of LED's. I've also figured (after doing tons of research on the web) that most signs of this type don't do a vertical scan/refresh like my original design. (I don't like the phrase "vertical refresh" so I'm going to call it "left-to-right refresh"). most signs do a top-to-bottom refresh by lighting up whole rows at a time. this makes the refresh rate much faster (only 7 rows compared with X number of columns).

"because I've switched to AC powered bulbs this created another problem. these bulbs can conduct in both directions whereas LED's only conduct in one direction. when I connected the bulbs up in a matrix configuration I found that turning on bulb on would also dimly light up 3 other bulbs around it. the 3 other bulbs were creating a backup path for the current to flow. I solved this problem by placing 1N400x diodes in series with each bulb. this does 3 things: 1) makes them conduct in only one direction, making them act like LED's, 2) cuts the AC sine wave to half the normal number of cycles, thus 3) prolonging the life of the bulbs so I don't have to change them as often.

"back to the design - I'm going to use an Allegro 5832 chip (40-pin DIP) which gives me 32 outputs and can be controlled via about 4 or 5 wires. this chip will be controlled from a PIC microprocessor. the PIC will tell the 5832 which columns have a bulb on and then light up the row. that's the refresh loop:

"the PIC loads data into 5832 for a given row the PIC tells the 5832 to turn on those outputs the PIC turns on the correct row delay PIC turns off it's row and the 5832's outputs repeat

"once I get a small test of this working I'm then going to introduce PC control. then the loop will look like this:

"PIC requests data for next row from the PC the PIC loads data into 5832 for a given row the PIC tells the 5832 to turn on those outputs the PIC turns on the correct row delay PIC turns off it's row and the 5832's outputs repeat

"the PIC and PC will be connected via a COM port. doing this will let me write a windows-based program and let me completely control the sign. I can place graphics on the sign, scroll it in any direction (diagonal?), do other effects, etc. this is because the intelligence is in the PC and not the PIC.

"ok, now let me address your questions:

"Q: How do you communicate/program your sign?? I would want to do this from the parallel port.

"A: using the parallel port to do this is possible and might be faster than a serial connection. I haven't done this yet so I don't know the answer yet. in my prototype I just placed the pattern directly into the PIC microprocessor's code (hard-coded).

"Q: Have you currently a working version of your project?

"A: just a prototype which I described above.

"Q: I am thinking the easiest way is to track down some IC designed to handle this type of outputs (such as the HD44780 is for LCD) ??

"A: I suppose you could track down a LCD controller chip and use it but the pain is the interface between the outputs of this chip and all the individual LED's you want to use. suggestion: visit http://www.seetron.com and check out their serially-controlled LCD panels. they even have graphical LCD panels that you could place graphics on. they are all controlled via a serial (COM) port so you could send information to them that way. of course the problem with LCD panels is that they aren't that visible from a distance and LED's would solve this problem."

Another Update 5/25/2001

i made up a 4 x 3 grid of C7 lamps (120VAC lamps) and tried to switch them on and off with a solid state relay (SSR) on each column and row.

this didn't work because the bulbs conducted in both directions. so i added a full wave bridge to turn the AC into DC and then added diodes to each bulb so they would conduct in only one direction (this is mentioned above).  the SSR's could switch the 120VDC (good!) and the bulbs started working properly.

next test was to test connect my column driver up. got that all set up and had to invert it's outputs to work with the SSR's. did that and noted that the data transfer speed between microprocessor and column driver was working well and not slowing things down.

next test was to try to light up multiple bulbs up in different columns and rows. this was to test the sign's refresh cycle. i gradually sped things up until it was as fast as it would go. there was flickering going on. not good.

after trying to solve the flickering i realized that the SSR's were bound by the AC's sine-wave/zero-crossing cycle and that i needed to move faster than 60Hz for this to work.

in the mean time i did a project for my father in which i had to learn about and use MOSFET's to switch 12VDC automotive lamps on and off. i learned they do make logic-level MOSFET's and they are very easy to use. so not only did i purchase some FET's for my dad's project but some rated at 200VDC for the sign.

tonight (5/25/2001) was the first time i got a chance to try the 200VDC MOSFET's. i got a test lamp / test circuit set up and programmed the microprocessor to cycle a pin at a rate of 1/2Hz (on for half a second, off for half a second). i turned on the 120VDC and the lamp came on dim and didn't blink. so i went back to 12VDC to make sure i had connected things up properly. it didn't work so i removed the 10K resistor i had in series between the microprocessor and the MOSFET's gate. it still didn't work.  i then remembered that this FET's gate will switch when it is 5 volts above source/ground. i had forgotten to give the 12VDC and the 5VDC circuits the same reference point by connecting the grounds together. i did that and the 12VDC lamp blinked. so i then moved back to 120VDC. when the MOSFET was switched on things shorted and i blew a 7407 chip in my programmer!

so right now i'm busy trying to repair my programmer and to figure out what went wrong.  i feel i'm very close to getting this working.  just need a few more answers.

if this method of refreshing doesn't work i'm going to go with latches on the rows to see if that will work better.  this also means the refresh cycle's direction switches from top-to-bottom back to left-to-right.

 

Other Information

Another possibility for a sign is using a 7 segment display. It consists of 7 individual LEDs with one end of each LED connected together. If all of the plus ends are connected together, it is called common anode. If all of the minuses are connected together, it is called common cathode. Here's an example of how to get more current to a display so it is brighter:

The transistor amplifies the current drive capability of the I/O line to solve this dilemma. It is easy to operate, put ground (TTL low) on the I/O pin to turn on the transistor and enable a given display, put 5 volts (TTL high) on the pin to turn off the transistor and the display.

Reutrn to Electronic Projects page

Return to HOME, Dorothy!

Created on 3/31/98 / Last modified on 12/04/07
by Drew Hickman / drew@hickmans.net