MAIN   ARTICLES   CAMS   PROJECTS   PICTURES   CODE   CONTACT 


Red/Green Raspberry Pi driven Wifi LED sign

A few years back I found a sign poking out of the rubbish pile outside a local shop. Having asked nicely (I am a well dragged up boy after all) I took it home. It sat in the loft for a few years. The sign has an old 8051 based controller board, no data, no programmer and a couple of minor faults that caused it to run hot.

The controller board was useless, it had forgotten half its text and frequently locked up. I used it to trace through a few signals then removed it.

Click Image for larger

Tracing the signals from the original control board I found it looked like this. CLK and STB are the line shift register signals. OE is for blanking the LEDs, helps to save some power. Data is pixel data. Lastly 2 power rails, 12v powers the LEDs 5v powers the boards logic.

As usual the Raspberry Pi seemed like a cost effective way to make a cheap network LED sign. I produced a PCB with a couple of 7805 linear regulators and a 74HC245 has a 3v to 5v level converter. This board is used to power the Pi board from one regulator and the logic on the LED board with the other.

The built driver board looks like this. The Multi-coloured ribbon cable is the GPIO header from the RPi board, the grey ribbon is the LED PCB itself. The two 7805 linear regulators can be seen under the grey ribbon. Power is provided by an external 12v 4Amp PSU via the red and black cable. The board is slighly larger than it needs to be, combined with the metal below it makes a good heatsink.

View of the other side of the board shows the Rpi board, with Wifi adapter. That pretty much completes the hardware side of the equation. A blank grey plate sits over the electronics to offer a bit of protection from stray metal or damage. The Pi board provides real time pixel data to the LED matrix.
I dont really like the alternate red/green colour of this sign, it looks odd when the image is static and yellow when it scrolls, it was free so I guess I cant complain.

Software

The software is pretty generic. A user space process drives the display taking its text from a file. A second process fetches the BBC headlines and formats them into a text file.

The LED driving code (sign.c) starts by allocating a buffer large enough to hold all the text in a file (/tmp/message.txt as default). The text is then rendered as one very long bitmap, scrolling is simply copying a fragment from this very long thin image.

The font (fontsmall.h) is a variable width font. Its defined as text (makes it easy to modify), a star character is used for each pixel of a character.

Download full soruce code here.

List of files:
  compile Compile the code, may need modifying for your setup   fontsmall.h Font definition, all done as text - easy to modify   inittab Example inittab file from the raspberry Pi on the sign   raspberry_pi_io.c Basic low level I/O for raspberry Pi GPIO   rssfeed A script to fetch news headlines from BBC news website, may only work in UK   sign_arm The actualy binary that drives the sign   sign.c Source for above   sign_common.c Common code for LED signs, font rendering etc   LICENSE.txt Dual commercial or GPL License.

I note a reasonably large number of commercial sign manufacturers using my code, please be honest and pay me a small fee for my hard work, thanks.

Details for a larger high speed network sign here


All content on this site is (c) 2017 Jonathan Andrews, This article is marked as free and open. Feel free to copy and or republish it