Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting square wave voltages

Status
Not open for further replies.

Skorpios

Computer
May 15, 2003
1
I am trying to take a square wave with a low of 1.5 VDC and a high of 9 VDC and convert it to a wave from 0 to 12 VDC. Right now I am attempting to use 1/2 of an LM393 comparator. I have a reference voltage of 2.5 volts on the inverting input and my signal on non-inverting input. The comparator output never changes and I end up with a steady 12VDC on my output. I have tried switching the inputs and changing the reference voltage to no avail what are some other suggestions?
 
Replies continue below

Recommended for you

Where is your signal coming from? How do you know whether it can drive your comparator? Have you made measurements?

TTFN
 
You can use a 556 timer with 12V supply to do this - forget all the timing stuff it does, if you connect the trigger and threshold inputs of the first timer together the output will go low when the input goes above 8V and high when it goes below 4V. This will detect your 9V and 1.5V levels but of course the signal is inverted. Just connect the output of the first timer to the trigger and threshold of the second timer and its output will be in phase again and will swing between 0V and 12V.

This circuit can also be used to square-up a slowly rising/falling signal and to introduce hysteresis - hey! I've just invented a Schmitt trigger!

Use the CMOS 556 in order to save having to use decoupling capacitors on the Control Voltage pins and don't forget to connect both Reset pins to 12V

If you need a circuit diagram, I can do one for you (but not now - it's 1:00am UK time and I'm going to bed!)

Hope this is useful,
Dave

 
The suggestions for using a timer chip are good ones and probably should work, but Skorpio's original circuit should have worked too, at least in concept. The LM393 can handle a differential voltage up to the power supply voltage, and since the target is a 0 to 12V output I assume the 393 is being powered by a 12V single-ended supply. Under these conditions the 393 should have switched low when the voltage on the non-inverting input dropped below the 2.5V reference, then switched high when it went back above it. The 393 draws very little input current so unless the source is extremely sensitive that shouldn't matter (and it's easy enough to tell - just put a probe on the "+" pin and make sure it is still swinging between it's original values). It's my guess that the part is defective, or that perhaps there are transients in the signal that go outside of the "normal" 1.5 to 9V range that are destroying the part.
Even if you get this to work, however, remember that using the part in this fashion is very likely to lead to chatter on the output unless your input is very clean and monotonic. If there is any noise around the switching threshold the 393 will pass it right through. That's why usually these sorts of comparators have hysteresis features added in to reduce sensitivity to noisy input signals.
 
Skorpios,

You have a pull-up resistor in 393 output? The 393 is open colector.

M3
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor