For the Professional Maker: Building a Sound-Reactive Stack Light Poses a Few Challenges
November 08, 2018
This stack light is made with six polycarbonate disks surrounding RGBW LED strips. It?s powered by an Arduino Nano, and receives input from an electret microphone, as well as four DIP switches.
Like some of those reading this article, I work from home. Two young kids also live here, which means that concentration can sometimes be elusive. While a heavier door or other home modifications would be the obvious solution, the idea occurred to me that I could make a light to tell them when they are being too loud. After all, you can tell someone to “be quiet,” but how is that even defined? As an engineer, I set out to produce a measurable “loudness” standard in the form of a stack light.
Physically, this device is made with six polycarbonate disks surrounding RGBW LED strips. It’s powered by an Arduino Nano, and receives input from an electret microphone, as well as four DIP switches that can be used to set the lighting mode. When it senses noise, the lights activate from the bottom to top in green to red, acting like a VU meter, and when it gets too loud, it flashes blue and red to indicate this condition. After hooking up an early version of the device seen below (sans capacitor) everything seemed to work correctly.
Grounding Issue... Not so Fast
After installation, however, I found that it only worked as I intended intermittently. Curiously, it seemed to work best when the Mini USB programming cable was hooked up along with the “lipstick” USB battery that was meant to be its primary power source. After a few suggestions and realizing that my LED strips were resting on a metal battery cylinder, I suspected that there was a grounding issue. Since I hadn’t thoroughly tested things before placing them in my fixture, I had to take everything apart, and made several attempts at a fix.
I changed the way the lights were controlled from 2 separate strips to (as far as the Arduino knew) one long strip of 12 LEDs to no avail, and even created a 3D-printed sheath that went around the battery pack to isolate the LEDs. Finally, after nothing I tried seemed to help, I tried putting a small capacitor between the power input leads of my microphone breakout. To my pleasant surprise, this worked. While before it would measure the sound level correctly, then not recede to a zero level after spiking, it could now measure sound and return as needed. Perhaps the lesson here is that if you have sensitive electronics that are dependent on a consistent voltage level, make sure your power input is clean!
Of course, it’s entirely possible there could have been a grounding issue as well, and the plastic sheath was an improvement. Perhaps the other lesson here is that when throwing potential solutions at a problem, prioritize things that you’ll be proud of later!
Get Expert Opinions
After solving this rather exasperating issue, I had a device that works like a modified VU meter. I also added a routine that produces random colors on each of the lights, and another that pulses a white light on and off. Both produce a great-looking (in my humble opinion), if more passive, effect.
The big question then is, does the light work as originally intended? The answer, unfortunately, is a resounding “no.” My kids seem to see the light not so much as a deterrent, but as a challenge to see if they can get it to flash. While perhaps using a heavy-handed punishment regimen to enforce the device’s electronic verdict would do the trick, that’s not something I’m realistically going to pursue. Someone else, a teacher, suggested that instead of lighting up, the device could feature lights that progressively count down when it’s too loud. I suspect this would have worked much better, perhaps with some sort of prize for staying nominally quiet. I suspect if I’d asked a few teachers—experts in dealing with kids—I would have produced a more effective design. By that point though, the device was more of a novelty inspired by this concept, rather than something I hoped to actually be effective.
The device was designed and cut out on my CNC router in layers after quite a bit of design work. Someone else suggested that a nearly identical method to make this would be by using the appropriate hole saws. While it wouldn’t have been quite as good, it would have been pretty close, and allowed me to get it done faster.
Finally, I didn’t have a good name for this device, and after observing it, my son called it the “Hello Light.” Descriptive, yet creative—perhaps I’ll have to get his input on naming future builds. Regardless of the trials involved in building it, I’m quite happy with how this light turned out. I’ve put code as well as an STL file for the battery sheath on GitHub if you’d like to build something similar. You can also see it in action in the video below:
Jeremy S. Cook is a freelance tech journalist and engineering consultant with over 10 years of factory automation experience. An avid maker and experimenter, you can see some his electromechanical exploits on the Jeremy S. Cook YouTube Channel!