July 17th, 2021—
While thinking of an interesting project to create, Hackster user marcaubin started to imagine an audio spectrum visualizer, but not a traditional one that has a matrix of LEDs with columns corresponding to certain frequencies. Instead, his device would have just a single vertical NeoPixel strip featuring 29 LEDs in total, with the bottom ones displaying the lower frequencies while the top pixels would indicate the higher frequencies.
He built a small box that houses a few components, including an Arduino Nano Every for taking in sound data and controlling the LED strip, a jack for plugging in a sound source, and a series of potentiometers for carefully adjusting certain variables. Two of those potentiometers can change the color range of the LEDs, as the possible range of colors get divided amongst the pixels in between the two ends. There is a way to change both the saturation and max brightness of the LEDs as well.
Marcaubin’s code continuously reads values coming in from the audio jack and performs a Fast-Fourier Transformation (FFT) on the data which causes the resulting frequency bands and their corresponding amplitudes to be outputted. From there, the values of the potentiometers are combined in certain ways to produce a very nice-looking array of colors along the LED strip. As a certain frequency gets louder, the LED within the column will get brighter, and vice-versa for quieter amplitudes.
You can read more about marcaubin’s project here.