Sound Sensitive LED's

Hey guys i was wondering if its possible make my LED’s (image below) on my board to flash according to any sound such as music. And maybe not just flash altogether but different LED’s to flash like a visualizer instead of all at once. So if anyone could help me code and tell me what i need to do it would be appreciated.

Also i’m not 100% sure which component i need to do this, i have two of these and i’m pretty sure its supposed to be these but if someone could confirm it would be very helpful.

Current Board:

Current Code, Audio sensors not implemented. It just uses the Potentiometer to control the blink speed of the LED’s.

int sensorPin = A5; // select the input pin for the potentiometer
int ledPins={ //Create array for Led pin values
7,8,9,10,11}; // select the pin for the LED
int sensorValue = 0; // variable to store the value coming from the sensor

void setup() {
// declare the ledPin as an OUTPUT:
for (int i=0; i < 5; i++) //For all LEDs in the array

pinMode(ledPins*, OUTPUT);*
}
void loop() {

  • // read the value from the sensor:*
  • sensorValue = analogRead(sensorPin);*
  • // turn the ledPin on*
  • for (int i=0; i < 5; i++)*
    _ digitalWrite(ledPins*, HIGH);_
    _
    // stop the program for milliseconds:_
    _
    delay(sensorValue);_
    _
    // turn the ledPin off:_
    _
    for (int i=0; i < 5; i++)_
    _ digitalWrite(ledPins, LOW);
    // stop the program for for milliseconds:
    delay(sensorValue);
    }[/quote]*_

I found this tutorial but its no working at all for me :frowning:

I don't see a mic & amplifier in your picture. How are you getting sound in?

Hi thanks for the reply but I haven’t added that component yet, i was wondering if the Piezo element is the correct component i should be using

Arsenal26:
I found this tutorial but its no working at all for me :frowning:
http://www.princetronics.com/sound-sensitive-lights-w-sound-sensor-arduino/

What we want to see is the photograph of your attempt at this circuit to see where you went wrong.

i was wondering if the Piezo element is the correct component i should be using

It can be used but you will need to add an amplifier to it.

just came across this.
this is is more or less what im after towards the end of the video where the LED's are reacting to the sound.

this is what mine looks like:

Well there is no amplifier so that is why it is not working. Also the microphone seems to be plugged straight into the analogue input which again is not the way it is done.

Why re-invent the wheel ? Try Googling "LED Color Organ" That's what they called it "back in the day..."

Or musicolour as I remember it from way back when also...... :slight_smile:

It looks like the anodes of your LEDs are not connected to anything.
Edit
On second look they do go to the 560s.

Hi, I'm not to sure but to answer the OP first post, I don't think that the black item is a microphone.
I think it is a beeper, piezo type.

Tom...... :slight_smile:
http://www.buzzer-speaker.com/manufacturer/piezo%20buzzer.htm

Top left of picture.