This time we're going to talk about the electronic engineering behind The Grid, an art/engineering installation at Electromagnetic Field (EMF) 2014.
We now have a whole lot of aluminium poles with LEDs attached. We have 600m of cable connecting the LEDs to our control box, and 900W of 12V power supplies. Now we need some electronics to make our LEDs display some cool patterns (or more specifically, some electronics to let software turn the LEDs on and off).
Multiplexing
The first task is how to drive so many outputs (in this case, LED strips). Amongst the plethora of multiplexing strategies, a classic is the use of shift registers. A serial-to-parallel shift register effectively converts a serial input into parallel outputs, letting three signals (clock, data, and latch) drive a number of outputs, usually 8. What's more, you can chain together shift registers so your three signals can drive as many outputs as you like (within reason). Our 7x7 grid of outputs can be neatly represented by 7 chained shift registers, using 7 of the 8 outputs on each. We used Texas Instruments' TPIC6C595N, a handy little shift register with open drain outputs (for reasons that will become clear later!).
Computer Interface
We now need to control our shift registers from a PC. As usual, there are numerous ways to do this – we could use a serial port, or even use the bit-banging functionality of the FTDI FT232RL common in USB to serial converters. However, the easiest solution was to use one of the many Arduinos we have lying around. An Arduino Leonardo happily accepts sets of 7 bytes over USB (with a rudimentary packet framing format) and then uses the clock and data signals to shift those 7 bytes out onto the shift registers. This has the huge benefit of not requiring a serial port, making the control box much easier to drive from a laptop in a field!
Power Switching
Finally, we need to switch the current to each LED on and off. Options include FETs, BJTs, or other exotic options. We first considered using a BJT, or Bipolar Junction Transistor, for switching. However, the modest current gain of budget BJTs mean they need a quite reasonable base current to switch 1.5A. We would like to drive the BJTs directly from digital logic, which has quite a limited current drive capacity, and we don't want to need two stages of drivers. A common solution to this problem is to use a Darlington pair, two BJTs arranged to give a much higher current gain.
A Darlington pair transistor, courtesy of Wikipedia
Unfortunately the configuration of the Darlington pair increases the collector-emitter saturation voltage, increasing the power dissipated for a given current passing through the device. We'd need some pretty serious heatsinking which would be awkward and expensive on 49 devices, so this option was out!
We settled on using MOSFETs as they can pass a decent current while dissipating little power due to their pretty low channel resistance. We're using the FQP7P06 by Fairchild Semiconductor, which has an on-resistance of just 0.3Ω at our operating point. The MOSFETs will still dissipate about half a watt at most, but a very small, light, and cheap heatsink (for instance this tiny TO220 heatsink) makes short work of that.
We're using a PMOS to drive the high side of the LED strips, permanently grounding the other side. This leads to a handy trick for generating the relatively large gate voltages MOSFETs like (as much as 10 or 20V can be necessary to reduce the on-resistance sufficiently). The PMOS sits near the 12V power rail with the gate pulled high by a resistor to hold it turned off. To turn the PMOS on, we pull the gate voltage down to 0V, giving a respectable V_GS of -12V. Earlier we sneakily chose shift registers with open drain outputs. When inactive the outputs have a high impedance (and, importantly, can tolerate the output being pulled up to 12V, 7V above VCC!). When activated the outputs pull down to 0V, activating the PMOS.
PCBs
The original plan was to build all of this electronics on a large hunk of strip-board. Having remembered how much I hate wiring strip-board, we decided to make PCBs instead (a decision I am infinitely thankful for). These days it's remarkably quick, cheap and easy to design a PCB and get it manufactured. Populating a PCB is often much easier than wiring strip-board from scratch, and the end result is significantly more lovely.
We used KiCAD to design these PCBs, though Eagle is another popular choice. In either case it is straightforward to first capture the schematic (seen above) and then lay out the actual footprints, route them together with copper tracks and export the design files for manufacture.
Budget PCB manufacturers prefer to make lots of copies of a smaller PCB instead of making one big PCB. Our design breaks down extremely well – we make 7 PCBs, each of which holds one shift register and 7 output drivers (along with assorted connectors, and some LEDs to look cool). The PCBs have some cleverly positioned connectors to slot together and pass along the shift register signals from board to board. Each receives power to drive the LEDs through chunky wires soldered directly to the bottom of the board.
We then add some nice little heatsinks to each transistor to add to their power handling capability (check out the close fit), solder everything in place and call it a day.
We made a box to contain the PSUs and PCBs out of laser cut plywood, which is then placed into a larger metal flight case for transit. The wood has ventilation slots for the PSUs, holes for the various cables to reach through, and mounts all the PCBs in just the right position for their on-board headers to chain together. You can also see the Leonardo used to drive the first PCB in the chain (which is in turn connected to the computer for control signals). We even added an IEC inlet for mains power so that we could have a safe and fused power connection.
Next time: the software used to tie all this together!