The idea

I had the idea quite a while ago, since I always loved projects where you could control somebody's X-mas lighting, a robot arm or generally anything over the web and watching it live on stream. But I was never really sure, if there's anyone else in the world who would dig it and I had no idea how to get requests from anyone on the internet to my Arduino.

Then one day - a few weeks ago - I told a friend what I had in mind and surprisingly he was immediately into it. He's a computer scientist and said he could program an api on node.js, which would run on a raspberry pi. The concept was born.

Diagram

I made a quick, professionell and definitely not shitty looking diagram to describe our basic setup:

Ok, it looks very crappy, but I think you get the gist.

To sum it up briefly:

We made a simple webpage, which uses ajax to send http POST requests to our api.

Control section below the live stream.

The api is a node application which runs on a Raspberry Pi with a fix and from the web available IP. It sends two bytes over a serial port to an Arduino Mega with a custom shield (Why mega? I had one laying around and its multiple serial ports come in very handy for debugging). The first byte we call: "status byte" the second one: "data byte" (in dependence on Midi).

The Mega then runs code which interprets the serial data and controls all the actuators plus LEDs (P9823 / WS2812).

Our x-mas tree with 55 individual controllable RGB LEDs

Wiring. I added 9 x 100 nF capacitors to each row later on.

We also implemented a little hidden switch behind the tree, which counts the laps of the train to display the covered distance on the website later on. Therefore the Arduino sends the current lap count back to the Pi via uart.

There's also one digital output pin from the Arduino connected to a digital input of the Pi, to tell it whether the Mega is ready to receive data or not.

LED dot matrix and TelegramBot

The LED dot matrix display is generally one completely separate system. It utilizes an Arduino MKR1000 for connecting to the internet, which acts as the Telegram bot (see Telegram bot api documentation and Telegram Bot library) and also gets other data from the web (eg. weather, time, ...). The Telegram bot enables people online to send text to the display or to send their current location to show local weather conditions. Why Telegram? - We didn't want to put a simple text input to the webpage, so we could keep away 'spam bots' and as many 'trolls' as possible. And also we simply like Telegram and wanted to try it. ;)

The MKR1000 then connects via uart to an Arduino Nano, which controls the dot matrix (md_parola library).

A few things..

The only things missing are: a power supply, some relays connected to mains voltage with four outlets and setting up the live stream.

Relay box. Definitely not save!

But it's fused. :D

Conclusion

I don't know whether I should have gone more into detail, but for now I think it's sufficient. If you want to know more about it, just leave a comment below. We've made some videos in the process, so if there's any interest we'd love to share them.

Speaking of sharing: We definitely want to share all our code, protocols and diagrams, but we hadn't the time to put them all together yet. We were kind of in a rush the last days building it (TIME MANAGEMENT!), so the code is ugly and incomprehensible. But since the project is quite limited to this time of the year, we wanted to post it as soon as possible. We're really ashamed of the dirty code, but we'll fix it soon and edit it in here. Till' then: We want to see Santa twerk.

I hope that we could bring some delight to you, your family and/or friends with our little project. It was a joy building and we're definitely not done yet. We had planed a lot more: more actuators, camera angles and statistics on the webpage. But we'll add them shortly.. so stay tuned. ;)

Connecting wires to Santas µC and power supply. Poor guy.

Frame for the dot matrix. I don't have a picture of the assembled display at hand right now.

Final setup with professionally taped chain of lights and love from some stranger of the internet.