Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Electronic Target Project

Status
Not open for further replies.

Spine

New Member
Hi,

I am trying to make an electronic target. The idea is to use the speed of sound and TDOA (time difference of arrival) using an array of microphones to determine the location of the impact on the target. To do this I am using an AVR and hardware interrupts. By using the AVR clock in us and timestamping the interrupts I can determine the difference in time it took for the sound wave to reach each microphone. I have already figured out the math and programming aspect of the project.

I am looking for some guidance on the circuitry portion.

Originally I used an electret mic -> LM386 -> LV op-amp as a comparitor to produce a 5v TTL signal going to an intterupt of the AVR. This worked but the problem was that the interrupt for each microphone was firing 100s or 1000s of times per impact and it was really messing up the time stamps because the processor was flooded with interrupts. Unfortunately I don't have access to a scope but I think the interrupt was catching the rising edge of each cycle of the waveform generated by the impact sound.

My next step was to add a latch after the comparitor and before the AVR but it appears now that the latch is not getting latched properly, maybe because the signal is too fast? or maybe because the circuit is a mess?

If anyone can recommend a schematic that I could use I would appreciate it. I think all I really need is to be able to detect the impact (loud noise) and then set a latch that can be read by the AVR.

I think my circuit is going wrong in a few places but I don't know that much to put all the puzzle pieces together.

1. On the output of the LM386, pin 5, what is the circuit I need to put between that and the LM339 comparitor?

2. Should I use some sort of a peak detector circuit to hold the output long enough for the latch to catch it?

3. Do I need an envelope detector circuit between the LM386 and LM339 to smooth out and convert the AC signal into a DC signal that the LM339 can process?

Any sample circuits or advice would be appreciated. I am starting to feel like this project has me beat :(
 
Block the interrupt after the first trigger and set a delay to reset it that is longer than an impact duration, the first peak is all you care about for an impact.
 
Update:

I built the attached circuit and connected it directly to my Arduino header (pins 2 and 3 for the interrupt) and pin 6 for the latch reset. The circuit was powered off the arduino 5v and gnd bus. (please excuse the poor drafting skills, this was my first attempt at EAGLE).

The circuit is basically an audio amp, peak detector and comparitor and finally a latch. The comparitor is an LM339 and each comparitor is biased using a single pot to set the trigger level. The LM339 is open collector and they recommend to use a pull up resistor when interfacing with other TTL circuits.

The problem is when I have only the top half of the circuit (1x LM386, 1x comparitor connected and 1x latch) connected, the circuit works fine.
When I add in the second circuit everything starts going wild. It seems that my latch becomes unstable and flickers on almost all outputs.

Does anyone have any suggestions?


**broken link removed**
 
Just ground the - input to the 386. It will take care of the rest. The signal will ride on a 3 volt level, but should still give you plenty of range.
 
Just ground the - input to the 386. It will take care of the rest. The signal will ride on a 3 volt level, but should still give you plenty of range.

Still doesn't fix the issue with the latches going crazy for some reason.
 
Hmm, Tell us a little more about how it is built. Breadboard or ??
You might also try a large cap (say 100Ufd.) from +5 to ground and a couple of small ceramics (.1 - .01 Ufd.) +5 to ground close to the latch and comparitor.
Can you take some voltage readings?
 
The non-inverting input (pin 3) of the LM386 has no visible dc bias supply. If there's no internal bias either (I'm not familiar with this chip) then this pin is floating and at the mercy of leakage currents and noise. IMHO pin 3 should be biassed just below the pin 2 voltage.

HTH,
Alec
 
Found the problem! Tying the inputs of my empty/unused comparator solved the trick!

Thanks to those who answered!
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top