Go Down

Topic: Sensor - no reaction when connected ... (Read 281 times) previous topic - next topic

perik

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

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(analog);
  Serial.print("  Digital: ");
  Serial.println(digital);
  delay(500);
}

AWOL

Code: [Select]
  delay(500);
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.

perik

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

shooter

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.

#4
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.

http://forum.arduino.cc/index.php?topic=290110.0


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.

perik

Thanks!

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

#6
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.
https://www.sparkfun.com/products/12642

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy