Audio Spectrum Analyzer

There is a great tutorial on how to setup and use a 2×16 LCD on the Arduino website:
http://arduino.cc/en/Tutorial/LiquidCrystal

Here’s a good explanation of FFT theory:
http://www.arduinoos.com/2010/10/fast-fourier-transform-fft/

My pinout is a little different because I wanted to save as many PWM pins to add servo control for the next stage of this project.  I’ve been tinkering with the idea of moving physical objects around based on audio input, instead of just showing levels on a display.

To visualize the frequency levels of the incoming audio signal I use the 8-bit Fast Fourier transform code which is discussed here:
http://forum.arduino.cc/index.php/topic,38153.0.html

Honestly, I’m not convinced that what I’m seeing on the display is an accurate representation of the audio spectrum that I’m listening to, but it looks pretty cool and that’s all I really care about at this point.  There is hardware available that would produce much more accurate results than this software.  There is a “Color Organ” project on the Make website that I’d like to build someday:
http://blog.makezine.com/2010/10/18/circuit-skills-led-color-organ-spon/

Additional Reading:
http://forum.arduino.cc/index.php?topic=38153.0
http://forum.arduino.cc/index.php?topic=182169.0

Code and libraries on GitHub

6 thoughts on “Audio Spectrum Analyzer

    1. varind Post author

      I am not using the msgeq7 ic. That chip would probably produce more accurate results, but for this project I use the fix_fft software library to analyze the frequencies.

      Yes, the audio input is connected to the analog inputs 4 and 5 of the Arduino.

      1. Sangs

        Can you please send me the detailed pin configuration as to which wire of lcd , 3.5 mm jack and the arduino pins I am supposed to connect…….?
        Guess I am going wrong understanding the program

        1. varind Post author

          I’m still a beginner too, and this project is a couple of years old, but I’ll do my best.

          First, the 3.5mm jack goes through a small circuit that I built, and is described in this post:
          http://www.variableindustries.com/audio-spectrum-analyser/

          That circuit connects to the arduino’s +5V, GRD, A4 and A5 pins. I think this keeps the input voltages in the range of -2.5V to +2.5V. Then in the code it is transformed into the equivalent of 0V to 5V (0-1024 values).

          You can alternatively use a microphone with a preamp (instead of a line out jack) like this one:
          https://www.adafruit.com/product/1063
          If you do get one this one it hooks up to +3.3V, GND, and any analog in. It works with 5V too, but using 3.3V works much better!

          The LCD can be hooked up using any 6 pins on the Arduino, then define which pins you use in the code. Look at the LCD tutorial:
          https://www.arduino.cc/en/Tutorial/HelloWorld

          I use pins 2,3,4,7,8,12 in my code so that the PWM pins are available for other uses. I spent some time experimenting with servos that responded to the frequencies.

Leave a Reply