LM393 defective? Trying to make it work but the output is always "LOW"

Thread Starter

Aenema

Joined Oct 19, 2017
8
Hello. This is my first post on the forum so I'll be brief. I'm struggling with an LM393 IC. I saw on the internet how exactly they work...in theory. But when I try to use one in a real circuit, it doesn't behave as expected. I simply try to connect a +13 V source to the Vin+ and 0V to the Vin- and expect a "HIGH" output. Instead Vout is on "LOW". Can't figure it out. Here's the diagram:
 

Attachments

Thread Starter

Aenema

Joined Oct 19, 2017
8
You do realize that the LED is on only when the output is low, right?

Bob
Certainly. I'm expecting a "HIGH" when the + 13 V is on Vin+ and GND on Vin- and a "LOW" with +13V on Vin- and GND on Vin+. Instead I get a "LOW" in both cases :p. LED always on no matter the combination...
 

BobTPH

Joined Jun 5, 2013
2,028
I am not going to try to view the datasheet on my iphone.

Have you checked that 13V is within the allowable range for the input?

Bob b
 

Alec_t

Joined Sep 17, 2013
10,384
IIRC the inputs need to be at least ~1.2V below the +ve rail for correct operation.
Try a pull-up resistor (e.g. 3k-10k range) from the comparator output to the +v rail.
 

Thread Starter

Aenema

Joined Oct 19, 2017
8
As per datasheet absolute maximum ratings: "Differential input voltage range: 36Vdc". I've checked the current through the LED as well: around 5mA so I'm guessing no problem there.
 

ericgibbs

Joined Jan 29, 2010
8,755
hi,
Despite what the d/s states about the common mode input and individual input limits of Vsup, I have found in practice that they have an inversion problem if either input goes greater than Vsup +1.5V

E
 

crutschow

Joined Mar 14, 2008
23,379
Use a two equal-resistor voltage divider to apply 1/2 the supply voltage to the (+) input.
For that the output should be high and the LED off.
 

WBahn

Joined Mar 31, 2012
24,709
hi,
Despite what the d/s states about the common mode input and individual input limits of Vsup, I have found in practice that they have an inversion problem if either input goes greater than Vsup +1.5V

E
Did you mean Vsup + 1.5V or Vsup - 1.5V ?

If the TS is tying the inputs to the supplies, then he is not exceeding Vsup + 1.5V.
 

OBW0549

Joined Mar 2, 2015
2,989
As per datasheet absolute maximum ratings: "Differential input voltage range: 36Vdc".
You're looking in the wrong place: Absolute Maximum Ratings are SAFETY ratings, not conditions for proper operation. Always read the fine print on the datasheet:

Note 1.png

And under Electrical Characteristics, you can see, under "Input Common Mode Voltage Range," that the voltage on the inputs must be kept between 0V and 1.5V below Vsupply+ or the device won't function correctly.

For op amps and comparators, ALWAYS keep input voltages inside the input common mode voltage rating if you want your circuit to work.
 

WBahn

Joined Mar 31, 2012
24,709
I will try the suggestions. Will come back with the news...Thanks :)
What are you doing with the other comparator that's in the package?

I would recommend using a three-resistor voltage divider (between V+ and gnd) and tying one of the inputs to each of the two junctions. This ensures that your inputs stay away from either rail and from each other. Leave the output floating.

Note that you can use this same three-resistor divider to provide the inputs to the side you are testing.
 

Thread Starter

Aenema

Joined Oct 19, 2017
8
You're looking in the wrong place: Absolute Maximum Ratings are SAFETY ratings, not conditions for proper operation. Always read the fine print on the datasheet:

View attachment 187677

And under Electrical Characteristics, you can see, under "Input Common Mode Voltage Range," that the voltage on the inputs must be kept between 0V and 1.5V below Vsupply+ or the device won't function correctly.

For op amps and comparators, ALWAYS keep input voltages inside the input common mode voltage rating if you want your circuit to work.
And of cours
You're looking in the wrong place: Absolute Maximum Ratings are SAFETY ratings, not conditions for proper operation. Always read the fine print on the datasheet:

