Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Gunshot Locator : opamp + electrect + mcu

Status
Not open for further replies.

kochevnik

Newbie level 4
Newbie level 4
Joined
Jan 17, 2013
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,407
OK - I've been working on this Gunshot Locator project for a couple of weeks - I'm a newbie at a lot of this stuff so be kind please

I started with Sparkfun Electret microphone BOBs :
https://www.sparkfun.com/products/9964

I built my own peak detectors, opamps, duplicated the BOB with a different opamp, used a picaxe, used a coridium mcu (which is pretty cool BTW - $10 for a 50 mhz ARM chip) :

https://www.coridiumcorp.com/prod-specs1.html

Even tested a bunch of designs with wav files of various gunshots. Also did a bunch of testing with a frequency generator & learned how to better use my scope. I have the math worked out so that if I could get a consistent readings I can do the location part - time delay of arrival (TDOA) is all worked out.

My main problem after all of this is that I cannot get two different electret mic designs + to give off signals CONSISTENTLY read the gunshot sound and also get consistently read by the microcontroller. Each electret + opamp gives off slightly different signals and when those signals are fed into a peak detector (diode + R + cap) the variance in those components mean that introduces more variance in the readings - and then the microcontrollers adc pins also dont always give totally consistent readings as well, altho this seems something that I could work with if I could get the rest of the circuitry sorted. There is a peak detector IC out there, a PKD01EP but it's not cheap and I'm not sure if it work for this app.

**broken link removed**

Some basic info - gunshots have basically two components, one a muzzle blast somewhere in the 75hz to 750hz range - this is what I want to get the peak for and there is also a shockwave at roughly 3 to 4 khz which I need to filter out.

The electret puts out a small waveform of about 20 to 200+ mvolts depending on the sound pressure level - the opamp seems to bias this to Vcc/2 which in my case is 3.3v / 2 - which when fed directly into an adc pin gives me readings which oscillate around 255 / 2 = 127 points. If I feed the signal into a hand built peak detector, I get rid of all the AC stuff and get a nice easily read DC signal to work with, it just isnt consistent, this may have to do with the logarithmic nature of sound, or just the variance in the R & cap values, or some other screwup on my part.

When the peak detector didnt work, I moved to the coridium chip with the idea that I could read the waveform directly. This actually works fairly well with a freq generator signal of about 1 khz. It take about 6 to 10 usecs for the coridium chip's adc to read a value and the wavelength at 1 khz is about 1 msec - so when I rectified the 1khz signal and tried to read the 1/4 part of the signal as it goes up to the peak, I actually got the correct readings almost all of the time - so this part works. At 10 usec per read, I would get 1000 / 4 / 10 = 25 reads on the 1/4 wave up of the rectified signal - going from 0 to 255 this can give some gaps, but the peak seems to always get within 1 or 2 points at the top - maybe because a nice neat sine wave is rounded/flattened at the top whereas the actual gunshot waveform would be much more jagged.

But when I run an actual gunshot waveform thru two different electret + opamp circuits into adc pins, and the variance is back.

So I am open to any ideas, suggestions, about what I should try next.

I know that if I can get consistent readings this will work, just how do I accomplish that.
 

As you yourself have stated, clearly the trouble lies in variances of different electret BOB's output vs spl.

However despite all the complex experiments you have done, you have not quantified the "..slightly different signals.."
How slight is it ?

One possible solution would be to calibrate your system for each sensor using a known signal input (your gunshot wav). This is a perfectly legit option, though it does add to the overall 'cost' of your end result.
 

Have you tried a bandpass filter as close to the mic as possible. I think this should have a pass band a bit smaller then the actual expected bandwidth of the shot. This is so the amplitude is due to the level of the shot signal and not on its bandwidth, which it could be at present.
Frank
 

I am a bit surprised that you used a voltage difference for location detection. i would have use a time difference...........
 

I am a bit surprised that you used a voltage difference for location detection. i would have use a time difference...........

Time difference requires a precise synch'ed clock for each detector... in itself quite a challenge if the detectors are widely spaced.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top