Moving Sign

Moo, of course!

Moo, of course!

Introduction

So, we ended up with an old moving sign at our place. It was from some sort of junk store. It came with a very insufficient power supply which made it not work quite right, but I hooked it up to one of my bench supplies and it worked! There were lots of cheesy things it could do. It came with a keypad to enter messages. The first thing we thought was that it would be much cooler if it could be controlled from a computer.

Reverse Engineering

I spent a while with my scope figuring out how it worked. The sign has 84 columns and 7 rows of 5mm LEDs. The columns alternate green and red, allowing up to six “colours”!!! Or so says the demo in the ROM. Apparently black is a colour! (pffft, marketing!) Anyway, the meat of the sign is a row/column matrix of LEDs. Power is applied to one of the 7 rows at a time, and the columns are grounded to make the LED in that row light. The data for a row is stored in a long shift register with 84 bits. The shift registers are a bunch of 74HC595 chips daisy-chained together. Data is clocked into the register, and then when it is to be displayed the appropriate row is energized and the shift register contents are loaded into the latches, one per column. (part of the shift register chips) Once the data is loaded, the row will display the data and the shift register is able to be shifted in with new data while showing the latched data.

The original circuit refreshed the sign at about 60Hz, which means that each of the 7 rows is displayed for 2.4mS intervals, with just over 16mS required to display all 7 lines.

Replacing the Logic Board

Old Logic       Board
Old Logic Board

Old Logic Board

Row Drivers

At first I wanted to salvage part of the old logic board because it contains the row drivers and the power supply. The power supply is linear and gets very hot. Also, I was not able to make the row drivers work properly from my circuit, so I eventually just ditched the whole thing and started from scratch. I made new row drivers using IRF530N power MOSFETs and a ULN2003 to drive them. Although FETs are voltage controlled, these ones require more than 5 volts to turn on, so I used the ULN2003 as part of a voltage level converter.

Microcontroller

PIC microcontrollers are the shit! I really like them, and am also really enjoying programming the 18f252 in C with Microchip’s new C compiler. I made some code to scan the sign by loading data into the shift registers and controlling the row drivers. Although bits are loaded across the display, it seemed better to make it so that each byte in memory represent a column, since it is easier to render fonts and make stuff scroll if it’s laid out that way. So the PIC has 84 bytes of RAM used to represent the 84 columns from left to right.

The PIC continually scans the display. The speed I ended up choosing makes it go at about 56Hz, which is actually better since it doesn’t beat with the florescent lights in my workshop. Once I had it displaying the contents of my 84 byte buffer I added RS232 code. My roommate Dan and I designed a very simple data protocol.

Since the display only has 7 columns, all data bytes destined for the screen need only be values from 0-127. This leaves the 8th bit unused, so we use that for a control byte. Right now it just means that if the 8th bit is set, it resets the receiver. The next 84 bytes received will load the 84 columns from left to right. We could add more functionality by making different kinds of control bytes. Currently there are no special modes for automatic scrolling, built-in fonts, or anything like that. The sign just displays whatever you put into it. We use 19,200bps as the baud rate and it seems to work fine. The PIC can of course go much faster, but this seemed to be good enough.

The result is a new logic board with less parts and lower power consumption. I just soldered everything up on a piece of prototyping board. There is room for expansion in case we get any wild ideas. The power supply is now external. I put a hard drive power connector on it so that it can run off a PC power supply, but the goal is to use a small brick-style switching supply like a laptop supply. I’ve seen ones at the surplus store that the voltages that we need.

New Logic Board

New Logic Board

PC Software

While I was soldering and writing PIC code, my roommate Dan worked on a Java program to render fonts and scroll text. It can render real fonts to display on the screen, scroll text and various speeds and neat stuff like that. It even gives a preview on the computer in a small window that simulates the LED sign. He is working on making it not require Swing by using a bitmapped font and getting rid of the preview function. The next version will be portable to the TINI embedded network platform, which runs Java programs on a souped up 8051 microcontroller. This would mean that the sign has a network jack on the side of it. (ultra-l337!)


Downloads


Conclusion

We started this late one night when there happened to be nobody going for drinks (thirst :( but productivity! :) and it was all together and working by the afternoon the next day. I learned a lot more things about the 18f252 microcontroller, which I have just started using. I would like to use some of this code in some other projects, probably with small matrix LED displays. Also, using a larger buffer and implementing scrolling in the PIC would make the scrolling smoother, although for some applications it wouldn’t matter