I am confused by how op-amps work. I have a single-supply op-amp: the power rails are +5V and ground. The circuit in the image says the op-amp is an LM741 but it's actually the op-amp built into the Cypress PSoC 4200M chip (data sheet). My understanding is that op-amps generally cannot output a voltage that is too close to the power rail. Therefore I expect that if I configure the op-amp as a voltage follower and tie the positive input to ground, I should get something greater than 0V from the output.

Looking at the data sheet, I think that, assuming I set the power to low and my load is minimal (it's an ADC), the output should range from 0.1V to VDDA (5V) - 0.1V = 4.9V. Does that look correct?

The reason I'm confused about this is when I simulate the circuit in CircuitLab (with the LM741) and run the DC sweep simulation, I see the LM741 outputting the full range of voltages from 0V all the way up to 5V. It seems to be behaving as an "ideal" op-amp. But what's the point in choosing the op-amp model in the simulator and entering all the parameters if it's not going to simulate correctly? Am I doing something wrong or does CL just not simulate op-amps correctly or do I not understand how op-amps work?


simulate this circuit – Schematic created using CircuitLab

  • 1
    \$\begingroup\$ Your understanding is correct. You have to be aware of the fact that all simulation is an approximation to real life, and how good that approximation is will depend on the level of detail in the model. Some OpAmp models use a behavioral element, in other words they do not include a full circuit at transistor level. Also the output stage may be an idealized representation. Some models are better than others. It is a useful lesson in simulation to fine these imperfections so that you don't believe everything the simulator tells you. You should verify your models first. \$\endgroup\$ Jan 30, 2016 at 20:08
  • 1
    \$\begingroup\$ You are correct in saying that the simulator should really simulate. Check that the 741 didn't default to +15 and -15 power rails or similar. \$\endgroup\$
    – Transistor
    Jan 30, 2016 at 20:08
  • 1
    \$\begingroup\$ It's also true that, without a load, some op amps can drive extremely close to the rails. Try putting a 2k resistor to ground at the output. Also, instead of using a sweep, use Vin as a 1 kHz sine wave, 5 v pk-pk with a 2.5 volt offset, and see what you get out. \$\endgroup\$ Jan 30, 2016 at 20:24
  • 1
    \$\begingroup\$ There are "rail-to-rail" op-amps, and others which only get to within +/- 0.7V. \$\endgroup\$
    – JimmyB
    Jan 30, 2016 at 21:25

4 Answers 4


Your understanding of op-amps is fundamentally correct, and as Olin notes, an output with no load may very well drive close to the rails, but many parts will struggle even at no load.

What you may not understand is the models used for simulation, and these vary considerably in detail and accuracy.

This application note explains why most op-amp models are continuous time and why earlier models may not accurately show the limitations of the output. It also goes into some detail on how these models have evolved to bring greater accuracy to simulations.

Most interestingly, the model itself has no real relationship to the part in terms of the actual circuitry used, as the model is only representative of the behaviour of the part; these models rarely model start-up response (if ever) which can catch the unwary. (Chopper stabilised device outputs can be interesting for the first few milliseconds).

Understanding the limitations of simulation tools is critical in engineering, and only a thorough understanding of the parts being simulated (op-amps in this case) will save you from serious circuit mistakes.

The simulation is to help you understand the typical performance of a given part in a given configuration to help avoid many problems; you still need to understand the device fundamentals.

I have seen models (TVS devices in that case) that did not reflect reality and caused quite a lot of embarrassment when the box was subjected to lightning tests, because the designer had blindly believed the simulation.


You are basically right, except for the choice of 741 to use over the 0-5 V range.

The 741 requires some headroom against both supplies. For 0-5 V operation, a CMOS "rail to rail" opamp is a much better choice. Once of the Microchip MCPxxxx series is likely a good fit.

The circuit you show (other than, again, poor choice of opamp) is valid and is common enough to have its own name of "voltage follower". The voltage gain is basically 1, but the output impedance can be orders of magnitude lower than the input, making this a useful trick in some circumstances.

As to why the simulator doesn't act like a real part, it's not a real part. Apparently that restriction on opamp behavior was not coded into that simulator. Simulators are only as good as the people who wrote them and the users that drive them. Go hook up a real opamp and gain some real world intuition about how these things behave.

  • \$\begingroup\$ I'm not actually using the LM741; I was just using it in the simulation because the actual op amp wasn't one of the available choices. It's the op amp inside the Cypress PSoC 4200M processor, which advertises itself as rail-to-rail and can (according to the sheet at least) output to within 0.1V of each rail. \$\endgroup\$ Feb 12, 2016 at 1:06

In your diagram, your op amp is effectively given a +/- 2.5V rail, and its positive input referenced to ground would be -1.5V. I havent taken a look at the lm741 data sheet, but having 1 volt of headroom from the rails doesnt seem too surprising so I would expect the output of this circuit to track the input pretty well.

That being said, an op-amps headroom will decrease with a higher current draw, so if you were to put a larger load from the output to the virtual ground, you should notice issues if your input is too close to either rail.

If you were to actually tie your input down to either of the rails (rather than 1V DC) and pull a couple mA from the output, you should definitely see that the output will not be at the rail. If this is not the case, you simply have a bad model. Keep in mind that the LM741 was one of the oldest and most fundamental op amps ever designed, so I wouldnt be surprised if it is being modelled as an ideal op amp.


replace LM741 with LM358. LM741 can't used in this case

  • 2
    \$\begingroup\$ Read the first paragraph. It isn't a 741 \$\endgroup\$
    – W5VO
    Feb 10, 2016 at 21:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.