View attachment 187677

And under Electrical Characteristics, you can see, under "Input Common Mode Voltage Range," that the voltage on the inputs must be kept between 0V and 1.5V below Vsupply+ or the device won't function correctly.

For op amps and comparators, ALWAYS keep input voltages inside the input common mode voltage rating if you want your circuit to work.
Got it now.... The range I wasn't aware of...thought any voltage will do. Thanks ;)
 

WBahn

Joined Mar 31, 2012
24,709
You're looking in the wrong place: Absolute Maximum Ratings are SAFETY ratings, not conditions for proper operation. Always read the fine print on the datasheet:

View attachment 187677

And under Electrical Characteristics, you can see, under "Input Common Mode Voltage Range," that the voltage on the inputs must be kept between 0V and 1.5V below Vsupply+ or the device won't function correctly.

For op amps and comparators, ALWAYS keep input voltages inside the input common mode voltage rating if you want your circuit to work.
Technically, if one input is at 12 V and the other input is at 0 V, then the input common mode voltage is 6 V.

But I *think* that what they mean is that each input individually needs to be within the spec'ed common mode input voltage range, but I can't see that they make that clear.

Their Note (3) states: "The input common-mode voltage or either input signal voltage should not be allowed to go negative by more than 0.3V. The upper end of the common-mode voltage range is V +−1.5 V at 25°C, but either or both inputs can go to 36 V without damage, independent of the magnitude of V + ."

The first part of this is redundant -- the input common-mode voltage can't go below -0.3 V without at least one of the input signal voltages doing so, so it would be sufficient to simply state that neither input signal voltage should be allowed to go negative by more than 0.3 V. But this also means that they understand that common-mode voltage range is not the same thing as the voltage range of the individual inputs (i.e., that it was an oversight in preparing the datasheet). So the fact that they don't say anything about what the maximum voltage that either signal voltage can go to implies that it doesn't matter as long as the common mode voltage of the two is within spec. But I don't think this is what they actually meant. My best guess is that the datasheet specs were essentially carried over from the case of an opamp operating in the linear region in which case the differential voltage is essentially zero and thus both inputs are approximately at the common mode voltage. But that just isn't the case of a comparator. It would be nice if they were more specific in the notes if this is what they mean.
 

OBW0549

Joined Mar 2, 2015
2,989
But I *think* that what they mean is that each input individually needs to be within the spec'ed common mode input voltage range...
That's the correct interpretation, in this case.

I've noticed some datasheets simply refer to "input voltage range," and omit the "common-mode" designation-- likely because of the confusion it might cause.
 

Thread Starter

Aenema

Joined Oct 19, 2017
8
Technically, if one input is at 12 V and the other input is at 0 V, then the input common mode voltage is 6 V.

But I *think* that what they mean is that each input individually needs to be within the spec'ed common mode input voltage range, but I can't see that they make that clear.

Their Note (3) states: "The input common-mode voltage or either input signal voltage should not be allowed to go negative by more than 0.3V. The upper end of the common-mode voltage range is V +−1.5 V at 25°C, but either or both inputs can go to 36 V without damage, independent of the magnitude of V + ."

The first part of this is redundant -- the input common-mode voltage can't go below -0.3 V without at least one of the input signal voltages doing so, so it would be sufficient to simply state that neither input signal voltage should be allowed to go negative by more than 0.3 V. But this also means that they understand that common-mode voltage range is not the same thing as the voltage range of the individual inputs (i.e., that it was an oversight in preparing the datasheet). So the fact that they don't say anything about what the maximum voltage that either signal voltage can go to implies that it doesn't matter as long as the common mode voltage of the two is within spec. But I don't think this is what they actually meant. My best guess is that the datasheet specs were essentially carried over from the case of an opamp operating in the linear region in which case the differential voltage is essentially zero and thus both inputs are approximately at the common mode voltage. But that just isn't the case of a comparator. It would be nice if they were more specific in the notes if this is what they mean.[/QU
Technically, if one input is at 12 V and the other input is at 0 V, then the input common mode voltage is 6 V.

