Introduction: Arduino FFT Visualizer With Addressable LEDs
This tutorial will explain how to build an Audio Visualizer with an Arduino Uno and some addressable LEDs. This is a project I've been wanting to do for some time now because I'm a sucker for sound reactive lights. These lights use the FFT (Fast Fourier Transform) library to compute the frequency peaks heard by the built in mic and displays each frequency in a different color.
I had originally planned to include a button and some alternative modes for the display but I didn't get a chance to write the code for it. If you have some Arduino experience it shouldn't be too hard for you to modify my code to include other animations or even just different colors. Al you'll need to add is a button with a 330 ohm resistor.
Elegoo was very kind and sent me an Arduino basic starter kit for this project! You'll want to pick one up if you're new to Arduino or even if you just want some extra common parts: Use the affiliate links to support my content!
Here's everything else used:
1/8" Plywood - Local hardware store
Led Strip (5m 30 leds/m) - https://amzn.to/2AUpdbE
Acrylic Sheets - https://amzn.to/3fqMIrX
Mic - https://amzn.to/3fpT2jf
Wire - https://amzn.to/3fpT2jf
Wire stripper - https://amzn.to/3fpT2jf
Hot Glue Gun - https://amzn.to/3fpT2jf
Soldering Iron - https://amzn.to/3fpT2jf
3D Printer - https://amzn.to/3fpT2jf
Filament - https://amzn.to/3fpT2jf
Step 1: Cut the Base and Sand the Acrylic
Cut the wood into a 1' x 1' square (or match the size of your acrylic). This can be done with a circular saw or handsaw if you can keep the edges square, but it's easiest with a miter or table saw.
Sand both sides of the acrylic sheet with low grit sand paper to frost it. This can be done with a sander or by hand. Avoid high grit sand paper because you'll leave large gashes in the material that will ruin the finished look.
Step 2: Wire the LEDs and Mic
Cut your LED strip into 8 lengths of 8 LEDs. Stick them to the wooden base, evenly spaced and alternating directions. Be mindful of the arrows, these LED strips only work one way. Solder the three outputs of each strip to the three inputs of the next strip. Connect the inputs of the first strip to the arduino board, if you're using my code I used pin 2 for Data.
Before turning your soldering iron off be sure to test your connections with a FastLED example sketch. I like to use ColorPallets.
This is also a good time to connect the mic to the Arduino. Connect the power to the 3.3V output and data to A0. You can test this with the sketch from my GitHub page.
Step 3: Upload the Code
It's important to test the sketch with your final setup before you glue anything down permanently. If anything doesn't work it'll be easier to fix it now than later. The sketch I wrote can be found here:
Open it in the Arduino IDE and make sure all the values at the top next to #DEFINE statements match your setup. Once the sketch is uploaded and appears to work correctly you can move on to the final step.
Step 4: Final Assembly
3D print four 1" spacers to separate the acrylic from the LEDs. If you don't have a 3D printer you can use anything else to improvise these spacers. Cardboard or wood blocks would work just fine. Hot glue a spacer in each of the four corners and glue your Arduino and mic somewhere at the bottom so the Arduino can receive power and the mic can hear noise.
Optionally you can drill some holes in the back for easy wall mounting with a couple thumb tacks. Alternatively you can leave this as a desk ornament or command strip it to the wall.
Finally hot glue the acrylic to the spacers in each corner and let it dry. You now have a beautiful LED visualizer you can use to impress friends or entertain yourself!
Participated in the
Colors of the Rainbow Contest