Back at the end
of November of 2005 I watched an internet video of a house that had a large number of flashing lights synchronized
to music, and challenged me to figure out how he did it. At the same time my wife who loves Christmas lights saw the
video and told me to do it. So I went forward and came up with the current design, not really knowing how the other
guy made his display work.
Just recently I
found a Google search string that got me to information regarding the above mentioned lighting display. The creator of the display, Carson Williams of Mason Ohio built up the display on his home using a commercial
lighting system made by a company called “Light-O-Rama” and set the standard for how I developed my system and
the quality of the display needed. There are a number of adventurous people out
around the US that have built up advanced lighting displays.
This is my story:
My interface is
100% home grown. It uses a digital music technology called MIDI (Musical Instrument Digital Interface) to control the sequencing of the lights and the playing of audio files. I chose this method because this is a very stable and defined interface with
a lot of existing MIDI hardware and software around at affordable prices.
The design idea is simple; use the MIDI Note On and Note
Off commands to control a number of solid state relays. The MIDI interface can communicate with up to 16 channels (or devices), and each channel can control
up to 127 notes. I wanted a design that was modular and supported the incremental
addition of light control, the basic specifications follow:
After doing the initial design requirements and researching component availability and specifications, I set out to
develop the Light Controller. As I have a lot of experience working with the
Zilog Z8 products and a large library of functions that I have developed over the years, I chose to work with what I knew
for a fast design project (ya right).
The final design uses 3 Zilog microcontollers, each with custom firmware to control the particular controllers function. Using the Zilog Z8 products had some limitations, the biggest being CPU clock speed
which limited the number of instructions that can be processed between MIDI data sequences. That and the number of I/O bits needed caused me to separate
the functions into 3 areas:
- The MIDI Interface takes incoming MIDI data, Decodes the
channel number, converts the data from Serial to Parallel, and if the channel matches the current hardware address, passes
the note on/off data to the other 2 processors.
- The Display Controller is an optional part and not needed but adds lots of user information during the operation
of the Light Controller. I initially built this into the design to help debug
and trouble shoot the hardware as I got tired of looking at Logic analyzer traces and counting timing data on the color scope. It also adds real ‘bling bling’ to the finished product.
- The Light Controller takes the same data as the Display Controller and controls the 20 solid state relays.
Once the hardware was designed I set out to writing the code to control the first of the 3 controllers, the MIDI Interface. During that time I built up the prototype hardware.
As getting a PCB made from an untested and changing design is outside my budget I hand soldered the prototype. It was built in 2 parts, the logic hardware and the power switching hardware. As with all software UARTS, timing is critical, so I spent a number of evenings developing
code that worked properly with the fast 32Kbs data stream. The current code revision
is rock solid, never misses a sequence.
I next focused on the Display Controller code. It was rather simple to
develop as I have used this technology in past projects so libraries all ready exist for the basic display functions. Other than displaying an initial sequence of start up messages, the displays purpose
is to show the note (light) number and an on or off indication. This was very
useful in the final debug of the MIDI Interface code and the Light Controller code.
The hardware for this part of the design can be left out but is worth the investment in parts just to see the data
‘flying’ by on the display when valid MIDI data is received,
The Light Controller code was developed after a few days of thinking about how best to do the task of tracking which
light is on, which is off and how to act when new light on/off values are received.
From concept to working prototype, I spent about 1 month of evenings in my home lab before I was ready to try putting
the prototype into use. I then hung short light strings all over the lab and
went about setting the lights to the music.