This was my display in 2018. I was quite happy with it — although there are lots of things I could do to improve. The main one being straighter lines on the roof, and preventing the wind from blowing the strings to the other side of the ridge! (see top right of roof).

One thing that isn’t obvious from the (poorly taken) photo above — these lights were interactive! People could come to my house, pull out their phone, connect to my lights, and then control the animation that was displaying on each, or turn them off completely! Not sure why anyone would want to do that, but they could.

Interactive Lights Proof of Concept!

In my 2018 display, I had 9 individual elements that could be controlled. Three differently coloured strings on the roof, 3 similarly coloured strings in the front garden bed, 2 icicles colours on the right fence, and 4 blossom trees (which were all connected, so they acted as 1 element). Visitors to my house were then directed to my online application (lukelights.app) in order to control the lights.

So without further ado, lets gets into the meat of how I achieved this!

Hardware

Lights

The lights that I use have just been bought from my local department and hardware stores — wherever I could find a “steal of a deal” in post-Christmas sales. I made sure to pick only lights that run at 31 V, so I didn’t have to worry about multiple power supplies (this year at least). On the roof, I have 4 sets of 100 LED strings for each colour, which means there are 12 sets of lights on the roof, arranged so that each new string starts where the previous ends, so they all look like one large string. The front garden is very similar, with only 2 sets of each colour wrapped around the garden beds. Each colour can be animated independently of the others, so for example, the roof could be all warm white, or all cool white, or all warm white and cool white, which actually looks a lot nicer than I was expecting. Each section of lights have 3 different strings; warm white, cool white and multi-colour (the generic red/blue/green/orange design).

Raspberry Pi (RPi)

The most obvious solution for controlled lights is the use of a Raspberry Pi. I specifically used a RPi 2 B. A RPi makes sense because they’re very cost effective, and they’re essentially an entire computer, in a small affordable package.

DMX2–18

As well as the RPi, I had a DMX2–18 controller board, which would interpret DMX signals, and turn on/off power outputs appropriately. The good thing about this controller board is that it works with store bought, 2-wire fairy lights. In a sentence, this is important because the newer store bought lights that use only 2 power wires, switch the polarity of the voltage very quickly to turn on/off the 2 channels in the lights, making use of the polarized nature of LED’s. This controller board has been specifically developed to work with that polarity swapping.

Other

The other bits of hardware, aside from the lights, is a power supply with an output voltage that matches the required voltage of the LED strings, as well as a bunch of wires and terminals/connectors.

Software

JavaScript

JavaScript is what I do everyday, so finding a Node JS DMX library was the greatest thing that could have happened when I was initially scoping out how to take users’ commands and relay them to my lights.

Vue JS

The dashboard that is displayed on users phones when they navigate to lukelights.app is powered by Vue JS. As the dashboard is pretty simple, I didn’t have to reach for a JavaScript framework to create it, however it’s nice to play around with frameworks that I don’t usually use everyday :).

Node JS

The RPi has a small node script running on it that will handle the “default loop”, while also listening to Firebase for user commands. The default loop is simply looping through each animation that I’ve created, one by one, changing every 30 seconds. Every time the animation changes, the combination of lights that are playing the animation also changes.

Firebase

As well as running the default loop on the RPi, the Node JS script will listen for Firebase updates, which corresponds to user commands. When a user activates a button on the dashboard, Firebase receives that command and passes it on to all listeners, which in this case is just the RPi Node k script.

Using Firebase as a communication medium means that users are completely separated from my home network. Even with this round trip, the updates from a users phone running the dashboard through to the controller that interprets the commands is less than a second.

Control Flow

Only one person can control the lights at any one time. I made this decision as it means the person in control can see exactly when they change something, rather than having multiple people changing lights, and assuming that what they selected is why the house changed. In order to be fair to everyone, I had to also build a queuing system. The queue is pretty simple, people can control the lights for as long as they want until someone else comes along and wants to take control. Once that happens, the current person in control has another 60 seconds, because control switches to the new person. This will continue for however many people are in the queue, until it gets to the last person, who again has as long as they want. If at any point someone clicks on the I’m Finished button, control will either be passed to the next person in queue, or if there isn’t anyone queued, control will go back to the RPi, to continue playing the default loop from where it left off. Another use case is when people leave the house without specifically saying they’re finished. This means the house would continue to play the animation that the user had selected. I solved this by implementing a timer — as soon as 2 minutes has passed without a user command, control will revert to the RPi again.

Geofencing

In order to make sure only people who were in front of the house were the ones taking control, I implemented a basic GPS distance lookup. This means that users will need to grant the dashboard access to their location, and once they have, their distance to the house is calculated, and if it’s within 200m, then the Take Control button will be active for them. The reason I did this is to prevent people who can’t even see the house from “clogging up” the queue.

How it is all connected

The diagram to the left shows how all of the components are wired (both physically and virtually) together. To put it simply, Firebase hosting will serve up the Vue JS powered dashboard. Buttons on the dashboard will trigger Firebase cloud functions, which will run certain checks, and then update the Realtime Database. This update will be ‘heard’ by the Node JS script that is running on the RPi, and after being interpreted, sent to the DMX2–18 controller, which turns the lights on/off as required.

Where to from here?

2018 was just a taste of the interactivity that I’m going for. In 2019, the entire house is going to be controllable, and there will be more choices for how people want to be interactive. There will be the same dashboard that was available in 2018, but I will add different ‘modes’; select elements and play animation, select animations and trigger elements, and a transactional mode, where each element has an animation set, then the user sends all the different animations to each element at the same time with the press of a button.

Further to this, I will also be adding virtual instruments, e.g. a virtual keyboard. As well as a virtual keyboard, I’m going to connect a physical keyboard through a MIDI controller, so that people with musical talents can both play music, and have the lights on the house react to the keys, all in real time!

And sometime in the future, I would love to get crazy and add voice control and body control, whereby people can dance around at the front of the house, and the lights will react appropriately by using some body movement tracking.

Keeping in Touch

I would love if you could follow along with the progress of the interactive lighting display, which you can on the following social networks:

Facebook

Instagram

YouTube

Links to products I used

If you are interested in getting the same hardware that I used in order to get your lights interactive, check out the following links. Please note, some of these are affiliate links.

Raspberry Pi

DMX2–18

Mean Well RSP-200–27

7-core trailer wiring makes great extension cable for the lights. This allowed me to control 3 sets of lights from essentially 1 power cord.

Terminal blocks also make it very easy to extend wires to lights, without having to permanently solder or crimp the wires together.

Thank you for taking the time to read! If you have any questions, please feel free to post them in the comments below, ask me on Facebook, or send me an email at luke@lukelights.app