How can you get a high output when an analog input is present?

Thread Starter

salvus

Joined Apr 2, 2020
49
Hi,

what type of circuit (or component) will output a high state whenever there is an analog input?

many thanks :)
 

Externet

Joined Nov 29, 2005
2,202
If you mean a 'signal present indicator' can be achieved in many ways. For an audio signal, can be a VOX circuit. For a voltage signal, can be a relay. For a radiofrequency signal, there will be some other circuit. And there is many details about them; as time delay to display the 'high' state; time remaining 'high' when signal fades; sensitivity at which it should trigger; hysteresis, latching...
 

Thread Starter

salvus

Joined Apr 2, 2020
49
output from a microphone is fed into an active band pass filter. If the microphone has detected a sound within the frequency range of the filter, it should turn on a motor. I was thinking to do this with a h-bridge. Seen as the signal is an analog signal, does the hbridge not expect a digital input?
 

crutschow

Joined Mar 14, 2008
34,285
You can rectify the signal from the filter.
Then have that DC level go to the plus input and a DC threshold voltage at the minus input of a comparator (e.g. LM339 or LM393).
This will give a digital high output signal when the rectified DC voltage exceeds the threshold voltage.
This high voltage can then drive a BJT or MOSFET to control the motor.
A bridge is only needed if you want to reverse the motor direction from some signal.

What is the level of the signal from the filter that you want to turn on the motor?
 

Thread Starter

salvus

Joined Apr 2, 2020
49
Many thanks. Do you mean with something like 4 diodes? With comparators, is It possible to supply 0v to the minus input so that anything above 0V would give a high output?

I will have to experiment to see what gain I will need from the filter as I am not yet sure what would work best for the application. I think the higher the pitch of the sound, the more it will attenuate and the more amplification it would require. I guess it would also depends on the distance of that sound source from the microphone.
 

crutschow

Joined Mar 14, 2008
34,285
Do you mean with something like 4 diodes?
No, just one diode to do half-wave rectification.
With comparators, is It possible to supply 0v to the minus input so that anything above 0V would give a high output?
Yes, but then it could trigger on circuit noise.
You want at least a small threshold voltage to minimize that, so you need to amplify the signal from the filter to generate at least a couple volts or so.
 

Thread Starter

salvus

Joined Apr 2, 2020
49
If you just did half-wave rectification would that not mean that some of the cycle would be below the reference voltage of the comparator?

I have just seen some small bridge rectifier ICs, if I went with one of those, would I even need the comparator? Could I not just feed the output of that straight into the motor control circuitry?

thanks again, really useful info
 

Reloadron

Joined Jan 15, 2015
7,501
Part of the problems you will face is that using a microphone or audio input to a comparator or any number of VOX designs is you can have an output go high when a threshold is crossed but the moment that audio goes away the output will go low. The output pulse will only remain high while the input is above a preset threshold level. There is a pause when we speak into a microphone. A good VOX or comparator circuit will have a delay before going low. Does what you have in mind need a slight delay?

The idea of using half wave rectification is to remove the negative going portion of the signal.

Much of this also depends on the motor you plan to drive, things like motor voltage and current. Need to know things like the project in some detail.

Ron
 

Thread Starter

salvus

Joined Apr 2, 2020
49
Ideally, I do want it to go off straight away without delay. The motor is just one of those coreless motors you find in a lot of toys. The power source will be something like a coin cell battery to give you an idea of scale.
 

Reloadron

Joined Jan 15, 2015
7,501
Well alrighty then. Consider using a comparator circuit as Crutschow mentions. Run your microphone audio through a small pre amp as suggested, half wave rectify it, and run that into a comparator. Let the comparator turn on/off a small switching transistor like a 2N2222 to drive a low current hobby motor.

Ron
 

Thread Starter

salvus

Joined Apr 2, 2020
49
I’m not understanding why a half wave rectifier would be appropriate. When the negative part of the cycle is turned into 0V, would that not put it under the reference of the comparator?

thanks for confirming
 

crutschow

Joined Mar 14, 2008
34,285
I’m not understanding why a half wave rectifier would be appropriate. When the negative part of the cycle is turned into 0V, would that not put it under the reference of the comparator?
You use a capacitor filter at the output of the diode to give a (varying) positive DC voltage from the rectified signal.
A resistor is added across the capacitor to discharge the capacitor when there is no signal.
 

crutschow

Joined Mar 14, 2008
34,285
I have just seen some small bridge rectifier ICs, if I went with one of those, would I even need the comparator? Could I not just feed the output of that straight into the motor control circuitry?
The output of a bridge rectifier cannot share a ground with the input signal.
That's why it's not appropriate for your needs.

You could possibly connect the output of a half-wave rectifier (with filter) to the motor control circuitry, depending upon what type of signal controls the motor.
 

Thread Starter

salvus

Joined Apr 2, 2020
49
Sorry, I think I see what you mean. Is it that the output of the microphone has some offset and is not oscilating around either side of 0V. The negative part of the cycle wasn’t really negative, so it would always be above the reference of the comparator (assuming that is quite close to 0V).
 

BobTPH

Joined Jun 5, 2013
8,813
No, that nothing to do with what he is saying.

Draw a full bridge rectifier circuit with one of the inputs at ground.

Now ground the negative output. Is that a circuit that would work?

Bob
 

Thread Starter

salvus

Joined Apr 2, 2020
49
Thanks. I mean for the half wave rectifier suggestion. I was wondering why the bit of the cycle that gets cut off wouldnt just be at 0V and therefore under the reference of the comparator. I had in mind that the wave from the microphone was oscillating around 0V. So when the negative part gets cut off it would be at 0V. If It is oscillating around say 2.5V(just made that up) and the bottom half gets cut off, that would make sense as the whole wave is still above the comparator’s reference. Is that what you mean? Or have I misunderstood?
 
Top