Op Amp Rail Voltages

AnalogKid

Joined Aug 1, 2013
10,986
The most common are the LM339 quad and LM393 dual. These are open-collector comparator versions of the LM324 and LM358. Not very fast, not very precise, but they've beeen around since the early 70's, almost indestructible, and used to sell in the billions.

ak
 

Thread Starter

SamR

Joined Mar 19, 2019
5,031
K, I was wrong. I double checked and I do have a few LM311, LM339, and LM393s in stock. So I guess I'm covered there. Also, at the bottom of the article is a link for a Utube by Sam Ben Yaakov dissecting the article and I should have watched it first as it is making a lot of the same points you guys have brought up. I tend to ignore a lot of Utubes... Anyway, I think I will throw a comparator into the mix for comparison with the op amps.

Edit: Prof. Sam Ben Yaakov found several errors in the original article that were corrected for the current article.
 
Last edited:

Ian0

Joined Aug 7, 2020
9,667
True. I have several types of op amps in my stock but no comparators. What would you recommend having on hand?
You've got to have an LM339 or LM393 because that's what everyone thinks of when you say "comparator", but I'd also have a TLC3702 or something with push-pull outputs for those occasions when the open-collector output of the LM339/393 is not ideal.
 

Thread Starter

SamR

Joined Mar 19, 2019
5,031
I'd also have a TLC3702
OK, I'll pick up a few to have on hand. Interesting chip looking at the PDF. Read the section on ESD protection for CMOS and how TI had built it in. For multi op amp devices the standard practice is to ground all unused pins?
 

AnalogKid

Joined Aug 1, 2013
10,986
For multi op amp devices the standard practice is to ground all unused pins?
No. And also, not just the unused inputs. Two things.

1. Depending on what the power pins are tied to, GND might be outside the input common mode voltage range. Probably nothing catastrophic, but it could increase the idle current.

2. Tying the two pins together could cause the part to oscillate, or produce a noise signal at the output. This is because the two inputs are too close together for the output to go to a defined state.

A better way is to tie the inverting input to the output to form a voltage follower, and tie the non-inverting input to a DC potential that is within its common mode voltage range. For something like an LM358, with its CM range that extends below its negative rail, grounding both the non-inverting input and the V- pin is OK. But for a more conventional opamp like the LM741, where the low end of the CM range is greater than the V- potential, grounding the NI input when the V- rail is GND is not good.

Didn't see that one coming, did ya?

ak
 

Thread Starter

SamR

Joined Mar 19, 2019
5,031
Didn't see that one coming, did ya?
Not at all! So, -input to output (voltage follower), and +input to +rail (don't think so because rail voltage may be greater than common mode voltage)? Or, +input to another active +input that would be in the common mode voltage range (which will be either a fixed or variable voltage)? Better yet, don't use chips with extra unused op amps. Learning quite a bit not covered in the basic textbooks here. Thx!
 

Ian0

Joined Aug 7, 2020
9,667
Some comparators have built-in hysteresis of a few mV. They might oscillate if you tie -in to out. Those types would be better with the inputs tied together, as they can never exceed the hysteresis level and change to the opposite state.
 

Ian0

Joined Aug 7, 2020
9,667
OK, makes sense. In those cases, would the output then be grounded (I would think so)? Or left floating?
Most comparators have a common-mode input range that includes the negative supply. If so, then connect to negative supply, which will probably be ground.
If your particular comparator's common-mode input range doesn't include its negative supply, it will probably be running from + and - supplies, in which case connect to ground (not the negative supply)
 

Thread Starter

SamR

Joined Mar 19, 2019
5,031
Started breadboarding the circuit. Made 2 changes due to limitation of Sig Gen. +10V and GND on rail. 8V on -IN so with the voltage divider the -IN is ~4V. Started with a uA741.
1636912594744.png
OK, it stops at the "setpoint" 3.76V but is following the input below that and there is no hysteresis?

Replaced with LM301 and took the Sig Gen to 16V without offset.
1636912958553.png
The output is following the input down to -8V and the rails are +10 and GND? I expected it to stop at 0V and still no hysteresis. Also, on both screenshots the output has some oscillation.

Turned the +10V rail off and now the op amp has no rail power at all!
1636913293948.png
HUH? The setpoint is still there and the output following almost down to -8V?

What the heck is going on here?
 
Last edited:

Thread Starter

SamR

Joined Mar 19, 2019
5,031
1636934726537.png

LM301
1636936282173.png
EDIT: Argh... The MMeter and SigGen labels are swapped! SigGen is on pin 2 and I put a V meter on pin 3 to look at the voltage divider voltage. It is wired correctly but the labels are wrong. Also can't see the jumper from the boards ground to pin 4 and it appears the resistor is on pin 4 but it is on pin 3 as it should be. Pin 3 has 2 resistors (one to gnd and one from the 8V supply), jumper from resistor and cap on output pin 6, and the multimeter plugged in also. Hard to see it is so crowded in.
 
Last edited:

AnalogKid

Joined Aug 1, 2013
10,986
If this is supposed to be a comparator circuit with hysteresis, what are your calculated trip points?

Also, the text in the drawing does not match the parameters listed for either V1 or V2,

ak
 

Thread Starter

SamR

Joined Mar 19, 2019
5,031
If all resistances are equal (e.g. 100kΩ), the threshold voltages will be 1/3 and 2/3 of the supply voltage, respectively.
1636996132241.png

the text in the drawing does not match the parameters listed for either V1 or V2
Not sure I follow you here... V1 is the SigGen applied to pin 2 -input. V2 is 8V applied to pin 3 +input.

The blue text on the schematic is what is on the breadboard. The SigGen was actually putting a 10V triangular wave signal (not 8V) on the uA741.
 
Last edited:

AnalogKid

Joined Aug 1, 2013
10,986
If all resistances are equal (e.g. 100kΩ), the threshold voltages will be 1/3 and 2/3 of the supply voltage, respectively.
Don't think so. Neither the 741 nor the 301 are "rail-to-rail" devices.

For example, the LM301 output voltage range is approx. +/-12 V when operating with +/-15 V supplies (ON Semiconductor datasheet). That's 3 V of headroom on *each* power pin. Your circuit shows a single 10 V rail. Take +/-3 V off of that, and the output voltage range that is driving the hysteresis divider now is only 4 V, from +3 V to +7 V. Granted, the headroom decreases somewhat at lower rail voltages, but that relationship is not linear. The headroom might be only +/- 2 V, but that still is significant.

All of this also is true for the 741. Its datasheet will have the output swing numbers. Real world hysteresis calculations always are far more messy than the books lead you to think. Not complicated or complex, just messy.

ak
 

Thread Starter

SamR

Joined Mar 19, 2019
5,031
OK so let's forgo the 741 and 301. I pulled some CA3130s out of stock since they will do rail to rail and now it's doing almost what I expected. Also raised V1 and V2 to 10V, and the SigGen to 0-10V. The bottom of the output isn't going to 0 but to the ~5V setpoint from the voltage divider?
1637003376054.png
 
Top