Christmas Lights V1
Epic holiday lights display that is not only for me to control Controllable Strands: 8 Individual RGB LEDs: 120 Control: Mobile friendly web app w/ backend control box
First was to get some measurements to give me an idea of how long the strands needed to be to help determine bulb spacing, bulb sizing, and current draw. With the budget given, it limited me to good old filament bulbs for most of the project (I’m nostalgic to the warm color also). With all the data I ended up with longest runs being 50 bulbs of C7 lights. A bunch of various colors were purchased along with enough sockets and extension wire to get everything where it needed to be.
The control box was the next bit of business. I needed something and cheap and robust that was very easily web programmable. I eneded up with a Raspberry Pi Zero for the ease of use and very low cost. To control the strands the raspberry pi triggers 8 relays and one of the IO pins is used to control the addressable RGB LEDs.
It was originally planned to use the RPi as the webserver as well for the control page, but given the control box location I was not able to get quality internet to it. That forced me to host the webpage some other way, and develope some sort of backend protocol to do communication from main control server, RPi controller, and whoever is using the control app
This is where this project taught me the most. When I started this project I had no idea what is considered frontend, backend, server side, client side, and many many many other technology and web app related terms where. First and foremost was getting it working. A simple HTML page was created to give me the buttons I needed for control. Next was getting everything talking to eachother preferrably in a way with low data usage. I ended up using websockets for this iteration as it worked well, seemed over light, and had very good documentation for real time communication use.
The way it was structured was as follows:
- The RPi had a websocket client that interpretted the messages and from the main control app
- A self hosted instance of the main control app created in Python.
- This acted as a master control for timed events (auto turn on/shut off lights).
- This also acted as a bit of a firewall as it was inbetween messages from the web app and what was sent to the RPi controller.
- This also acted as a server for the webpage.
- The page was setup with client side rendering as this was originally designed to run on the RPi
- The web page interpreted some config messages from the main control app to setup how many lights, status of all the lights, and also lock out if set to
This version of the lights was a huge success. I got nothing but positive feedback and comments. But I still want to implement more.
Next in version 2.0:
- Musical Sequences
- Streaming of Audio over the web