Why is LM393 output distorted?

Thread Starter

slowfuse

Joined Sep 7, 2010
16
In the attached circuit, I have a comparator (LM393) that takes a sine wave (from pint "A") and produces a 5v square wave (at point "B"). Then it is fed to a limiter circuit to condition it for input to a TTL 3.3v micro.

When only the comparator circuit is present (i.e. other part not connected), I get a nice 5v square wave. But when I connect the second part of the circuit, the amplitude of the square wave at the output of the comparator itself is reduced to about half (and with some distortion).

Why is this happening? I have previously used the same second part of the circuit for conditioning all types of inputs to bring them down to 3.3v and worked fine but not here.

Thank you
 

Attachments

bertus

Joined Apr 5, 2008
22,270
Hello,

The LM393 comparator has an open collector output.
You use a 10 K resistor from the collector to +.
The 10 K at the from the rest circuit is a to high load.

You can simply connect the 10 K at the collector to 3.3 Volts ta get a 3.3 Vtt squarewave.
The rest is not needed in taht case.

Bertus
 

Thread Starter

slowfuse

Joined Sep 7, 2010
16
Hello,

The LM393 comparator has an open collector output.
You use a 10 K resistor from the collector to +.
The 10 K at the from the rest circuit is a to high load.

You can simply connect the 10 K at the collector to 3.3 Volts ta get a 3.3 Vtt squarewave.
The rest is not needed in taht case.

Bertus
Thanks very much (I love the picture of the cat you have.... reminds me of the one I used to have!)

I will try what you suggest tomorrow for sure.

Regarding the 10K at the output and pulled up to Vcc, I was told that this is required with the LM393, is this not the case? Or if you say it is too heavy, should I increase the value?

I would like to elaborate on this, if you will allow me:

This is a standard type of input protection/conditioning that I have been using for inputs, both logical and signal.

Previously my input was a square wave 5v generated by a Hall Effect device and it was effectively reduced properly. Now what I am trying to do, for testing, is rig up a sound card to the comparator (so I can play with the frequency). As stated, when stand alone, it works fine, but not when connected to the other circuit.

Thanks for your valuable inputs.
 

SgtWookie

Joined Jul 17, 2007
22,230
Adding to what Bertus said; instead of 10k for a pullup resistor, use a 1k resistor. 3.3v/1k=3.3mA, which is right in the middle of the comparator's output sink capability.

You will get much better performance that way.
 

SgtWookie

Joined Jul 17, 2007
22,230
Regarding the 10K at the output and pulled up to Vcc, I was told that this is required with the LM393, is this not the case? Or if you say it is too heavy, should I increase the value?
The LM393/LM2903 and LM339 have a minimum sink current rating of 6mA. They have open-collector outputs, which means that they can sink current, but not source current.
Keeping those limitations in mind, I select a resistor that results in roughly 1/2 the minimum sink current capability; about 3mA to 4mA.

3.3v/3.5mA= ~942 Ohms. You could use a 910 Ohm or 1k Ohm resistor.
3.3v/910 ~= 3.63mA
3.3v/1k = 3.3mA

The output of the comparator needs no further conditioning, unless your input requires more than ~3mA source or sink.

This is a standard type of input protection/conditioning that I have been using for inputs, both logical and signal.
Your R8/C2 will make for slow input rise/fall times. If your input is not a Schmitt trigger, you may have problems due to the slow rise/fall times.
R1 is too large, as I've already mentioned.
 

Thread Starter

slowfuse

Joined Sep 7, 2010
16
Adding to what Bertus said; instead of 10k for a pullup resistor, use a 1k resistor. 3.3v/1k=3.3mA, which is right in the middle of the comparator's output sink capability.

You will get much better performance that way.
I understand what you are suggesting but I can't really do that (pull up to 3.3v) since the conditioning circuit is in one box (the tested device, and I can't change it) and the comparator circuit in another box (as my "test equipment).

So I guess that leaves me with changing the comparator circuit. How should I do that?

Thanks
 

Thread Starter

slowfuse

Joined Sep 7, 2010
16
Your R8/C2 will make for slow input rise/fall times. If your input is not a Schmitt trigger, you may have problems due to the slow rise/fall times.
If I may digress a moment from the original topic, I would like to ask you about input protection (given your comment above).

I have been using this circuit for protecting/conditioning inputs from 5v to 30v (approx.) as inputs to a microprocessor at 3.3v. There are two types of expected inputs:
a) "Logical" inputs (like door being closed or open)
b) Pulsed inputs (square waves, sub 1KHz)

So even though it seems to have been working and without issue, how can I improve it? Either for component count, simplicity or robustness?

Thanks much
 

SgtWookie

Joined Jul 17, 2007
22,230
If you can't change the "tested device", I guess you're just plain screwed.

See the attached simulation of the "conditioned input". Note the very long rise/fall times. Yours is worse, because you have another 10k resistor in series with the output of V1. Removing the 0.1uF cap would fix most of it.

If you can't do that, maybe add an emitter follower to the comparator output; at least you'll be able to source/sink more current.
 

Attachments

Top