Amil Mohanan’s Blog

*batteries not included 
« Back to blog

Audio Visualiser using Processing and an Arduino

This was the first project I made using my Arduino, I wanted to make something that created different colours using LEDs. This was the end result.

The setup is really simple, you need:

  1. 1x Arduino 
  2. 1 RGB LED or 1 each of Red, Green and Blue 
  3. 3x Resistors for the LEDs
  4. A microphone maybe required (it depends on the sound card)
  5. Wires 

The RGB Full Colour LED I’ve used came from Maplins. The Ghost head I used in the picture came from an Ikea Night Light that I took apart, its made from a white rubbery material which made it ideal for diffusing the light, also makes it look cute!

     
Click here to download:
Audio_Visualiser_using_Process.zip (620 KB)

Wire up the breadboard as shown in the picture, the Full colour LED shown in the picture could be substituted for three different coloured (Red, Green and Blue) LEDs as well. Connect the Arduino using the USB port to the computer and open Arduino_ColourVisualiser.pde in Arduino (make sure it is opened from the Arduino program rather than Processing) from the source code and compile and upload to the Arduino. Then, open Processing_ColourVisualiser.pde from the Processing Program and press Run. You may need to change the Serial port in line 54 in processing if your system uses a different port for the serial connection.

The LEDs are controlled by the Arduino, which receives the values for the PWM digital pins via serial from a program running in Processing. It’s important that the LEDs are connected to the PWM (Pulse Width Modulation) pins (11, 10 and 9 on the Duemilanove) from the Arduino in order to be able to vary the dimness using digital output.

The Processing program generates three random numbers between 0 and 255 using the beat detection from the Minim library and the Line In from the computer. It listens for Kick, Snare and Hat frequencies from the input, the numbers are then sent via serial using the USB connection. The Arduino program read the three numbers and uses them to set the pulse on the pins that power the three LEDs. If it worked properly, it should light up in different colours reacting to background noise (such as talking if there is a microphone attached) and any music that is being played on your computer.

Click here to download:
ColourVisualiser_SourceCode.zip (2 KB)

Loading mentions Retweet

Comments (2)

Feb 11, 2010
erik said...
well done sir
Apr 29, 2010
Michael said...
what do i change my serial port number to in the processing program?

Leave a comment...

 
Got an account with one of these? Login here, or just enter your comment below.
Posterous-login    twitter