3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.


LoL Shield Audio Spectrum VU Meter

LoL Shield Audio Spectrum VU Meter
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 http://andydoro.com/vulol/



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.)

 
Remove these adsRemove these ads by Signing Up
 

Step 1Assemble LoL Shield

assemble LoL Shield

Follow the instructions to assemble the LoL Shield here .

See, that didn't take long at all!
« Previous StepDownload PDFView All StepsNext Step »
48 comments
1-40 of 48next »
Apr 22, 2012. 7:56 AMDSPNRG says:
Averaging to reduce the FFT data is inefficient. It would be better to only do a 16-point FFT and ignore the two unwanted bands. This would save a lot of computational bandwidth. eg. multiplications would drop from about 150 per sample to 32 multiplies per sample and additions would be reduced similarly. If an FFT library hasn't already been created to allow the specification of the number of points for the FFT, I'm sure one will be soon - certainly before I have time to get to it.

In any event, I love this project. The next feature addition would be to add color gradations to reflect the sound level. Using RGB LED's would kill the Charlieplexing approach, but simply using different color LEDs would work: Green, Yellow, Red and Blue for the number of "overs". Hmmm, i think I just added a project to my list.
Mar 24, 2012. 10:29 PMrward2 says:
According to your tutorial you are just running the positive lead of the audio from a headphone jack into the analog input, But doesn't the signal need to be scaled to a DC range first? In other projects it's done with a pair of resisters and a capacitor. Is this not necessary?
Feb 20, 2012. 8:16 AMrootNull says:
Here is a thought. What if someone does not mount the LoL shield on the Arduino card, and being the fact that theres a lot of input and output Pins left unused, would it not be possible to connect a second LoL shield and instead of using the one mono audio input, use a stereo 3.5 mm jack to do a stereo vu meter (One LoL for the left channel and one for the right channel)? I understand that the code would have to be modified but would this be a possibility, or would one need two arduinos to achieve this?
Feb 20, 2012. 8:49 PMrootNull says:
That is good in itself, but I was wondering if the two LoLShields could be controlled with one Arduino. Use one input Pin for left channel and a different input pin for right channel. Use the other remaining Pins as output pins for the second LoL Shield and rewrite the code to perform double the work. Do you think thats possible?
Feb 24, 2012. 6:02 AMrootNull says:
Andy,

What are the two (red and black) wires connected to your LOL shield for (5V Power?)? In your video I noticed that USB is left connected. Does the USB cable need to be left connected at all times? I thought USB was only needed to upload the code to Arduino.

Also, once you upload a pde to Arduino, how to do you remove that pde from Arduino? For example if I upload codeA.pde to arduino and later decide I now want to upload codeB.pde, how would I do that? Would I need to remove codeA first and then upload codeB, or will codeB just simply overwrite codeA?

Thank you so much in advance.
Feb 28, 2012. 10:51 AMrootNull says:
Hi Andy,

My build is definitely not going smooth. Any help would be greatly appreciated.

The story so far: I ordered everything Diavolino, LoLShield etc. Once difference between your setup and mine is that instead of making my LoL shield, I ordered a pre-built LoL Shield from Olimex. So I built out the Diavolino, connected the LoL shield and run the basic test. All LEDs lit up sequentially in diagonal and horizontal fashion. Now I uploaded your code to the Diavolino and as soon as it finishes uploading, the LEDs start randomly glowing as if already connected to audio source. I connect the audio source to GND and A5 (Analog 5). Still the LEDs glow in the same pattern as without the audio source. So adding the audio source had absolutely no affect. I also tried GND and pin A4 and modified the code to use A4 instead of A5. Still nothing just random blinking LEDs no VU meter. Please help. I am at my wits end.

Thanks
rootNull
Mar 12, 2012. 9:52 PMrootNull says:
Andy,

what kind of values do you expect the variable "val" to get from the AUDIOPIN? In my case (I enabled serial monitor and wrote out the value of val) I am getting val in the range of 1016 to 1027. This is without connecting an audio source. Once I connect an audio source nothing changes. The board and LoL are perfectly okay as I have run all kinds of test including addressing each individual led one by one. Please help.

rootNull
Mar 6, 2012. 7:12 AMrootNull says:
Andy,

Please help. I want this to work so bad. I got a second Diavolino and a second LoL shield and still the same result.

rN
Feb 19, 2012. 12:09 PMrootNull says:
(removed by author or community request)
Feb 19, 2012. 10:10 PMrootNull says:
Thanks for the quick response. I am trying to add the FFT and ChaliePlexing libraries, but when I do the Sketch->Add Library option I do not see those two libraries listed. I have extracted your zip file to my desktop and I am opening the pde from the folder structure created by you. What am I doing wrong?

Thanks
Feb 20, 2012. 7:22 AMrootNull says:
I read about installing libraries and arduino.cc says that if the libraries are present inside a folder called "libraries" within your code folder, then the IDE would let you do an import. Is there more to installing libraries than that?

