Electret Microphone with Arduino

I had posted on this same issue on the old forum, but never followed up to it because I got caught up with another project. Now I am back with this project and will follow up this time.

Old Post: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1294526279

I still have found no success using the Sparkfun Electret Microphone Board which can be found here: SparkFun Electret Microphone Breakout - BOB-12758 - SparkFun Electronics

And again, my whole objective is to be able to distinguish between gun shots and regular talking. Right now, I have tried the code that was posted on the old forum but found no success as well.

Also to note, I added a capacitor, diode, and resistor (suggestion from the old post) to make the circuit similar to the one found here: Microphone \ Learning \ Wiring

Any help will be much appreciated and will get a response very quickly!

I've never used the sensor you're working with, but I have used this Parallax sensor;
http://www.parallax.com/Store/Sensors/PressureFlexRPM/tabid/177/CategoryID/52/List/0/SortField/0/Level/a/ProductID/614/Default.aspx
It comes with a 1K pot for changing the sensitivity of the mic. From the linked page you can get the schematic and see if you can hack the PCB to put a pot on it and adjust the sensitivity, then make a gun shot pin high and everything else isn't even noticed.

Do you know the mic actually works?
Go here, download Visual Analyzer, and see if you can see any output from the mic into your soundcard mic input.

Yes the mic works... Also, because of the time constraint, purchasing any extra sensors will take too long so it is most likely not possible.

However, if I cannot find any other solutions with the mic I have by Monday, I will definitely buy the Parallax Sensor.

Visual Analyser is a free download, just need a 1/8" stereo plug to plug into your PC, use that to view the audio out & see if the big bumps from loud noises are coming thru as intended.
Take a look at the signal you are measuring - is your amplification too much so that your output is cilpping at 5V and staying there, thus leading to your 1023 reading?

I was comparing the sensor you have to the one I've used... mine is a go/no go sensor and it looks like yours collects sound and amplifies it. So I was comparing the schematics and saying I think you can use a pot to change the sensitivity of your sensor and make everything below the sensor ignored and then make gun shots read pin high and do whatever you want the arduino to do.

So from the 5 minutes I breezed the opamp datasheet, I think you'd do it where the arrowed circle is in the top schematic.

Does that say NE555D? I think what you have there is a mic with a little gain turning on transistor Q1 to give a little more gain and trigger a 1-shot.
The top circuit is straight inverting op amp circuit with the gain set by the 1M resistor R5 and the 10K resistor R4.
R2 & R3 offset the output to sit at 2.5V.
So, I think this has a gain of ~100, so anything above 0.025V input will make the signal clip at either 0 or 5V.
That's why I think the output should be looked at with a 'scope to confirm.

Yes, mine is a 555.

His mic should probably get tested... I was just suggesting that he play with the gain to make normal talking look like the noise floor and then a gun shot spikes at 5V, marking pin high and he can use that in his code to make his arduino do whatever he wants to happen. Maybe I'm not explaining this the way it makes sense in my head?

I don't think he can play with the gain, the sparkfun part is not used adjustable what I can see at their website.
This requires analog design skills that are beyond his capability, or soldering in new parts in place of surface mount parts on the back of the board.

CrossRoads:
...or soldering in new parts in place of surface mount parts on the back of the board.

That's what I mean, replace R5 with a 1M pot and play with the gain until the microphone only hears gun shots. Then gun shots are 5V, pin high and everything else is pin low. I'm not sure R5 alone would do it, but with a little playing with either R5 or R4 or maybe both R4 and R5 I think you could hack his sensor into a go/no go sensor and use it to respond to gun shots like I've used my sound impact sensor in a previous project.

The "hacking" of the board might seem out of my capability.
If there are no more solutions, did you find success in using the Parallax sensor with the Arduino?

Yes, the Parallax sensor worked great. You just use the pot to set the threshold for how loud you want the sound to trigger it to be and plug & play. It listens to everything and either sends signal low or signal high to the out pin. The one you currently have listens to everything in the air, amplifies it and sends it out. So the Parallax one is more digital output, a low or a high... that's it. The SparkFun one is analog giving various readings.

So you could set it up to not notice background talking and then when it hears a gun shot it goes off. How close to the gun will the sensor be? Are you shooting .22s or 50 cals? You need a noticeable volume change to get a pin high.

The sound sensor will be worn by the shooter either on his belt or on an arm band. Any gun can be fired.
Yea I think I will order the Parallax sensor so everything will work.

Oh yeah, the Parallax sensor will definitely hear that.

Yea... I just ordered two of them.

Thanks for the advice! When I get them in my hand I might ask you for some help if needed, but it seems pretty straightforward.