BY PETER STONARD
Even if you don’t share my
enthusiasm for “blinky
lights,” you’ll find some
interesting nuggets of
wisdom from my school of
hard knocks to boost your
next construction project.
As we ramp up for the holiday
season, it’s time to decorate our
homes and gardens. The Holiday
Lights Controller project has
been given a minor facelift and
some new features.
It’s funny how some of life’s adventures can appear
different in the rear view mirror. A couple of holiday
season’s ago, I was looking for a simple controller to run a
holiday light show. Commercial packages —some with
music sync and a personal computer as the engine — were
available but none fit my budget or simple requirements.
So I rolled my own, taking on a project with technical
challenges and a hard end date (December 25th or
sooner!). I expected to enjoy it for a couple of months
and then shove it in the attic with our fake tree before
turning my attention to the summer. The project was
featured in the November 2007 issue of Nuts & Volts.
(PDF reprint available at www.nutsvolts.com)
While hitting my original goals, I also found some of
the project’s subtleties to be a worthy opponent!
Admittedly, when you build a prototype and then publish
an article, you have to cater to others and try to avoid silly
mistakes. You also see your work through the eyes of
others, who show great insight, find new applications, and
push the envelope. So the original hardware has been
poked and prodded through the past summer (while still
allowing me some time away from the soldering iron).
Here’s a round-up of the things that I have learned
and an update to the project for anyone interested in
jumping in. I don’t have accurate data on how many
copies of the original design are in use. A couple of dozen
52 November 2008
PCB kits and pre-programmed AVR ICs went out from
here, and the data package was downloaded from
www.AVRfreaks.net over 250 times!
The hardest problem to solve with the original
design was getting all 32 channels to have independent
brightness control. When the first article was published, I
had 32 on-off channels working and eight of those were
also full range dimmers. At the time, it looked like a
couple of evenings would be spent on the firmware code
to finish the rest. Wrong! My attempts to do so crashed
the µC; the root cause was trying to do too much with
the microcontroller specified in the original design. I used
BASCOM macros for the I2C bus commands and had little
control over their actual timing, which is quite critical in a
phase-angle dimmer circuit.
Here’s the solution: a revised I/O card design. The
original one remains perfectly good for up to 32 channels
of on-off control or eight channels of full range dimming
(compare them in Figure 1). Take a look back at the
original article; there are four identical I/O cards linked
by an I2C bus to the controller card, which has the
microcontroller, user interface, and power supply. The
solution to the I2C bus problem is to off-load some of the
individual channel timing to a new I/O card design, while
keeping the original controller card and hardware without