LoL Shield Audio Spectrum VU Meter





Introduction: LoL Shield Audio Spectrum VU Meter

Microcontroller Contest

Finalist in the
Microcontroller Contest

This is an audio spectrum VU meter using the LoL Shield for Arduino .

The LoL Shield is a 14 x 9 LED matrix which fits onto the Arduino as a shield and is controlled through an efficient method known as Charlieplexing . It was designed by Jimmie P. Rodgers .

This project uses a Fast Fourier Transform library for Arduino to analyze an audio signal, break it up into frequency bands, and display that information on the LoL Shield.

The Arduino microcontroller is fast enough to calculate a fast Fourier transformation. It lives up to its name and is surprisingly fast and accurate.

Since all the work is done by the microcontroller, this project is completely portable if you use batteries.

The webpage for this project is located at

Parts required:
  • LoL Shield
  • Arduino (Diavolino recommended)
  • audio jack (I used a male mono 1/8" phone plug)
  • Arduino code
  • power supply (DC power supply, USB cable, 9V battery, etc.)

Step 1: Assemble LoL Shield

Follow the instructions to assemble the LoL Shield here .

See, that didn't take long at all!

Step 2: Solder Wires to the Audio Jack

I am using a male mono 1/8" phone plug, as it's called at Radioshack, but you can use whatever audio cable is appropriate for your audio system setup. You could use a microphone if you wanted to.

For this type of plug, I soldered two wires. I used red and black.

The LoL Shield leaves analog pins 4 and 5 free for inputs. My code uses pin 5.

You can attach the red wire to analog pin 5 of the LoL Shield and the black wire to GND. You don't need to solder it in, I just put the wire through and bent it.

Step 3: Program Arduino

Now we need to program the Arduino to control the LoL Shield.

It is recommended to use the Diavolino to control the LoL Shield in order to prevent "ghosting" effects on the LEDs due to the green surface mount LED connected to pin 13 on the standard Arduino, but a standard Arduino will work fine.

This requires two Arduino libraries:
- the FFT library found on the Arduino forum
- the Charlieplexing library for the LoL Shield

Installing libraries for Arduino can be slightly daunting if you haven't done it before, but you'll do fine!

Follow the instructions on installing Arduino libraries here:

The FFT library breaks the audio signal in 64 frequency bands.
The LoL Shield is 14 x 9 LEDs. We average the 64 frequency bands together into 14 frequency bands. We're throwing away some data because 14 doesn't divide into 64 evenly, but whatevs.
The value of each frequency range is remapped from 0 to 9.

You can copy the Arduino code below, get the code from GitHub (recommended), or download the .ZIP file, which includes the libraries and Arduino code.

Here is the GitHub link:

Below is the Arduino code:

FFT for LoL Shield v0.9
by Andy Doro
based on FFT library and code from the Arduino forums and
the Charlieplexing library for the LoL Shield.
*/ #include
#define AUDIOPIN 5
char im[128], data[128];

char data_avgs[14];

int i=0,val;

void setup() {
LedSign::Init(); //Initilizes the LoL Shield

void loop() {

for (i=0; i < 128; i++){
val = analogRead(AUDIOPIN);
data[i] = val;
im[i] = 0;


for (i=0; i< 64;i++){
data[i] = sqrt(data[i] * data[i] + im[i] * im[i]); // this gets the absolute value of the values in the array, so we're only dealing with positive numbers

// average bars together
for (i=0; i<14; i++) {
data_avgs[i] = data[i*4] + data[i*4 + 1] + data[i*4 + 2] + data[i*4 + 3]; // average together
data_avgs[i] = map(data_avgs[i], 0, 30, 0, 9); // remap values for LoL

// set LoLShield

for (int x=0; x < 14; x++) {
for (int y=0; y < 9; y++) {
if (y < data_avgs[13-x]) { // 13-x reverses the bars so low to high frequences are represented from left to right.
LedSign::Set(x,y,1); // set the LED on
} else {
LedSign::Set(x,y,0); // set the LED off


Step 4: Enjoy!!

Plug the audio jack to your stereo, iPod, computer, etc.

Power the Arduino with a DC power supply, USB from your computer or batteries- this is completely portable. You could put it into a hat or belt buckle.

The white LEDs are so bright it's difficult to capture on video. It looks like there is purple flame coming off of them!

Sit back and enjoy!



    • Science of Cooking

      Science of Cooking
    • Trash to Treasure

      Trash to Treasure
    • Paper Contest 2018

      Paper Contest 2018

    We have a be nice policy.
    Please be positive and constructive.




    I have attempted the build of this code, and it is not working for me, with the same error messages as mentioned by others above.

    I think that the key questions to ask are:

    1) What version of the Arduino IDE was used to initially build and demonstrate the code? The fact that so many people are having problems suggest that some detail is missing from the instructions!

    2) I haven't bothered to post my code, as it is the same code as provided by the links above. As a side note - I do have my LoL shield working, and the Library for it is installed.

    What I suspect is happening here is that there is simply a version conflict for many people who are using different versions of the Arduino IDE to what the author used to demonstrate the project initially.

    May we have the IDE version of Arduino used to compile the demonstration unit please?

    Many thanks in advance and keep up the good work.



    Hello, i have this error:

    Arduino: 1.6.5 (Windows 8.1), Board: "Arduino Uno"

    In file included from LoLShield_FFT.ino:9:0:

    C:\Users\Uporabnik\Documents\Arduino\libraries\FFT/fix_fft.h:4:22: fatal error: WProgram.h: No such file or directory

    #include <WProgram.h>


    compilation terminated.

    Error compiling.

    This report would have more information with

    "Show verbose output during compilation"

    enabled in File > Preferences.


    hey, I'm using your code for a school project and it's not working for me. I'm using an electret microphone instead of the audio jack. This is the one I'm using.

    Hey, thanks for sharing! However, it seems like I'm not the only one getting this error and there doesn't seem to be a resolution online. I am quite used to adding new libraries and don't think I messed up here. I realize this was posted a while ago ... Appreciate your response!

    Arduino: 1.5.8 (Mac OS X), Board: "Arduino Yún"

    sketch_feb23a.ino:11:21: fatal error: fix_fft.h: No such file or directory


    hi! It seems like the fix_fft library isn't installed correctly. please follow instructions here.

    can you please provide the data sheet of the lol shield sir i could not order it

    It shows the following error when I try to compile:

    C:\Users\Lenovo\Documents\Arduino\libraries\LoLShield\Charliplexing.cpp:31:22: error: WProgram.h: No such file or directory

    C:\Users\Lenovo\Documents\Arduino\libraries\LoLShield\Charliplexing.cpp:48: error: 'boolean' does not name a type

    C:\Users\Lenovo\Documents\Arduino\libraries\LoLShield\Charliplexing.cpp: In function 'void LedSign::Flip(bool)':

    C:\Users\Lenovo\Documents\Arduino\libraries\LoLShield\Charliplexing.cpp:185: error: 'videoFlipPage' was not declared in this scope

    C:\Users\Lenovo\Documents\Arduino\libraries\LoLShield\Charliplexing.cpp:189: error: 'delay' was not declared in this scope

    C:\Users\Lenovo\Documents\Arduino\libraries\LoLShield\Charliplexing.cpp: In function 'void __vector_9()':

    C:\Users\Lenovo\Documents\Arduino\libraries\LoLShield\Charliplexing.cpp:290: error: 'videoFlipPage' was not declared in this scope

    When compiling I always get this error: "fix_fft" was not declared in this scope , can someone please tell me how to fix it?

    i have the same problem^^

    hi, i have one question: where do I buy a lol shield?