Main Site Documentation

Help with microphone


Hello everyone.
I bought this off ebay:

I want to detect spikes, someone knocking on the door.
I found it impossible to set the sensitivity.

I connected it to A2 and I read the values in a loop.
It jumps from almost zero to 1023 in a fraction of a turn.
And even when I manage to set it just right, I am missing some spikes.

Please advise, I’m new to this.
Is there a smarter way than polling the pin in a tight loop ?
Is this mic assembly faulty or just crappy, or am I missing something ?



Would a Piezo Vibration sensor have more steady result for a door knock?


I dont know, would it ?
How do I setup a vibration sensor ?


Can you measure voltage on mic out line? What is the highest?


Have not tried one yet. But looks pretty easy with an AN pin and 1Mohm resistor.


Measuring a voltage on a mic doesn’t say nothing about the sound. You need to sample a window and do some fft analysis on it. I might try this in RLP one of these days.


[quote]Measuring a voltage on a mic doesn’t say nothing about the sound.[/quote] ::slight_smile:

Baby steps.

@ SW I just wanted to make sure that your microphone output voltage is within acceptable range of the analog in pin. Couldn’t find that in the product description.


There is something I dont understand about all these samples.
Usually the pin is read in a loop with a 100ms delay.
Isn’t that too long ?
The knock duration is probably shorter and you can miss it,
am I wrong ?


Ok, after reading more about that product I see that it is not a microphone, but a sound detection module. It outputs square wave. Do you have an oscilloscope to check it?


Unfortunately, no.


@ Architect: did you find a datasheet?


No, but I have asked the seller on the eBay.


Seller doesn’t have any datasheet. He said that he might post some scope screenshots next week :o

I think you can use interrupt pin and measure the time between the edges. See what is typical time for the sound you are detecting (clap or knock). Use the pot to adjust sensitivity and you should be good.


That is one reason I will not buy misc parts off ebay anymore unless people like SF or pololu dont have and want to take a flyer. Can’t count on datasheets or any other support from most of these ebay sellers.




I agree, not to mention there are sooooo many counterfeit parts floating around that it is hard telling what you might actually get. A friend of mine uses a transistor on one of his commercial products that is only made by a single company. Last year every distributor ran out of them and had 2-3 month lead times. He bought a reel of (2000) from a broker in China.

When he got them and at them under a microscope and found that had been sanded down and remarked (the date code was bogus). Think about it, this is for a transistor which cost 25 cents in low quantities. They de-reeled some other transistor, sanded the markings off, and then stamped them all with a bogus part number and re-reeled them again. This is where a lot of the crap on Ebay comes from too.


Selling something without knowing what it does or how to use it. Great!

I might start selling air someday.


I dont know about air, but there are many that sold water, even city water in a bottle…


What is an interrupt pin, and how do you use it ?


Take a look here: