Sound-Reactive Circuit

I undertook this project of creating a sound-reactive circuit to add audio-responsive LEDs to my room. It allows me to play music out of the audio jack on my computer by boosting the small voltages high enough that my Arduino program in C can decode the signals. The circut also has audio passthrough, which allows me to both read the signals and play music at the same time.

breadboard_right.jpg

Design

This circuit started out on a breadboard, based on an excellent tutorial on Circuit Basics. The tutorial was on how to build an amplifier to connect to a small speaker, whereas I wanted to use it as an input to my Arduino, so I had to add a voltage divider that keeps the voltage within the ranges readable by an Arduino. A significant amount of the circuitry exists solely to reduce noise and feedback, making for a much clearer sound reading, since the length and placement of the wires can have significant impact on sound circuits.

There are 3 potentiometers which control volume, gain, and the level of bass boost, the latter of which being important because I wanted my LEDs to respond primarily to the bass of a song. This bass boost is accomplished by an RC filter that filters out most of the highs sounds in a song.

wump.gif

LED application

I learned how to control analog RGB LED strips, and using a separate circuit connected to an Arduino Mega, displayed the magnitude of the input voltage as the brightness of the RED color. It took many more calculations than I was expecting to extract the volume at a given moment, because the sound waves oscillate around a nonzero voltage. I kept a running average of the volume to slow down the display enough to represent the music. Additionally, I had to add a much longer running average to keep track of the “zero” voltage, around which the signal oscillated, because it was continually shifting.

Final+version.jpg

Full Integration

I integrated the sound detecting circuit with the LED driver circuit all in one board to make the connections more manageable, and replaced the Arduino Mega with a NodeMCU ESP8266 Microcontroller. The ESP is smaller, cheaper, and faster than the previous board, and it has wifi capabilities! Using those, I was able to make multiple Addressable LED Displays react to sound wirelessly in my room.

Additionally, I removed the bass boost potentiometer and hard-wired it with a normal resistor because I found a specific bass boost level that I found prefereable.

Final thoughts

This was a really fun project that taught me a lot about programming microcontrollers and troubleshooting circuits. Currently, I have no plans to continue this project because I discovered that the Teensy series of microcontrollers have the ability to read USB audio. That’s amazing because you don’t even need a full circuit to make sound-reactive projects! Rather than convert digital sound to analog then back to digital again (like my circuit), Teensy microcontrollers can just read the digital audio in full resolution, with built in support for audio analysis.

It’s kind of unfortunate that I recorded most of the led response with copyrighted audio, which means I can’t play it, but I have added a short clip of my Dad playing piano connected to it to the right —>

Previous
Previous

Sketchify