DMX Light Control, Color Strobes
When warehouse 23 was a place that existed in Boston, there was a coffee table made out of glassbricks. Below its translucent surface were several full color LED light fixtures. When lit up, it looked like an oversize stack of Jolly Ranchers. The table had been built and programmed by friends who lived there, though I'm not specifically sure who. There was a simple Java web interface running on an adjacent laptop to control its color. I expressed interest in writing pattern code for it, but before I had my chance, my friend Frostbyte died and warehouse 23 fell apart. Shortly thereafter, I moved to Boston and joined my friends in helping to clean out the space. Being inadequately endowed to repair what really mattered, I managed to salvage the table, but the controller was lost.
I spent that winter in early 2006 (while half heartedly looking for a job) working on a new controller for the dark table that now sat in the living room of the Bennett Street Home For Wayward Boys (and Girl) where I'd come to settle. The controller is called “The Box” for lack of any other name that stuck. It has come in handy for many projects requiring light control. It was designed to output DMX signals to 3 RGB LED fixtures (our living room wasn't large enough to accomodate the full 4 light table). It allows the user to make static color settings to each of the fixtures, fades, and strobes, using 3 control buttons and 3 analog sliders (like from a mixer board). An explanation of its design and function will follow.
Once the controller had been built, the table was again functional. It lasted for several years, eventually settling in the Psi Trance Loft at Vermin Street until its demise at a party when an errant drink destoyed two of the light fixtures. The controller itself has made appearences in an ever evolving series of art installations since that time. For the interested, a partial listing, and perhaps some photographs:
12V DC Input via wall wart. DMX Out via RJ45. The DMX signal is RS-485 at 250kbps consisting of 19 DMX channels (a dummy channel, 8 bits of Red, Green, and Blue for each of 3 lights (addresses 1-9), and then the data from addresses 1-9 repeated just for fun). This partial DMX packet is sent out every 5ms. It's been used with several Color Kinetics fixtures, including PDS-150's, Colorblazes, and (x).
The DMX is produced by an electronic circuit consisting of the following modules: Power regulator, power sensor, cpu, transceiver, mode lights, buttons, sliders.
The box doesn't draw a lot of current, so a simple linear regulator (7805)
provides sufficient power without getting hot. There are some caps as recommended and a big fat cap
that keeps the voltage up for a few (5) seconds after power down. The voltage
divider on SNSE was chosen to work with the 12V wall wart that I was using and
may not work for the full input voltage range as indicated. Because of this,
I've occasionally had to pull the voltage supervisor off the board to get the
circuit to run.
SNSE is monitored by the voltage supervisor to give the cpu some advance warning
if the user has switched the unit off. Because of the fat cap, the cpu has an
eternity during which it can send out a DMX packet to turn off the lights,
giving the off-switch a more intuitive response than merely ceasing to send
packets.
The CPU is a PIC16F84A 8 bit microcontroller driven by a 20MHz resonator. It
has a programming header for the PICkit 3, and a reset circuit. Every 5 ms, it
reads the sliders, debounces the button inputs, calculates what color the lights
should be, sets the mode light, checks the voltage sensor, and sends out a DMX
packet.
The MAX490 does RS-485 level translation for the DMX output signal.
There are 8 LEDs on the front of the Box that are driven by a 3x8 decoder to
indicate to the user which mode the controller is in.
There are 3 buttons on the front of the Box that allow the user to change modes
and submodes. An additional button, on top of the box, acts as a reset. A
detailed explanation of their function is printed in the instructions.
There are three 100K potentiometer type sliders on the front of the box for user
input. These sliders are read using an RC timing circuit by first charging the
caps using the PIC output drivers, switching the drivers to tristate / input
mode, and measuring the amount of time the caps take to discharge through the
sliders in order to register as a 0 input to the PIC. The values chosen here
are the result of iterative tweaking rather than design. There are some limited
adjustments in the program code to compensate for variations in available
hardware, though it occurs to me that it would've been easier to add some pots
to the board for this purpose.
The circuit is housed in a plastic project box whose face was milled and drilled to accommodate the sliders, buttons, and panel mount LEDs. The box also has an on / off switch with an indicator LED, a reset button, and power and communications wires coming out of it.
The circuit schematic was assembled using Kicad, a cross-platform open-source schematic and layout capture tool for electronic design. The design does not have a layout as it has been implemented by hand on perf-board in all of its incarnations thusfar.
The software running the Box was developed using Piklab (a graphical development environment for PIC micro-controllers) and the GPUtils toolchain. The current version (Pattern7.asm) is written in PIC assembly.
The Box has a complex control scheme that can nevertheless be easily conveyed in abbreviated form to a novice so that anyone can use it. The instructions for Hardware Version 2, Software Version 8 are as follows: