I built a Slack status light because it looked awesome and simple, and at that time I knew nothing about DIY electronics. As I learned more, I outlined how to build a cheaper one on a Raspberry Pi. Then my friend then informed me that you can do it even cheaper with an ESP32 NodeMCU board. He was right. Here’s how I built a IoT busy light for around $5.
For this example, I opted for the older ESP8266 ESP12-E NodeMCU board, it is only $2.65 + 1.73 shipping and has everything needed. Pair that with a cheap RGB shared cathode LED $0.50-$2.00, and a few cents for resistors, for a grand total of around $5* in parts.
I won’t go into the details on the boards, but if unfamiliar it, the tl;dr is you write some C/Lua code using the Ardunio IDE, include WIFI for ESP8266 and Web Server libraries (here’s hello world example code and a great setup video) and add some handlers to toggle the GPIO pins on certain requests, then flash that code onto the board over USB. If never used before, I assure you it’s not as hard or complicated as it may sound or appear. When the board is plugged in, it fires up, the code executes, connecting to WIFI, and this tiny board becomes a server in your local network.
Here’s the wiring I did:
& here’s the code I flashed onto it (note you will need to add your WIFI credentials):
From there, I added a simple CURL request into my app that’s currently handling the updating of my other busy light based on a polling of Slack status.
I placed this downstairs in my kitchen as a sort of satellite Slack Busy Light, so my family could check in on my status while not in our upstairs hallway:
If you have a common anode RGB LED, be aware the mixing of colours (on startup and when ‘away’) probably won’t work out of the box. Mixing colours on a common anode RGB requires some sort of pulsing frequency – can probably Google for more info on this or a library. Also the script will need to be edited, changing LOWs to HIGHs and OUTPUTs to INPUTs, and vice versa. I’ve updated the script to use a library to get the mixed colours more accurate for both common anode and common cathode.
* despite this low cost, I personally didn’t want to wait for shipping overseas, so instead I went with a Canadian supplier and bought a pre-wired no soldering RGB LED for $3.95 and the board for $9.98 (on sale). There was a $12 shipping fee, but I order a lot from them so that cost is hardly noticed. Even so, that’s just $14 (+ $12 shipping). Amazon and many other stores also has low prices for these parts.