This turned out to be a long read... i would appreciate if someone made it through this wall of text.
This is the first circuit i ever designed on my own, from the ground up and that i am a bit proud of.
Edit...
I found a picture of what it looks like when you take a breadboard to the gun range:
And how the last iteration looked like that i used to test the circuit:
Hello!
I am a avid shooter and like to compete in matches, one particular class requires to measure the time between shots.
This is done with a microphone based "stop watch", here are a few common devices that can be seen in the field:
https://www.ipsc.org/store/storeel.htmSwitches, transducers, sensors on the targets are *not* and option, you have to use a microphone.
The dynamic range is allways a problem with these things, they need to work with annything from a rimfire rifle (fairly quiet, relatively spoken) to a magnum Revolver (mighty boom, really loud).
Since i like to twiddle with electronics and the cheap common ones (perticuarly the smartphone apps) have problems with sensitivity i decidet to build my own.
The only important part about this is, how the impulse of the shot is registered.
I wanted a pure "analog" solution for a few reasons, so i can only use a edge triggered interrupt on the logic side.
After *A LOT* of trial and error, reading, research, scientific/forensic papers and measuring with scope and microphone my first solution looked like this:
PCB:
Schematic:
Component values were chosen by wich parts i had, trial and error and my calculator.
The sensitivity is only changed by a trimpot and the trigger level of the comparator was adjusted by a smoothed PWM signal.
The first design had a DAC for that but a PWM signal worked just fine, one part less to populate.
After the first range visit i was a bit bummed, it dit not work like it should, i had intermitten problems with the dynamic range and echo.
I dit some more soldering, changed component values and went back to the range.
It worked fine with the big guns now, but the small ones... not so much.
So i wanted something with the possibility of "auto tuning", no extra "knobs" to change the settings and i dit not want to etch another board.
So i botched in a digital potentiometer:
Botched Board:
Modified circuit:
This thig works extremely well, i have only run it though 500 shots of various calibers but it registered every last one without a hitch and under various enviromental conditions.
The R-C on the input of the amplifier serves as a high pass filter, the amplification is trimmed by one channel of the digital pot.
Then comes a half wave rectifier and envelope generator, the decay of the envelope gen is determined by another channel of the digital pot.
Third is a buffer stage, why not, i had one channel on the quad op amp to spare.
Lastly the comparator with adjustable trigger point and hysteresis by the two remaining channels of the digital pot.
The OpAmp is a LMV324 from TI, a normal LM324 dit not work very well with a 3.3V supply. With the LMV324 it works just fine with annything from 3 to 5.5V.
The digital pot is a MCP4461 from Microchip, it was the only one available on short notice at the time.
So... how dit i do?
Sadly i do not have screenshots from the scope to show the impulse response and the delay between stages. But they do look pretty and do not introduce a delay that is of concern.
Greerings,
Peter