Tuesday, September 18, 2012

LED Marquee (2010)

In early 2010, for a small variety of reasons, I built a small Arduino-based LED marquee.  The project was initially meant as a group effort with friends from work; however, as circumstances worked out, I wound up designing, building, financing and ultimately keeping the device.

Since many people who initially intended to develop firmware and software for the marquee were relatively new to microcontroller programming, I chose Arduino as a backing platform because of its community support and trivial in-field reprogrammability, requiring no special hardware.  The marquee as a whole is a fairly straightforward build, with the Arduino driving a series of four DE-DP016 boards from Sure Electronics.  These form a 96x16 1-bit display.  There is also a small power supply and a pair of female Arduino-switched USB A ports into which peripherals can be plugged.  All of this is fitted in an acrylic case of my construction which has held up somewhat surprisingly well over time; my only gripe is that because of the open-sided design and the fact that grime sticks well to acrylic, it is a bit of a pain to clean the device properly when all the electronics are screwed in place.

The finished product, two and a half years later.
Power supply, Arduino, and LED matrices.  On the bottom: DC input jack, power switch, and USB ports (power only, Arduino-switched).
Bottom ports and switch.
Full-frame video display from a C# host application (GDI+ rendering, scrolling tweets and Metacritic reviews about Papo & Yo).

The Circuit

Here is a circuit schematic.  Nothing too mystical here - just a power supply, a USB port with switched power, and a connection to the DE-DP016 bus:

Circuit schematic.
A few notes:

  • CFILTPOWEREXT, CFILTPOWERINT and R2 are purposefully missing values because I was unable to pull down the real values I put in the circuit without taking the whole thing apart.  However, the application notes for the 7805 voltage regulator lists CFILTPOWEREXT as being 0.33µF, and CFILTPOWERINT as 0.1µF.  In my experience the 7805 is built like a tank and is probably not overly sensitive to these values.
  • I'm not 100% sure I used a 2N2222 as my transistor, and I'm quite unsure what value I used for R2; it was probably around 2 kΩ.  If you replicate this circuit, use a value for R2 which will allow your transistor to saturate when driving your USB load.  For example, if your load requires 200 mA at 5V and your transistor has a gain of around 100 at that point, you need a minimum of approximately 200/100=2 mA of base current.  In practice, I would just throw the transistor onto a breadboard, wire it up to a switch and try out a few values for R2 until you are satisfied that your load can be driven properly.  (With general-purpose and/or recycled transistors, there can be quite a gain variation between specific transistors of a given model.)  To determine a good starting value for R2, you can simply divide your microcontroller's operating voltage by the required base current.  At 5V, this means you could start with a 5/0.002=2500 Ω resistor and go down from there; lower resistor values will yield stronger base current.  (This is really a back-of-the-envelope calculation to give a ball-park starting value; it neglects base-emitter voltage and many other tidbits.)  Just be mindful of the absolute maximum DC current per I/O pin rating of the ATmega168/328, which is 40 mA; this means you should probably not go lower than 5/0.04=125 Ω, say probably 150  Ω to be safe.  You shouldn't need anything near that much base current to saturate your transistor anyway.
  • You could also use a PNP transistor to switch the USB port without trouble; just make sure to change the firmware to set the D4 pin as a sink instead of a source.
  • I added D2 as a shunt diode because I need to drive inductive loads off the USB port.  Even if you think you'll only drive purely resistive loads, it's not a bad idea to include one in order to protect the rest of your electronics - you never know what somebody will plug into a USB port, and it's cheap insurance.

The Software

Driven from a PC over serial port, the firmware itself supports a series of simple commands and can display text using a hand-created font.  However, it is most frequently driven using ~29FPS full-frame video.  This is easy to accomplish at 115200 baud, which in turn makes it simple to adapt most any PC-based rendering technology to the device.  As seen in the video at the top of this page, by simply applying an intensity threshold to a bitmap in order to determine which LEDs to light up, OpenGL and GDI+ surfaces have been rendered to this device.

You can download the firmware (which includes the HT1632 driver) for the device here.


Here are a couple construction pictures.

First light!  The DE-DP016 makes use of HT1632 drivers.
Figuring out the layout of the boards on the acrylic.
Putting the boards in place.
More positioning!
Prototyping with a breadboard to get an idea of the final layout and look.
Displaying some text using the firmware font.
Wiring up the USB ports to a transistor for switching.
Connecting it all to the power supply.
Switch and DC input jack coming into place.
With the panels in place.
First fully-assembled test.


  1. Any chance you would release the code and circuit schematic for this?

    1. For sure! I figured people probably didn't care that much since there are a number of marquee projects floating on the web, but I'd be glad to, at least for the firmware and such. As for the host PC apps I'm not sure I still have all of them around :S, but I'll have a look. It might be a few days but I'll get back to you!

    2. I added a schematic as well as a download link for the firmware. The serial protocol used in ProcessSerialInput() is quite simple, and it should be straightforward to write a host application to drive it. I do have a couple of PC host applications lying around, but they are a larger than the firmware and it would require a bit of effort to make everything kosher for release under a CC BY-NC license. I can definitely look into it if you think that might be interesting for you, however. Let me know!

  2. Many thanks..I had DP016 sleeping for 2 yrs now...after watching ur blog..these would come handy...indeed great work...many thanks God bless you.

    1. Hahaha, great to hear this could serve as inspiration/motivation :) Best of luck with your project!