I am using IDE version 1 (I guess its the latest version since I only installed it day before yesterday). I have also tried a mac and a windows 7 pc.
Feb 20, 2012. 8:44 PMrootNull says:
Ok after much trouble I figured this out. Apparently things are done differently in Arduino 1.0. For the benefit of everyone, I am going to list the two options that one can use if they are having trouble compiling the code. If you are like me, and are having trouble compiling the code and are using Arduino version 1.0 (The latest version), choose one of the following options to fix compile errors.

Option 1: The Easy Option
Uninstall Arduino 1.0 and get Arduino 0023 instead. Everything should compile fine now.

Option 2: The long Route (Which I took)

A) On a Windows Machine:
Copy the folders named FFT and LoLShield from the libraries folder of the zip file and paste them in the following location:

Arduino_Install_location/arduino-1.0/libraries

eg. C:/Program Files/arduino-1.0/libraries

Now open fix_fft.cpp file using textpad
remove the line that says "#include "
replace it with #include "Arduino.h"
Apparently WProgram.h has been replaced by Arduino.h in version 1.0

Now navigate to "arduino-1.0\libraries\LoLShield"

Open each file in there with textpad and replace #include with #include "Arduino.h"

Now open the pde file in Arduino IDE and compile. It should compile fine. Also the pde file will be renamed ino, meaning the extension will change from pde to ino. Thats the other change with this version. PDE is no longer the standard extension.

Also while opening and saving the files with TextPad make sure the files extensions remain .h or .cpp as the case may be. Some text editors append a .txt and you do not want this. If your text editor does this, simply rename the file to the original extension.

On a Mac
Right click or CTRL Click on arduino.app. Select "Show Package Contents". Navigate to "/Applications/Arduino.app/Contents/Resources/Java/libraries". Copy the two folders (FFT & LoLShield) from the zip file under libraries to this location.

Open each file and change WProgram.h include value to Arduino.h in each file within these two folders. Save the files. Open Arduino IDE and open the pde file in the zip file. Click compile and now it should compile just fine.

Feb 2, 2012. 5:26 PMM3an1ng says:
where o nthe diavolino would i solder this, i want this to be used for an mp3 player one wire going to the speakers and one to lol shield.
Feb 2, 2012. 7:11 PMM3an1ng says:
thats the part i dont understand, where do the wires go on the diavolino? what i was going to do is use a headphone jack splitter and have one wire going from that to the speakers and the other to the diavolino i just am not sure where the wires go :/
Aug 25, 2011. 4:55 PMastroboy907 says:
I tried this with an arduino uno, and its not working as of yet. I have a couple questions..
1. What software version/platform are you doing this on?
2. How do I import the libraries into the code?
3. I seem to be getting some interference, it is flashing some signal when there is nothing connected. Is this due to led 13? It seems to be larger than that...
good project. Will be added to my desk soon hopefully :)
Aug 25, 2011. 8:20 PMastroboy907 says:
Never mind. I got it to work- turns of its sort of interference until you plug it in. Looks good. I set a delay(25); at the end of the code, which to me looks a little better. Ill send you a video clip of it if you want, or post a few more instructions on here if you want. Great, wonderful project :)
Oct 23, 2011. 4:08 PMlookwhatjoeysmaking says:
the code dosint work ive ben working on this for 2 days in my office and have only come out to eat. were it sas include is empty.and led sign has not ben declared. X( pleas respond within 2 days. becous then i wold have givin up.
Jul 8, 2011. 5:30 PMthoughtfix says:
Can you use this with a mic (and maybe an op amp) or is direct audio needed?
Jun 22, 2011. 2:25 PMjsan618 says:
Now I remember the scene... I feel like an Idiot.
Would the software be fast enough and selective enough to create a smaller panel?
The project never was built due to the cost of all the band pass filters.
Jun 21, 2011. 3:27 PMreginaron says:
Hi. Could it be possible to hook-up a normal electric guitar, w/ 1/4" jacks to this device? I want 1 , 14x9 LED board per string. Can it run 9 x14? Total 54x14. in 6 segments Frequency freak show lol.

Thanks for any Input / reply.
Jun 22, 2011. 11:00 AMreginaron says:
Hi Thanks for your input, Happy Summer.
Rj
Jun 19, 2011. 9:28 AMelabz says:
Solarbotics now makes an awesome SMD LED version of the LoL Shield - it's much smaller and all LEDs fit inside the outline of an Arduino board (except Nano of course). Here it is: http://solarbotics.com/products/39260/
Cheers!
Jun 20, 2011. 8:37 AMmycroft618 says:
Has anyone thought about a large panel color organ. Something along the lines of the movie Close Encounters?
Just a thought,
Jun 21, 2011. 3:31 PMreginaron says:
Hi. Good Idea.
Jun 22, 2011. 10:56 AMjsan618 says:
Not sure how to take your reply? Yes it means something. Your understanding of separating out the frequency bands for your metering, brought to mind the movie "Close Encounters of the third kind".
In the ending scene there is a large color organ type panel, each note played initially by the technician from ARP Instruments on a n ARP 2500, lit a lamp on the panel.
I had laid out the schematics using band pass filters back then to make a wall size panel. Sort of a home brew spectrum analyzer.
1-40 of 48next »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
41
Followers
2
Author:andydoro(http://andydoro.com/)
This space intentionally left blank.