Pages: [1]   Go Down
Author Topic: Electret Microphone with Arduino  (Read 1893 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Full Member
***
Karma: 1
Posts: 146
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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: http://www.sparkfun.com/products/9964

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: http://wiring.org.co/learning/basics/microphone.html

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

California
Offline Offline
Full Member
***
Karma: 0
Posts: 129
That's me, the boy with the broken halo.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 446
Posts: 23867
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
http://www.sillanumsoft.org/
« Last Edit: February 05, 2011, 08:02:18 pm by CrossRoads » Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

0
Offline Offline
Full Member
***
Karma: 1
Posts: 146
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 446
Posts: 23867
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

California
Offline Offline
Full Member
***
Karma: 0
Posts: 129
That's me, the boy with the broken halo.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 446
Posts: 23867
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

California
Offline Offline
Full Member
***
Karma: 0
Posts: 129
That's me, the boy with the broken halo.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 446
Posts: 23867
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

California
Offline Offline
Full Member
***
Karma: 0
Posts: 129
That's me, the boy with the broken halo.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

...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.
Logged

0
Offline Offline
Full Member
***
Karma: 1
Posts: 146
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

California
Offline Offline
Full Member
***
Karma: 0
Posts: 129
That's me, the boy with the broken halo.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Full Member
***
Karma: 1
Posts: 146
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

California
Offline Offline
Full Member
***
Karma: 0
Posts: 129
That's me, the boy with the broken halo.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Oh yeah, the Parallax sensor will definitely hear that.
Logged

0
Offline Offline
Full Member
***
Karma: 1
Posts: 146
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: