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.

From another thread...audio pulse to square pulse

Status
Not open for further replies.

PhillDubya

New Member
From another thread....
Here
Thanks for the help AudioGuru.

Ok, I got the output I needed, actually I have the output I need two different ways, using two different circuits, and I am still trying to figure out which one to go with.

Either way, now that I have a way to activate a comparator, or 555 timer, I was wondering which way would be the best in order to get a square wave ttl pulse out, that can be read by a pic uController?

I was thinking I could use a 555 timer to produce 1 square wave TTL pulse (by using monostable mode) every time it was activated by a comparator from the audio signal. However, wouldn't I need to reset the 555 timer every time?

Any ideas as to the best way to get a square TTL pulse out, every time I picked up an audio pulse in, that would be suitable as an input into a PIC uController?

This is one circuit I am using: **broken link removed**

Or, I am just going to use an lm741 op amp, with a 2222a transistor pre-amp connected to the mic.

Either way gives me decent amplification, I am just trying to figure out the best way to generate a square wave pulse out, for every audio pulse that I receive in, to the circuits shown above.

Thanks for your time.:)
 
Are you detecting the sound from a beeper?
What is wrong with the output of the peak detector circuit? it should be able to be an input to the PIC if its voltage level is correct.
 
audioguru said:
Are you detecting the sound from a beeper?

Yes I am detecting the sound from a beeper, and the sound is roughly between 2 and 3Khz, and is about 3 to 5 inches from the mic.

What is wrong with the output of the peak detector circuit? it should be able to be an input to the PIC if its voltage level is correct.

Well, what I am seeing on the scope are sawtooths. I get large sawtooths out when no pulse is detected, and I get smaller ones, approx. 1/3 in amplitude, and probably 2-4 times the frequency when the pulse is detected --- basically the sawtooth wave shrinks and speeds up---if that makes any sense.

On the DMM, set to DC mode, I go from about 2volts out (no sound detected) to about 5v to as high as 7 or 8.5 out when the audio signal is detected.
 
The lousy old LM324 is too noisy (hissss) to be a mic preamp. Its gain is way too high in the circuit for the beeper to be only a few inches away. The output voltage of the peak detector is a few mV if the noise is less.


Decrease the value of R8 to 100k or less to reduce the gain. Then the noise from the first opamp will be reduced and the peak output voltage of the peak detector from noise will be much less.

The output from the peak detector might show oscillation of the circuit. Reducing the gain and adding a supply bypass capacitor (1000uF) will help but a series 1k resistor then a 47uF capacitor to ground that feeds R5 will reduce supply voltage fluctuations from being amplified by the preamp.

The output of the peak detector is a sawtooth that is at 37% of the peak voltage in 0.1M x 0.1uf= 10ms. Increase the vaue of C9 to a 1uF plastic film type for a slower 100ms waveform. Also increase the value of R14 for even slower.
 
Last edited:
Thanks for all of the help AudioGuru, the project turned out to be a great success. For the project, I ended up also interfacing a PIC 16F (BS2) to an MSP430f2012, to complete the project. The MSP430 handled all the analogue to digital processing, and the BS2, took care of the logical pulse counting and LCD displaying, it was quite a project for a total uC newb like myself, and the other guys working on it.:)
 
Status
Not open for further replies.

Latest threads

Back
Top