SPIN ZONE
ADVENTURES IN PROPELLER PROGRAMMING
■ BY JON WILLIAMS
LIGHTING UP THE SEASON - AGAIN!
I like this time of year. The air is clear (even in Los Angeles!), the mornings are
crisp, and the evenings are brightened with holiday decorations that illuminate
the insides and outsides of homes everywhere. My home is somewhat small,
so my lighting projects are, too. Small doesn't make me wimpy, though, and
my little 12-channel lighting board for the Propeller Platform is designed to
be tough enough for applications that go way beyond LEDs.
THE POWER OF 12
A couple months ago, I had the pleasure of working
with a leading Hollywood special effects designer to add
lighting to a big prop he built for a client. The prop is a
futuristic soldier in a large suit that has rocket engines on
the back. My friend wanted to use very bright RGB LEDs
in the rockets so that they could be faded up to bright red,
then slowly transition to blue — all while appearing to
pulsate and "rumble" as a real rocket engine does.
Output control was pretty easy as I'd previously used
a TIP125 in a high side driver circuit for high power LEDs.
I simply whipped up a 12-channel board to handle the
"rockets" and other lighting tasks, and then took advantage
of launching multiple Spin cogs in the Propeller to simplify
the code for each element of the prop. In the end, my
friend was very happy — so much so that he was actually
making engine sounds with his mouth after we got the
code adjusted just the way he liked it!
After buttoning up that project, I started thinking
about some holiday lighting ideas and then I had a
thought: If I beef up that circuit — just a little — I can use it
for other things, too. With 12 channels, I could control 12
independent devices, or I could dedicate three channels
■ FIGURE 1. High side driver.
14
November 2010
to an RGB LED module, or I could dedicate four channels
to control a stepper motor, or I could control any
combination thereof. As my friend, John, says, "It's just
SMOP" (small matter of programming).
As I was already using a TIP125 which can handle a
fair bit of current, I updated the driver circuit (Figure 1) by
adding a diode across the output terminal; this will let the
board handle inductive loads, too. The real trick, though,
was squeezing 12 of these circuits onto a standard
Propeller Platform module and running power traces on
the top and bottom of the PCB (printed circuit board) to
increase current capability of the board. That said, the
total current should be limited to 5A and only if power is
coming in on TB13 (when power is "borrowed" from the
Propeller Platform, the connections/traces from the P/P to
the driver board cannot carry that much current).
Figure 2 shows a completed board (with 12V test
LEDs attached). Yes, it's pretty busy and will take a little
patience to build; just take your time with the components
and start with the shortest (resistors) and work your way
up to the tallest (TIP125s). As suggested above, TB13 is
available when you need to control a lot of power. You
can also power the Propeller Platform from TB13 — there
are power jumpers to the VIN headers that need to be
installed for this. Note, though, that the power switch on
the Propeller Platform is bypassed when power from TB13
is shared through these jumpers.
With the little room I had left, I squeezed two simple
circuits onto the board. The first (shown in Figure 3) is a
simple pushbutton and normally open, dry contact input.
As with the output circuit above, there is a pull-down on
the I/O pin (that is part of a SIP package). The pull-down
is especially important on the output circuits to hold the
outputs off while the Propeller is in reset and the I/Os are
floating.
The other circuit I added is a TTL serial port shown in
Figure 4. The 2.2K resistor in the RX line allows 5V systems