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 CircuitHere 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:
- 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 SoftwareDriven 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.
ConstructionHere 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.|
|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.|