Table of Contents

RGB Ledbar

Overview

The inspiration came from the 2014-2018 period when I was a part-time DJ at a club in my hometown. In addition to the DJ equipment, I also had a lighting setup consisting of several RGB LED bars that could be programmed and controlled using a DMX console to create a vibrant atmosphere at the party. Over time, I developed a true hobby for programming the LED bars, elements that are present at any show/party with at least 100 participants.

Objective

The purpose of this project is to simulate the behavior of a RGB LEDBAR. The user will be able to interact with the LED bar through a web interface that will change the lighting mode of the LEDs. The LEDs can be manually controlled (the final color will be set using sliders), automatically controlled using specific algorithms for coloring the LEDs, similar to those found in Christmas lights for example, or customized through a schedule created by the user (schedule will be uploaded in a Firebase Database). The automatic mode will provide 4 different lighting possibilities.

Hardware

Software and services

Architecture

Shortly, the architecture has the classic client-server structure, where http client is the user controlling the ledbar, through the web interface, and the esp32 + “firebase” is the server.

Application setup

How it works

Web interface design

Software implementation Overview

For starters I set up the environment similar to the demos found in labs 3 and 4. For the Web server part, I used the Async Web Server library and configured it similarly to the “SPIFFS Webserver” demo. In other words, the ESP32 web server displays the control page, and when the user interacts with the elements of the page the browser makes a request on a URL, ESP32 receives the request and parses it and, finally, it sends a PWM signal with the corresponding value to the GPIOs. It will also change some internal parameters. As I mentioned before the web page is stored in the internal memory.

After that I have configured the Firebase Database. I have assigned the API key and the RTDB URL and I have signed up on the firebase.

The main idea of the project is to switch between individual “states”. For example state 1 is for the manual mode, state 2 is for “auto mode - Christmas Mode” and so on. Inside the loop function is where the behavior is altered. For the manual and auto mode the behavior is modified 100% by the “internal code” I have implemented. For the custom mode the ESP32 interrogates the Firebase DB to see if there is any schedule to download. If there is none, the ESP32 will wait until the DB updates or the user changes the lighting mode. If there is any content in the DB, the ESP32 will download the schedule and save it in a local file. Once the download is complete the ESP32 waits for the user to actually trigger the schedule.

Project real-life view

Challenges and things to improve

Conclusions

In this project I've managed to implement a small RGB Ledbar with functionalities similar to those available on the market. It is an entertaining tool and a very good initial prototype for light show enthusiasts. Certain refinements and tests need to be done to make the user experience as enjoyable as possible. Overall, I consider the project to be a success. :-)

References