Introduction: Audio-Controlled Christmas Light Flasher With Individually Controlled Stereo Channels

In this Instructable, I will show you how to control things powered by 110V AC with an audio signal. This project was inspired by a similar one done by Alan Parekh on a different site, originally created by rybitski at http://hackedgadgets.com/2006/11/29/audio-controlled-christmas-lights/, but I have made some revisions (not all on purpose) and the instructions here will be much more inclusive.

Please be careful. Unplug first when working on anything electrical. 110V AC can kill you!

Step 1: Acquire Parts

In my design, I decided to retain stereo capability. In order to do this, I had to double the required parts. Here is a list of parts required:

--Pair of amplified computer speakers. A medium-to-large case would make things easier. Also, a standard, integrated power cord (non-wall-wart transformer) can free up a lot of space inside. I used a used set of Gateway Edison 2.0 speakers I bought from a used computer store for $5.
--An outlet, which I bought at a local hardware store for $0.59. You can decide if a cover is required for your application.
--2 Rectifiers. I bought mine from RadioShack. I decided to buy the 4A, 400V-capable units, to be on the safe side. They cost about $2.50/apiece.
--2 Solid State Relays. I followed Alan Parekh's example and used 2 Crydom D2W203F relays. I bought these from Mouser for $8.80/apiece. These are by no means the only units that can be used, but they work great.
--2 Potentiometers, to match the original that will be replaced. Mine was a 10k. These cost me $3/apiece at RadioShack.
--2 knobs to fit on the potentiometers. These cost me $3/pair at RadioShack.
--If your speakers have a wall-wart transformer, you will need a power cord to get the 110V AC inside the speaker cases. You can buy these from RadioShack, hardware stores, or simply cut one off of an old appliance you are no longer using. Again, please use caution and unplug anything before working on it.

Tools Required:
-Soldering Iron
-Solder
-Wire Strippers
-Screwdrivers
-Electrical Tape
-Small-gauge wire (I used 22ga stranded)
-AC-rated wire (or just cut a bit off your power cord, like I did)
-Some others may be required. I also used scissors, a cordless drill, side- and end-cutting pliers.

Step 2: Take Apart the Speakers

My speakers had a press-on grill that could simply be pried away. I then removed the screws which retained the speaker. After this was open, I used my soldering iron to remove the speaker entirely.

Then, I carefully opened up the case on the computer speaker that contains the amplifier. I practiced on the other speaker first, in case I destroyed it accidentally. Unfortunately, the speakers that I was using were glued together, which made them difficult to pry them apart without breaking.

As I was taking the speakers apart, I forgot to take off the volume control knob and remove the nut underneath that held the potentiometer in place. This broke the potentiometer, which turned out to be a blessing, as I will show later.

Step 3: Position the Outlet

Next, figure out where you are going to place the outlet in the speaker casing. I found that the place where the speaker had been located was perfect, requiring only a little modification. Using a knife (be careful), I cut out holes for where the outlet was to be located on the speaker grill. If you have access to one, a Dremel tool would be perfect for this job.

Step 4: Wire Up Your Rectifier/relay Array

In order to package the rectifiers and the arrays in the case of the computer speakers, I decided to use a small scrap of plastic to hold everything in place. This can easily be done with some thin plastic and a cordless drill with a small bit.

The purpose of the rectifiers is to take the alternating signal from the speaker outputs and convert it into a DC signal. This signal can be used to control 110V AC through the relay.

Solder the speaker output wires to the AC (or ~) leads of the rectifier. Then, using short wires, connect the + lead of the rectifier to the + lead of the relay. Connect the - lead of the rectifier to the - lead of the relay.

Cut the wire attaching the other speaker and strip the ends back. These will be your AC leads for the second rectifier. Repeat the process, referring to my pictures. Wrap all leads in electrical tape to prevent short-circuits.

We will leave the arrays as-is for now and focus on replacing the potentiometer next. This will make things easier, as connecting the AC severely limits working space.

Step 5: Replace the Potentiometer

Since I had broken the dual 10k potentiometer w/switch that was originally included with the speakers, I was forced to replace it. My local RadioShack did not have any one part that would directly replace it, so I bought 2-10k audio potentiometers and used a switch I had left over from a computer power supply that I had cannibalized. These potentiometers (aka variable resistors) cost me $3/apiece.

The next thing to do is solder short wires to the holes where the leads of the old potentiometer used to be. This should take 8 wires.

Next, you should make any necessary modifications to the faceplate. I drilled two large holes and two small locating holes for the potentiometers, as well as cut out a hole for the new power switch.

Test fit the potentiometers, and cut the shaft to length using a small saw.

Now, making sure to keep the same orientation, solder the other ends of the wires to the new potentiometers.

Then, solder the two wires left over to the switch. You may have to put the switch wires through the switch's hole before soldering. Wrap the leads in electrical tape to prevent shorts.

After this, I plugged in the wall-wart transformer and powered up the circuit to test. The LED power indicator lit, so I plugged in a pair of headphones and listened for changes in sound when I turned the potentiometers. This is how I figured out which Potentiometer controlled left and which controlled right sound channels.

Step 6: Wire Up the AC and Relays

Now, after running the power cord through the back of the speaker case, wire up the wall-wart and the outlet in parallel, with the relays as switches. (If you need help, refer to the drawing.)

Solder the power cord and the additional wire stubs to the wall-wart transformer's plugs. You will need one short wire to go to the outlet, as seen in white, while the other side must go to both relays. I used a single wire and stripped some of the insulation from the middle and end of it to suit this purpose.

Now you are ready to solder your relays on. Connect the + to the Rectifier's positive and the - to the Rectifier's negative. Then solder the black wire from the power cord to one AC lead on each of the Relays. Then solder two short wires from the other AC lead on the Relays to each of the outlets, where the tab had been broken previously. Wrap all connections with electrical tape.

Here I will break down all the electrical connections required.
Right Speaker to AC legs of Rectifier R
Left Speaker to AC legs of Rectifier L
+ Rectifier R to + Relay R
- Rectifier R to - Relay R
+ Rectifier L to + Relay L
- Rectifier L to - Relay L
Power: 1 to Wall-wart, outlet side A
1 to Wall-wart, Relay L AC1, Relay R AC1
Relay L AC2 to Bottom outlet side B
Relay R AC2 to Top outlet side B

Step 7: Fit Everything Into the Case

This last step is easy--you've already done all the work! Just put everything into the case. I found it was easier to remove the speaker grill-outlet assembly and use the hole to push everything into place. I decided to use electrical tape to put the case back together, just in case I needed to take it apart again. After the case is back together with the speaker grill in place, attach the knobs.

Also, don't forget to run the wall-wart transformer's DC power to the circuit board. In my case this meant wrapping up the excess cord and running a short bit of it out the bass port in the back of the speaker housing to the original location of the power plug.

Step 8: Enjoy

Plug it in and try it out. Use the individual volume controls to adjust the thresholds on each channel independently. Play your favorite Christmas (or other) music and watch it flicker to the music.