Building an Interactive LED Art Piece for JSConf EU
Tags: javascript, azure, serverless, iot
Published: 2019-05-10 18:02:30

---
title: Building an Interactive LED Art Piece for JSConf EU
published: true
description: Microsoft is sponsoring JSConf EU this year, and we're bringing an interactive LED art piece with us. Here's how we created it.
tags: javascript,azure,serverless,iot
series: Creating an Azure-Powered LED Art Piece
---

JSConf EU is arguably the most important JavaScript conference of the year. Many important technologies have been announced at JSConf EU, such as Node.js, and a wide array of developers come from all over the globe to attend. Microsoft is sponsoring the conference this year, and we're bringing something fun along: an LED powered art piece that you can control from the booth and with your own custom Serverless implementation!

This series of blog posts will dive into how we built this project.

I've been involved in LED art for a while now after I was inspired by my experiences with Burning Man and related events. I've been developing a [wireless lighting control system](https://github.com/nebrius/raver-lights/) for programmable LED art for a few years now, and it's pretty rock-solid at this point. This is the perfect system to base our booth code on. I took on the lead role for the project since I created the base infrastructure for it, and I'm fortunate to work with my amazing teammates [Jan Schenk](https://dev.to/jansche), [Tanya Janca](https://dev.to/shehackspurple), [Tierney Cyren](https://dev.to/bnb), and [Suz Hinton](https://dev.to/noopkat) to bring it to life. If you're curious what this system looks like, here's a tech demo:

{% youtube nYG6840g4mw %}

For JSConf EU, I designed an art piece loosely inspired by bamboo forests. This device will feature multiple LED "shoots" that are controlled from the cloud.

![LED piece CAD rendering](https://thepracticaldev.s3.amazonaws.com/i/333veu5w6ie9yjgmf1bh.png)

This piece uses custom hardware I originally designed for Burning Man based on the [ESP8266 12-S WiFi enabled microcontroller](https://en.wikipedia.org/wiki/ESP8266). These little boards control the lights themselves and connect to a Raspberry Pi over WiFi. The Raspberry Pi will connect to Azure using [Azure IoT Hub](https://docs.microsoft.com/en-us/azure/iot-edge/?WT.mc_id=devto-blog-brhugh), and from there we can hook into all sorts of cloud goodness!

The system is comprised of three sets of code: browser UI code, server code in the form of [Azure Functions](https://azure.microsoft.com/en-us/services/functions/?WT.mc_id=devto-blog-brhugh), and controller code running on the Raspberry Pi. Here is the complete architecture diagram (minus the ESP8266s  ):

![Architecture Diagram](https://thepracticaldev.s3.amazonaws.com/i/duro6k76csfhbvdbulkx.png)

The Browser UI code consists of two clients. The first client will be running on tablets at the booth, and will be running the new [Chromium-based version of Edge](https://www.microsoftedgeinsider.com/en-us/). This client will allow people to walk up to the booth and give them basic control over the animations. This interface will be intentionally limited though. For more advanced animations, we'll have another web UI that will allow people to submit custom animations, implementing using their own [Azure Function](https://azure.microsoft.com/en-us/services/functions/?WT.mc_id=devto-blog-brhugh), where they have full control over the animations.

The server code consists of four Azure Functions. One Azure Function will implement the endpoint for submitting basic animations, and another will implement the endpoint for submitting custom animations. Another Azure Function will be used to return the current queue of animations, so folks can see when their animation will run. The final Azure Function will run on a timer, and pulls the next animation off of the queue and sends it to the Raspberry Pi for display using [Azure IoT Hub](https://docs.microsoft.com/en-us/azure/iot-edge/?WT.mc_id=devto-blog-brhugh). The animation queue is implemented using [Azure Storage Queues](https://docs.microsoft.com/en-us/azure/storage/queues/storage-nodejs-how-to-use-queues?WT.mc_id=devto-blog-brhugh). Once nice side effect of using a queue for animations is that we don't need a database at all! This simplifies the code _and_ improves security and privacy of user data (there's nothing to leak if it doesn't exist).

The last piece is the controller code running on the Raspberry Pi. This code is the smallest piece of code, and mostly just glues IoT Hub to the [RVL-Node](https://github.com/nebrius/RVL-Node) package I wrote to communicate with the ESP8266s.

All of the code for this project is written using [TypeScript](https://www.typescriptlang.org/). The web UIs are written using [React.js](https://reactjs.org/) and [Redux](https://redux.js.org/) as well. The RVL-Node module is written with a combination of TypeScript for the Node.js side of things, and C++ via Web Assembly for the logic side of things.

All of these pieces together should create a fun, unique booth experience. I can't wait to show it to you all!