I got a sound sensor on Ebay some days ago, and decided to give it a try!
Really simple, just made a code to light up the led when the volume was higher than the ambient sound.
Just for fun! 😉
As many people have asked, here goes the code:
Remember that there are many other ways of doing this, for example using the PWM function along with analogRead() and map().
Hey mate,
great stuff! I got same sensor from eBay. Care to share the code for this lttle project?
Thanks!
Hi Daniel!! I really like this experiment you did. I think that it would be useful for a DiskJoker, making a tool display panel with visual effects.
Which is the name of this sensor? What version of arduino are you using?
Hi Danite !
I’m come from china and stuy in Kroean university . …
I really like this project which you did. I want to know what version of arduino are you using ?
could you send the arduino code to me …and show me your step clearly… I want to make it like you did .
please….. I really want ….
Hi Daniel
I really love this project and i would like to try it myself it would really help me out significantly if you can share your code with me and maybe show me on a step by step basis how you executed this project. Thanks for showing this wonderful project and if you can help it will be much appreciated thanks so much
Hi,
I’m interested in the code too, so please post!
Thanks
Oliver
I don’t have the code anymore, but it was something like this!
You analyze the Analog reading then, if the sound is louder then some value, it
turns the LED ON, otherwise OFF.
Got it? Anything just say! 🙂
Hi,
Great project. I am looking for a sensor for a similar project and wonder if you could tell me what you used.
Thanks
Ola daniel, eu acabei de receber este sensor, e minha ideia e ativar um servo com o som.
Se eu usa seu codigo ao inves do led , daria certo com o servo?
valeu.
see ya
Com certeza!
Só terá que interpretar melhor o código ou montar um algorÃtmo para ler o sensor e alterar o motor.
Abraço
Ola, onde encontro este sensor para comprar e qual o preco ?
Hi. This is a cool project.
Can this sensor recognize specific sound? to recognize flap for example?
Thanks
Hey man, the sensor get sound volume, but you can work with FFT I guess, I’ve never done it,
Here are some links:
http://www.convict.lu/Jeunes/Spielberg/Spielberg.htm
http://en.wikipedia.org/wiki/Fast_Fourier_transform
http://arduino.cc/blog/category/fft/
Hi, I’m interesed in the code too, please if you can post it, thanks …César
Just posted the code 🙂
Hey man thank you soooooo much im soooo freakin glad i found this video you posted and the code!!! ahhh saved my art project. Would you know by any chance how to tweak this code to emit a brighter LED with louder sound and dimmer LED with lower sound?
You can use the PWM function for that.
Hi can you please tell more about the circuit please? thanks about the code
HI Daniel, may i ask what’s the name of the sensor and the USB LED light? i searched on ebay, didn’t find any similar thing 🙁
When I plug my sound sensor into the 5v pin on my arduino board the board stops working… Pi thought the USB connection would still power it? Any help please?
Sorted that problem out now but my sound sensor will only read a value of 1023 even if there is total silence. Any help please?? Thank you.
same to me… =(
You need to turn the small screw on the sensor board to calibrate it
Hi there,
Thanks for the code.
It took some puzzling before i found out that the DigitalWrite(Led,High) actually turns of the led when i use my sound sensor. When the high and low were changed it worked as a charm.
Thanks, Richard
This is for the arduino Mega only
This was made for sound reaction however it’s not perfect although better than the ops code
I use this to control a led strip using a low signal amplifier using tip-31 transister to control all three channels R,G,B to glow white although the color would need adjusting.
_______________________________________________
const int CPin = 2; //MEGA PIN 21 (INTERRUPT PIN 2)
int outputValue = 0;
void setup()
{
Serial.begin(9600);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
attachInterrupt(CPin, new_data, FALLING);
}
void loop()
{
}
void new_data()
{
pnter(map(analogRead(CPin), 0, 760, 0, 255));
//Serial.println(“Sig-DN: ” + String(outputValue));
}
void pnter(int val)
{
for(int i=50;i>0;i-= val / 50)
{
analogWrite(8, i);
analogWrite(9, i);
analogWrite(10, i);
if(i<=5)
{
analogWrite(8, LOW);
analogWrite(9, LOW);
analogWrite(10, LOW);
}
}
}
Hi, Thanks for sharing the code!
I had one problem when trying it though, the led is always on and the analog values of the sensor is always 1023.
Any advices ?
You can try changing the value of the potentiometer!
Hey, my sensor always gives me 1023 as value, no matter what I do. Any ideas why?
quisiera saber si este micrófono me sirve paras utilizarlo para un sonometro el cual estoy realizando para un proyecto pero no encuentro como tal uno que se adapte a mi necesidad sera que me puede ayudar??
Could you share what sound detector you have used ? Thanks
It’s any sound sensor you can find on eBay. I don’t remember this specific one, as I did it long ago.
Hello Daniel,
This is my first time using an Arduino, so this was fantastic! Thank you! I bought a set of Keyes LED’s that I would like to hook up to my Arduino Micro to have the same effects as what you have done, but the Keyes LED’s have the ability to be green, red and blue. Is there a way to make it so that the type of sound activates a different color on the LED? I know you mentioned the PWM function in a previous comment for changing the brightness of the LED, would that work on this as well? Any help is appreciated! Thank you in advance!
hii
I am sahil
I have a doubt
how to connect sound sensor to the aurduino uno and led
plz tell me