Introduction: Merry Lights || Making a Musical Light Show Using a Raspberry Pi 3 and Lightshowpi
So I decided to make a Christmas gift for someone this year. I decided to make a light show sequencer for them, as they love Christmas light shows. With the holidays past us, I decided to document this journey as it was a lot of fun, the project taught me some new things as well as pushed my knowledge on things already known.
This guide will cover the essentials needed to set up a light sequencer that has support for 8 channels. It can expand to 16 with a minimal adjustment that will be covered later in the guide.
It is easy to carry and transport!
- Tin snips
- Drill with various bits YMMV
- Phillips head screwdriver
- Flathead screwdriver
- Wire cutter/stripper
* Most of the parts were in my kit from previous bulk orders.
Here is a complete list of links to the parts needed for a from scratch build.
4 X 3/8 nuts and bolts short length
- Easiest at the hardware store near you.
CanaKit Raspberry Pi 3 Kit with Clear Case and 2.5A Power Supply
1/8-Inch Stereo Panel-Mount Phone Jack
- For audio output through the case.
SainSmart 5V 2A 8 Channel Solid State Relay Module High-Level Trigger https://www.amazon.com/SainSmart-Channel-Duemilano...
CanaKit 5V 2.5A Raspberry Pi 3 Power Supply
- This if for the relay, any 5v 2.5 or greater will work, I had this in the drawer.
Sabrent USB External Stereo Sound Adapter for Windows and Mac
- This is for the "USB audio in" feature of lightshowpi.
2.1x5.5mm Female and Male DC Jack Power Adapter Connector
- I cut the USB end off of the 5v PSU and used these as the connectors.
5mm Assorted Clear LED Light Emitting Diodes Electronic 1/4 W Resistors Pack of 80 (8 Colors )
- For external power indicator
Momentary SPST Square Push Button Switch (Red)
- For a safe turn off switch, I used an old radioshack switch, this one seems to be a match. Mine is normally Open and momentary
Uxcell a13031400ux0386 IEC 320 C14 Male Socket Panel Mount Power Line EMI Filter CW1D-10A-T
Tripp Lite Standard Computer Power Cord, 10A, 18AWG (NEMA 5-15P to Right Angle IEC-320-C13
DPST 125-Volt Round Rocker Switch
- This is for the mains power switch
Baomain 100 PCS Insulated Fork Spade Wire Connector Electrical Crimp Terminal 14-16AWG
Gardner Bender 25-AWC WireGard Screw-On Wire Connector Assortment, 22-10Wire Gauge (AWG), 600-1000V Max, 25 Resealable Pk., Blue, Grey, Orange, Red, & Yellow
Leviton 15 Amp Duplex Outlet, White (10-Pack)
4-Gang 68 cu. in. Old Work Box [qty. 2]
Leviton 88041 4-Gang Duplex Device Receptacle Wallplate [qty. 2]
Gardner Bender 16 AWG 25 ft. Primary Wire Spool, Black
Gardner Bender 16 AWG 25 ft. Primary Wire Spool, White
Cerrowire 25 ft. 14-Gauge Green Stranded THHN Wire
HDX 13 in. 34-Compartment Double Sided Small Parts Organizer
Cable Matters (Combo Pack) 200 Self-Locking 6+8+12-Inch Nylon Cable Ties in Black & White
SummitLink 415 Pcs Black Assorted Heat Shrink Tube 10 Sizes Tubing Wrap Sleeve Set Combo
Here we go.
Step 1: The Approach
I decided to make this a portable form factor.
With that in mind, let's look at the approach for this project.
Since this project is for a simple use for a homeowners small Christmas village, I wanted to design this to be as plug and play as possible, while retaining as much control as possible. Lastly, it needed the option to easily transport for use off-site or for storage.
The overall form we will make will entail the following steps:
- Bolting the gang boxes to one of the toolbox lids to make outlet banks.
- Drilling routing holes for cables
- Routing cables
- Making connections
- Test Connections
- Programming the Pi
- Setup samba share for lightshowpi music directory.
- Setup a safe shutdown switch
- Installing / Configure lightshowpi
- Enjoy the work.
Step 2: Hardware || Layout
In order to make this project manageable, I have decided to break things up into their respective groups. To begin we will start with the hardware side of things.
First Take the case and remove all of the dividing partitions.
- Use your tins snips, pliers, or whatever you feel will cleanly get rid off all of the orange partition holding posts.
- I used a pair of snips to cut the black wall sections away from the posts.
- I then used the pliers to twist or end down the freshly cut walls and posts, the result is the pieces detach from the case clean at the seems with no sharp edges.
Next, lay out where you would like your Pi and relay followed by addressing possible areas for one of the 2 dc power plugs we will be using.
- In the pictures above, you can see how I planned my layout.
- Once you have established a layout, you need to bolt everything together.
Once done, it is off to the next step start building the circuit.
Step 3: Hardware || IEC Connection
Now that the parts layout is complete we can start planning our electrics.
To simplify this guide a touch, I will post pictures of diagrams that can be referenced for the circuits we will be building. There will also be pictures of my build to help put things into perspective.
To start, begin wiring up the IEC socket: fig A
To add a mains switch, connect a DPDT rocker switch in between the line out of the IEC, the neutral out of the IEC and their respective wire nut junctions that will be created using the pinout of fig A.
- Coming off of the rocker switch connect a wire from the line output to a wire nut with three (3) lengthy travel wires of the same gauge and color. In this case, 16awg Black. The slack will be adjusted while the outlets get connected.
- Coming off of the rocker switch connect a wire from the neutral output to a wire nut with three (4) lengthy travel wires of the same gauge and color. In this case, 16awg White. The slack will be adjusted while the outlets get connected.
- Coming off of the IEC connect a wire from the earth ground output to a wire nut with three (2) lengthy travel wires of same gauge and color. In this case, 14awg Brown. The slack will be adjusted while the outlets get connected.
- Set a Multimeter to continuity and check all connections
- Verify all routes are intact and free of shorts.
Proceed to the next step.
Step 4: Hardware || Outlet Banks
Now that the IEC has been wired up, we now have mains power feeds to connect the outlet banks.
To begin this process: fig B
- Route 1 white and 1 brown wire from the wire nut unions created in the previous step to each bank.
- Route one black wire to the top compartment where the relay will go.
- In the outlet banks, follow the diagram fig B to ensure proper outlet connections.
- Leviton outlets use the following color scheme for their connection terminals.
- Silver terminal screws for neutral
- Brass terminal screws for line
- Green terminal screws for ground.
* In the diagram, brown represents earth ground as I wanted it to accurately reflect this build.
Connect black wires to each outlet and route the open end to your relays position. There will be 8 black wires going back to the relay in total.
**Make sure you label your outlets and line wires that will be connecting to the relay their appropriate channel designations.
In order to upgrade this unit to 16 channels simply apply the above steps following the adjustment made in diagram fig C.
Note: you will need a 16 channel relay or 2nd 8 channel boards to actually utilize all 16 connection points correctly.
Step 5: Hardware || Relay Power Connections
To wire the relay, start by taking the line wire that was previously routed there and connect it to either a wire nut junction or a buss bar.
Given the amount of small space, I chose 2 wire nut junctions. Each one has a mains line wire and 4 individual wires to connect to the line side of the relay.
You can follow your own instinct here, Just make sure you have the primary active line wires on the side of the channel with the resistor and the outputs that connect to each outlet to the side with the relay [black rectangle].
Also while here, connect the 5v 2.5 dc plug to one of the "line" and "neutral" pairs in the lower chamber of the case. Once complete patch the leads from the plug into the 5v + [VCC] and the 5v - [GND].
The images above will show you where the essential points of contact are on the relay board.
Step 6: Hardware || Relay Logic Connections
Now that the relay has been connected to the mains and the outlets.
It's time to connect the gpio header of the Pi to the inputs of channels 1-8 on the relay board
For the pinout flow, I will be using the physical header numbers of the Pi.
The pinout is as follows:
PI | Relay Board
Pin 11 <> CH 1
Pin 12 <> CH 2
Pin 13 <> CH 3
Pin 15 <> CH 4
Pin 16 <> CH 5
Pin 18 <> CH 6
Pin 22 <> CH 7
Pin 07 <> CH 8
Step 7: Software and Someware
This is where I will hand you off to the official sites to Raspberry Pi, for install instructions on Raspibian Jesse and Lightshowpi, for the install and configuration of the sequencer software.
If you do not have a functional install of Rasbian Jesse please visit:
If you do have a ready to go Pi, please visit my instructable on how to set up a Samba share
If you are starting from scratch, it would benefit you to come back and check out the Samba Share instructable. By doing this, you will be able to share your lightshowpi music folder on your network. That will enable you to save songs to your Pi over your network as if it were a local folder, this may come in handy for future projects as well.
To add a safe turn off switch, I followed this instructable from AndrewH7. Thank you, Andrew!
Safe turn off switch @AndrewH7
Here is the official Lightshowpi site, their walkthrough needs no paraphrase.
Control of the controller:
I use my Samsung Galaxy S7 Active and JuiceSSH to control the device for shows.
JuiceSSH is my big recommendation for mobile SSH.
I know this has been a long journey, however, it is a very rewarding one.
We have a be nice policy.
Please be positive and constructive.