But I *think* that what they mean is that each input individually needs to be within the spec'ed common mode input voltage range, but I can't see that they make that clear.

Their Note (3) states: "The input common-mode voltage or either input signal voltage should not be allowed to go negative by more than 0.3V. The upper end of the common-mode voltage range is V +−1.5 V at 25°C, but either or both inputs can go to 36 V without damage, independent of the magnitude of V + ."

The first part of this is redundant -- the input common-mode voltage can't go below -0.3 V without at least one of the input signal voltages doing so, so it would be sufficient to simply state that neither input signal voltage should be allowed to go negative by more than 0.3 V. But this also means that they understand that common-mode voltage range is not the same thing as the voltage range of the individual inputs (i.e., that it was an oversight in preparing the datasheet). So the fact that they don't say anything about what the maximum voltage that either signal voltage can go to implies that it doesn't matter as long as the common mode voltage of the two is within spec. But I don't think this is what they actually meant. My best guess is that the datasheet specs were essentially carried over from the case of an opamp operating in the linear region in which case the differential voltage is essentially zero and thus both inputs are approximately at the common mode voltage. But that just isn't the case of a comparator. It would be nice if they were more specific in the notes if this is what they mean.
Found a doc on the web about the "input common mode voltage range".
I quote: "At the input, the CM range useful for VIN also has two rail-imposed limits, one high or close to +VS, and one low, or close to –VS. Going high, it can range from an upper CM limit of +VS – VCM(HI) as a positive maximum. For example, again using the +VS = 5 V example case, if VCM(HI) is 1 V, the upper VIN limit or positive CM maximum is +VS – VCM(HI), or 4 V."
The same goes for VCM(LO). So if I understood correctly, if I need a "HIGH" output, my inputs have to be like this according to the datasheet (they are specified in the ICMVR: upper limit: 1.5V, lower: 2.0 V):

Vin + :13V - 1.5V = 11.5 V (upper limit)
Vin - : 0V + 2.0V = 2V (lower limit)

For a "LOW" all I need is to reverse the polarities: 2V on + and 11.5V on -. Pretty straightforward. I think...
So the LM393 will never work with 0V.
 

Thread Starter

Aenema

Joined Oct 19, 2017
8
Technically, if one input is at 12 V and the other input is at 0 V, then the input common mode voltage is 6 V.

But I *think* that what they mean is that each input individually needs to be within the spec'ed common mode input voltage range, but I can't see that they make that clear.

Their Note (3) states: "The input common-mode voltage or either input signal voltage should not be allowed to go negative by more than 0.3V. The upper end of the common-mode voltage range is V +−1.5 V at 25°C, but either or both inputs can go to 36 V without damage, independent of the magnitude of V + ."

The first part of this is redundant -- the input common-mode voltage can't go below -0.3 V without at least one of the input signal voltages doing so, so it would be sufficient to simply state that neither input signal voltage should be allowed to go negative by more than 0.3 V. But this also means that they understand that common-mode voltage range is not the same thing as the voltage range of the individual inputs (i.e., that it was an oversight in preparing the datasheet). So the fact that they don't say anything about what the maximum voltage that either signal voltage can go to implies that it doesn't matter as long as the common mode voltage of the two is within spec. But I don't think this is what they actually meant. My best guess is that the datasheet specs were essentially carried over from the case of an opamp operating in the linear region in which case the differential voltage is essentially zero and thus both inputs are approximately at the common mode voltage. But that just isn't the case of a comparator. It would be nice if they were more specific in the notes if this is what they mean.
 

Thread Starter

Aenema

Joined Oct 19, 2017
8
I got it working in the end. The issue was that I tried to use 0 volts with 1 of the inputs (or both). In order for it to function properly all I had to do was to keep the lower voltage above 2 volts and the higher voltage 1.5 volts below Vcc. Thanks for everything :p
 

ericgibbs

Joined Jan 29, 2010
8,755
Hi A,
Thanks for the feedback, it will help others with a similar problem.:)
As I said in my earlier post, the datasheet can be misleading, also you have confirmed the results I have had in the past with the LM393 .
E
 
Top