Lightshow Controller (2009)

For years, every time I turned something on or off I would think "wouldn't it be great if I could control this with a computer?" Well, here's the device I've always wanted! It's a powerstrip modified to connect to a computer, letting you control and fade each socket individually.

It cost about $100 to build -- much cheaper than home automation equipment -- and it responds fast enough to control lights to music.

Commands are sent through a serial port at the end of the strip. Each socket can provide up to 2 amps (240 watts) and update at 60 hertz.

Warning: This project requires working with high-voltage electricity. Don't try something like this unless you know how to do it safely! The following is for documentation, not instruction.

Here's a view of the inside. Each socket is controlled by a solid state relay (SSR). I removed the first socket to provide room for the electronics.

The electronics are powered by a regular 5 volt AC adapter. I took it apart and simply tucked the circuit board inside the power strip.

To connect a SSR to each socket, I separated the live wire from the row of sockets, and stripped small sections of its insulation to solder to each SSR. (Electrical tape removed to show the connection.)

The SSRs plug into a circuit board with a microcontroller, serial transceiver, and optoisolator for AC synchronization input.

The circuit board fits next to the power supply, and is connected to a serial port in the end plate of the strip.

The circuit acts as a fader by switching current on and off at precise times during the 60-hertz AC cycle. The left image shows the shape of the AC output when dimmed slightly, and the right image shows the output dimmed futher.

Parts

itempart numbersourcecost
powerstrip Power Sentry S10051900104/17 amazon $20
5v power supply generic   $3
microcontroller ATmega48 digikey $2
solid state relay G3MB-102PL DC5 digikey $4 x 12
RS232 tranceiver HIN232CPZ digikey $1.50
optoisolator NTE3098   $2.50
passive components     $8?
total $85

Source code

Microcontroller code: lightshow_mega48.c

Sorry, there was a problem showing the code.
Try the download link instead.

Lightshow controller in action

For a while, I connected pretty much everything in my room to the controller. It was great for mood lighting (let me just pull up a command line...), and I scripted a sort of artificial sunrise to help me wake up.

A simple row of light bulbs makes a great sound level meter.

At Burningman 2009, strings of chrismas lights connected to the controller formed the pulsing tentacles of a jellyfish dome.

It's been to a few parties. This is the hacker dojo grand opening.

And it greatly improved our cardboard christmas tree.