A couple of years ago at Lowes my wife and I were poking around at the Christmas stuff in September (Lowe’s really takes advantage of the Holiday season). One of the things they had was a Christmas light show setup for the house. Basically it was several preprogrammed lighting sequences and some outlets that you plugged your extension cords into. It ran about $200 or so. I forgot about it, but the idea interested me nonetheless. I’m not a big Christmas decorator, a few strands of lights across the front porch is about all I can stand to to in an afternoon, and I’m done for the season.
But – Recently I ran across this in my Facebook Raspberry Pi feed.
Talk about an interesting project! Finally something I could use the Pi for in the real world, besides playing music and old DOS games, which pretty much any computer will do. The hardest part is always loading the software and figuring it out. Most of the stuff I find has to be run from the command prompt, instead of clicked on like we are all used to these days. Thankfully the helpful people at LightshowPi have some step by step instructions, since I know very little Linux.
After the software was installed, I followed the steps to hook up some LEDs in a test circuit, before plugging in the relays. I had to order a $10 relay board from Amazon, with 8 channels. I fired up the test music and was relieved that all the LEDs lit up. Once my Relay board and electronics kit came in, I set to work plugging in the relays. At this point everything was getting really messy, little wires everywhere.
Unfortunately the relays are sort of wired backwards. In order for them to trip, they need to be shorted to ground, so the signal from the Pi has to trigger a transistor which shorts the relay to ground, so everything gets a lot more complex. In the end, however, I won’t need the separate LED Board, just the Pi interface and the transistor board. On the white board above, I have a separate 5v supply coming from a USB plug I modified a while back for another purpose.
The first thing I did was wired up the LEDs and used their included software to flash each light separately.
So, when I finally followed the directions and got 5 of the 8 relays working (I only had 5 of the pn2222 transistors in my little Pi kit), I plugged the Pi into my computer speakers and fired up one of their sample songs. The nice thing about this whole deal is you don’t have to program the lights. There are other programs out there where you basically have to play both an MP3 and a MIDI file together and the MIDI file triggers the lights.
On the version I’m using, the Pi acts like a spectrum analyzer – the old square box of bouncing light points you used to see on stereos in the 1980s. Each of the 8 channels responds to a certain set of frequencies in the music. So any old MP3 file will work with the system. I have found that some files are very quiet and dont trigger the LEDs. Changing the playback volume on the Pi doesn’t affect the LED response, HOWEVER – Audacity is a free program that you can load on the Pi to edit music, and you can use it to amplify or decrease the volume in your MP3 files, to get more or less response from the LEDs.
I made a second recording once the relays were active on five channels. These things get pretty loud, as the are NOT solid state. These are good old fashioned mechanical relays.
Once all the relays are working, I can start constructing a box to hold this stuff. I ordered 4 double outlets from Amazon (just like your home wall outlets with two plugs per receptacle, and will wire them so each of the outlets is a separate channel. The long blue board of screws on the right side of the relay board is for wall voltage (120-240v), and its separated from the rest of the system by optoisolators (basically a light and a light sensitive element inside those little black cubes next to the big blue clicking cubes).
I’ll have 8 channels of lights, and if I use LED Christmas lights, one string per channel, a single outlet will be more than enough to power the whole works. If it’s not, I’ll split it and run it to two different circuits. I don’t have my light strings yet so I’m not sure how much current they draw.
My biggest worry is moving all the wires from those breadboards over to permanently soldered boards. I know I’m going to screw something up, and I HATE desoldering stuff.
The funniest thing about this whole thing was my daughter was watching me sort resistors and I was trying to use the old engineer’s resistor memory aid: “Bad Boys Rape Our Young Girls But Violet Gives Willingly”. Which stands for colors and numbers:
Black=0 Brown=1 Red=2 Orange=3 Yellow=4 and so on.
So I’m counting off: “Bad Boys (1), Bad Boys Rape (2), Bad Boys Rape (12 x 100 = 1.2k Ohms) and she’s saying “What are you doing?”
So I explain about the colors and she says, “That’s just awful”. I told her the card chart was probably easier but I learned memory aid and it sticks with you, as terrible as it is. There is another memory aid, but I never knew it.
In other works for my non-nerd hiking pals, I’m editing my backpacking book. I sent my stuff off and got a publishers proof, and reading on paper is a lot different than reading online. I am changing a lot and adding stuff. Hopefully my take on “what not to do when you backpack” will be on Amazon and Kindle in a few months.