# LM339: why is the output +5V

The circuit diagram below is given in my book (written by Coughlin and Driscoll).

simulate this circuit – Schematic created using CircuitLab

Here it is said that, at the condition when $E_d=+2V$, the output voltage will be $V_o=+5V$. But for an op amp, when the non-inverting voltage is higher than then inverting voltage, the output voltage will be $+V_{sat}$, which is approximately +15V.

Why is the output for this Op Amp IC (LM339) +5 Volts?

• @What John D said. | With open collector output there is no positive going drive inside the IC - that is provided by the external pullup. In this case they wanted +5V max so used a +5V supply. If they had used a say +12V for the pullup supply it would go to +12V max etc. Aug 14, 2014 at 23:11

Well, the LM339 is a comparator, not an op-amp. It is intended to compare the two input voltages and put out one of two levels depending on the result of the comparison. It is not intended to be used with feedback, except possibly positive feedback for hysteresis. The output is an open collector, and there is a pull-up to 5V, meaning that when the non-inverting input is higher than the inverting input the output transistor is OFF, and the output will go to whatever voltage the pull-up (Rp) is connected to.

• Oooo... I didn't spot that the 339 is open-collector output. Good eye. Aug 14, 2014 at 16:33
• Good answer +1. It is possible to use an LM339 comparator as a low-frequency op-amp by adding a pullup and external compensation capacitor. See NS AN-74 Fig. 28. Aug 14, 2014 at 19:49

There is actually a contradiction in the LM339 datasheet:

The output consists of an open-drain NPN (pulldown or low-side) transistor. The output NPN sinks current when the positive input voltage is higher than the negative input voltage and the offset voltage.

vs.

When both IN– and IN+ are both within the common-mode range:

– If IN– is higher than IN+ and the offset voltage, the output is low and the output transistor is sinking current

– If IN– is lower than IN+ and the offset voltage, the output is high impedance and the output transistor is not conducting

TI has confirmed the second case is correct for a similar part here: