# Dependence of output voltages of an op-amp on rail voltages

I want to use an op-amp as an inverting amplifier to convert negative voltages to positive voltages,

simulate this circuit – Schematic created using CircuitLab

If my input varies from 0 to -5V and I want from 0 to +5V as output, is it Ok to connect V+ to 5V and V- to ground? From what I know, the rail voltages just saturate the output between the V+ and V- values but I'm not sure about how it sources and sinks the functions internally.

• Some of the advice from others is less than perfect. None is fatal. | The opamp data sheet will tell you all you need to know. Learning to read it is part of the journey. Amplifiers that claim rail to rail output usually do not quote get there. A few VERY special ones have inbuilt power supplies to provide internal above-V+ voltages but these are very rare. If you MUST get within 10 mV of +5V you will need > 5V supply. 10 mV to 100 mV depends on the opmp - see datasheet. Mar 25, 2015 at 1:25
• Thanks a lot for your answer man. It's more like I don't have a negative voltage source in my available box but I do have positive, so for example, if I railed it from 0 to 10V, could I expect to be able to invert from -5V to 0V to 0V to 5V? I could use this output to rail rail other Op-amps in my circuit to -ve and +ve values, that's my plan. Just need some expert advice on it. Mar 25, 2015 at 1:33
• Question unclear. Opamp will approach but not reach max+ and max- rails at best. Some do not get there by 1v or more. Rail to rail versions still do not quite get there except the super special ones with a power converter inside. Mar 25, 2015 at 12:24

A couple of things.. the op-amp won't get all the way to the positive rail, how far it gets will be 'splained by the datasheet. Note that so long as the amplifier is balanced, the inverting input is a virtual ground so the feedback resistor acts as a load on the amplifier output, just like a resistor to ground. Maximizing the resistor value will allow the output to get closer to the rail, but that difference might be 10mV or it might be 2V, depending on the op-amp. A 'rail-to-rail' type will usually get to within some hundreds of mV or better with a 'reasonable' load.

When the amplifier output is very close to either rail, the characteristics change somewhat and you might find micro-oscillation going on or other strange stuff that requires some thought to compensation. Increasing the feedback resistors generally decreases the phase margin and increases the likelihood of strange stuff happening, as well as increasing errors due to input bias current and leakage, so it's a trade-off.

If you're going into an ADC with a 0-5V range you might choose to use a 0.5~4.5V output (requiring an offset so a couple more resistors) to make sure you can actually measure 0V in and -5V in. The cost of that is a loss of 20% of your resolution or about 1/3 of a bit.

The input common mode range must include ground for this application but it does not have to be R-R input, a device advertised as "single supply" with "rail-to-rail output" is probably going to be your best choice.

• Thanks for the clarity. I think I'm too much of a rookie on the subject, since my understanding of op-amps and transistors are merely theoretical, I'll just post my entire circuit for the project in a new question and ask for advice regarding it. Thank you all very much for the insight. Mar 25, 2015 at 1:50

You will need an op-amp that has rail-to-rail output stage and an input stage that accepts (V-) within its' common-mode range. A TL-081 is NOT suitable.

But yes: what you propose to do is possible.

I assume that you don't really plan to use 100 Ohm resistors for the input and feedback?

I see from your later comments that you have a +10V rail available. So long as your op-amp can handle that voltage, use it. The reason I mention this is that some op-amps are good for only 5.5V or 6.5V. Choose a device that is good for more than your supply rail.

If you are going to be feeding the output of the op-amp to an a/d converter, look also for low input-offset voltage when choosing your device. This minimizes error near 0V input.

Also be aware that some a/d converters have significant input capacitance and that can make your op-amp unstable. The cure for that is to include a low-value resistor in series with the output and take the feedback resistor from the a/d side of that resistor (instead of from the op-amp). You really need to have a supply voltage higher than 5V if you do that and still want a full 5V into the a/d, though.

Finally, unless there is good reason to, I'd choose resistors higher than 1k. 10k is a better choice, I think. Keep in mind that the op-amp has to supply output current equal to the output voltage divided by the resistor value.

• No, I generally use 1k. Will I get the information as to whether V- is within the common mode range in the data sheet? Mar 25, 2015 at 1:13
• If your virtual ground is equal to the negative supply, then you might have a slight DC offset because it doesn't actually go that far, so I'd use a divider to put it just inside the common mode range specified by the datasheet. As for Vin then, the opamp really doesn't care as long as the output doesn't saturate trying to keep the two inputs equal. Mar 25, 2015 at 2:00
• Basically, the supplies are more of a necessary nuisance than anything. As long as they're clean and out of the way in terms of input range and output saturation, it no longer matters what they are exactly. So you can then ignore them and go on with your circuit analysis. Mar 25, 2015 at 2:03

If you attempt to apply a voltage beyond the rails to an input then there is a very good chance that you will destroy the op amp through the input clamp diodes. Do not do so.

• The OP wants to invert a signal that goes below ground to a positive signal. Because s/he is using an inverting configuration, there shouldn't be any problem. Feedback will keep the (-) pin at ground. However, problems will arise if the input goes more negative than the output can go positive. It won't work properly but nothing should be damaged. Mar 25, 2015 at 1:15
• Ok. But, how do you suggest I protect an electronic card from inductive spikes? Can't I use a rail to rail voltage follower prior to the card input and then have my voltage follower trim my spike off at its rail limit?? Mar 25, 2015 at 1:16
• @ubuntu_noob: Why not use clamp diodes rated for the surge current? Mar 25, 2015 at 1:17
• Will a clamp diode work effectively, my spikes are generally 10 times my voltage or even more? When I'm working with a 5V range my turn off impedance spikes reaches 50V. Mar 25, 2015 at 1:24
• Clamp diodes will hold it to the forward voltage of the diodes. The only thing is that you need to be sure that you can absorb all the energy both in the diode and in the supply. Mar 25, 2015 at 1:55