Go Down

Topic: Sensor - no reaction when connected ... (Read 1 time) previous topic - next topic


Mar 01, 2015, 02:16 pm Last Edit: Mar 01, 2015, 02:36 pm by perik

I just bought this cheap sound sensor - Keyes Microphone Sound Detection Sensor Module.

Im using the sketch below and have connected it to arduino as in the image:
A0 -> Analog 0
G -> GND
+ -> 5v
D0 -> Digital 3

but when im tapping on the mic nothing happens. Its all dead. I have been trying to trim the output using the potentiometer but when im tapping on the mic it seems to sense no audio. And theres no peaks in the print to serial with higher numbers.

Am i doing something the wrong way?

Code: [Select]
void setup() {
  Serial.begin(115200); // For debugging
  pinMode(3, INPUT);      // sets the digital pin 3 as input

void loop() {
  int analog = analogRead(A0); // Reads the value from the Analog PIN A0
  int digital = digitalRead(3); // Reads the value from the Digital PIN 3

  Serial.print("Analog: ");  
  Serial.print("  Digital: ");


Code: [Select]
I hope you're synchronising your taps.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.
I speak for myself, not Arduino.


Yes. theres no difference if I for example are blowing constantly wind into the mic.


so if the sound is above a setvalue (the potmeter) then the light is on
the sound is also put on the analog output.
sput it on a pwm output and remove all seral and delay.
now you will see a led flashing.
paul deelen
making controls with codesys PLC and arduino


Mar 03, 2015, 08:15 pm Last Edit: Mar 03, 2015, 08:16 pm by byleandroid
Did you try adjusting the sensitivity?   That looks a multi-turn pot, so you might have to screw it 10-15 turns clockwise or counterclockwise to get maximum sensitivity.

Your time delay of 500 ms may be too long...  I'd try taking the delay out completely.

Normal audio is an AC waveform with a frequency range of 20Hz to 20kHz, and if and depending on where you "read" along the waveform you can read anything between zero and the positive or negative peak.     You should get some higher readings with louder sounds, but you can also get smaller values or zero.   i.e a 100Hz signal passes-through zero 200 times per second and you are just as likely to read zero as you are to read the peak or anything in between.

It's also not clear how that module handles the negative half of the waveform.    The Arudino cannot accept negative voltages, so most Arduino microphone modules are biased to 2.5V.    That means silence reads about 512, and higher signal levels go above & below that bias.    If this module isn't biased, it may read (approximately) zero during the negative half of the waveform, which is half the time.


The sound sensor also has a digital output, but I don't have any idea how long that output is held high (or low), or it may not be held at all, and you may have to read the input in a very-fast loop to "catch" the trigger, or maybe you need to use an interrupt.



Is working now but not very good. Its very low output and not much of reaction. Need to find another way of detect sound ....


Mar 04, 2015, 07:08 pm Last Edit: Mar 04, 2015, 07:14 pm by byleandroid
Have you tried to rotate that little potentiometer, it may increase sensitivity...
Those potentiometers are a bit irregular because some times they react with very little rotation and some times they need about 7 turns haha
What about using calibration? (http://arduino.cc/en/pmwiki.php?n=Tutorial/Calibration)
Good luck!


This one works really well, it can output a digital signal or an analog one, you choose.

Go Up