Disclosure: I have included some affiliate / referral links in this post. There’s no cost to you for accessing these links but I do indeed receive some incentive for it if you buy through them.
Let’s Cover Some Background Here
I have always enjoyed Christmas lights. For quite some time, I was very intrigued at the notion of putting the lights to music or at least making them dance in motion. About 3 years ago, my wife and I bought a string of lights that had a mind of their own. It was neat to watch it random go through the different patterns of blinking, dancing, and chasing. Last year was the year that we got the really neat ones. They were icicles that changed colors AND danced and chased and more.
All of this was great but I wanted more this year. I wanted to be able to set the lights to music just like the fancy light shows you go to see. I figured the easiest way to do this was to just simply buy something at the store, right? So that’s what we did. We ended up buying an Orchestra of Lights (sure a plug for them yaay). The concept is really cool. We bought the speak box that comes with 6 outlets that are all controlled by the wifi hub. We’ll just say that if you’d like to buy one of these, ask me about purchasing a barely used one for a deep discount.
As part of a little additional background, I’ve always wanted to get my hands on a Pi or Arduino but I could never justify buying one. I could never figure out what legitimate project to apply such an amazing device. Enter the friend….
The Friend Made Me Do It
This is what friends are for right? As we were stringing up all of the lights outside, a friend of ours stopped by who is also a geek. I explained what we were doing and he very promptly asked if I was using a Raspberry Pi to do all of it. As the gears began to turn in my head, I know my face gave it all away. We weren’t doing it at the time, but we would be in just about a week!
The Planning Phase
I’m an over planning and over thinker so I was looking everywhere for what I needed how I needed to do it and what I should do next. My end goal was to be able build a device I could put outside that would play music and control the lights automatically to whatever little tune was playing at the time. This turned out to be a little more difficult than I bargained for but not a big deal. I looked at a bunch of sites and decided that I should probably break this project down into parts.
- Build out the hardware
- Make it do “something”
- Look at how I could possibly get the music to control the action
During this planning phase, I happened upon a really great article that gave amazing details on hooking up the hardware. Unfortunately, the article no longer exists in the site where I found it. I mostly ignored everything but the pretty pictures. This site along with a bunch of other sites helped me put together my shopping list.
The Shopping List
Now remember that I said I had already ordered the Pi but let’s still list it here so that you know what I had coming:
- CanaKit Raspberry Pi 4 4GB Starter Kit – 4GB RAM
- REXQualis 120pcs Breadboard Jumper Wires 20cm Length Dupont Wire Kit 40pin Male to Female, 40pin Male to Male, 40pin Female to Female for Arduino/DIY/Raspberry Pi 2 3
- 8 Channel DC 5V Relay Module Board, (2PACK) Electrical Equipments 8-Ch Optocoupler fit Arduino PIC AVR DSP ARM MCU PLC Smart Home Control Switch
- Make sure you’re buying 14 Gauge wire since anything thicker doesn’t fit into the relays
- I bought stranded wire but solid might work just fine
- I bought this relay since it was 5V and didn’t require me to get an additional power supply just for the relay
- Yes, you could also go with a solid state one but I kinda like the clicking noises
- Eaton Type BR 125-Amp 6-Spaces 12-Circuit Main Lug Load Center
- 2-Gang Stainless Steel Metal Old Work Standard Square Wall Electrical Box * 2
- 2-Gang Square Metal Electrical Box Cover * 2
- Southwire 20-ft 14-AWG Stranded Red GPT Primary Wire
- Southwire 20-ft 14-AWG Stranded Black GPT Primary Wire
- White 15-Amp Duplex Outlet Residential * 4
- Since we’ll be breaking these outlets into singles, that will be one plug for each relay
- 1 Grounded wire/ext cord/surge protector
This would be the very the basic shopping list. I also bought some little connectors and such so that I could conduit all of the metal pieces together. I also bought some tiny screws and bushings so that I could install the Pi and relay into the breaker box.
Putting it all Together
I lined up the Pi and Relay and marked my holes. I drilled them out. I added my bushings. I mounted everything and was quite proud of it all. Next steps were to wire everything up. Ok why reinvent the wheel here. As I noted before, I basically did exactly what was done in Steps C – K in here. This was a really great write up on how to wire everything.
After everything was done I had me a nice little system. This would be a GREAT spot to add a picture but I already have it hooked up on the porch, plugged in, and nicely hidden away so the neighbors can’t see it. I’ll remember to take some pictures next time.
Next, I’ll go through the code that I put together to get the thing clicking like crazy!