# Can I use an op-amp to supply itself a negative voltage?

For my project, I am using an LM324. According to the datasheet, its power supply can either be +/- 16V or 0-32V (max). The output will range from -3V to +3V (or there abouts), so I realise I'm going to need a positive and negative voltage supply. All I think I'll be needing is +5V and -5V to power the op-amp.

Here is the question. I'll be hooking this up to an Arduino UNO, and this can't produce said negative supply. I was thinking of using one of the 4 op-amps within the chip to invert a +5V input to give -5V. I have ran some simulations using Proteus, and according to these simulations, the idea should work, but I know from experience that theory and practice can have very different results. Would using one of the op-amps in the IC to give itself a -5V be effective, or would I have to look into an alternative method of generating -5V?

I'm using an external DC power source (not portable), and I would like to avoid batteries, if possible.

EDIT: Thanks to everyone for your answers. I had a very strong feeling that it wouldn't be possible, but something in my mind was telling me otherwise. My aim was to use as few components as possible, but I guess I was asking for too much.

I have looked at my simulations again. They are currently on a non-network PC and am unable to transfer screenshots. There was indeed a bug somewhere, and it is now telling me that what I've done is wrong, which supports all your answers.

• You cannot use an opamp to invert voltage. The simulation must be bugged. – Turbo J Jan 29 '15 at 11:43
• @TurboJ Inverting Operational Amplifier? This is what I currently have set up to generate the -5V: link – Tom Jan 29 '15 at 11:48
• @user3872145 A real (as opposed to ideal) opamp can still only output voltages between its supply rails; in that configuration it will saturate at 0v and output that. – Nick Johnson Jan 29 '15 at 11:51
• For the DVers-- the user had a misconception, thought about it and came to the conclusion that it might be wrong, and clearly asked about it in a way that everybody can understand? Why the downvotes? – Scott Seidman Jan 29 '15 at 14:57
• P.S. You should paste in a snapshot of the simulation. You've probably used ideal op-amps which have no power pins, they're powered by magic. Good for linear experiments. You might be able to select a real 324 op-amp and then it will have power pins which need to be connected. This one won't give you the wrong answer. – tomnexus Jan 29 '15 at 16:03

You can generate a negative voltage with a small current quite simply with a source of AC, and a voltage doubler rectifier.

(This shows a doubler, reverse the diodes and capacitors for an inverter)

See here for some circuit diagrams.

The AC would come from your Arduino, by toggling a single pin regularly. You must add a series resistor too. It might be possible to use the PWM outputs, set them for 50% (AnalogWrite) and the pin will change state continuously.

Notes: as you are producing a square wave, not a pure sine wave, you will need a resistor to limit the current, as though the uC was driving a short circuit. If you only have 5 V, you should use Schottky diodes to get the most possible voltage out. Choose appropriate capacitor values for the frequency of AC that you have. Higher frequency is better, until you get to the point that the junction capacitance of the diodes becomes relevant. Available current will be small, perhaps 1/2 or 1/4 of the maximum output current of the Arduino, be careful not to overload the output pin, even during start-up when the C2 output capacitor is not charged.

• Just +1 then... – Spehro Pefhany Jan 29 '15 at 12:42
• +0 : getting power from uC PWM output is quite an interesting idea, but a risky and unneeded one IMO. For one thing, it stresses the uC needlessly, giving both very low output current itself and reducing output current from other pins at the same time. Also, uC outputs are noisy. PWM is very noisy. Supplying a very noisy rail to op-amp without filtering will induce severe ringing, feedback, voltage artifacts and other issues. Adding a proper filtering for PWM complicates the circuit, making a charge-pump or any other inverter a better idea IMO. – vaxquis Jan 29 '15 at 14:13
• @vaxquis it's true it will stress the uC, so it's only for small currents. If it can handle the current, why not? As for PWM, I'm not sure what you're worried about. The outputs will have some noise, but not a lot more than the rails, and it is filtered. "PWM is very noisy" isn't true, your phone or mp3 player uses pwm to create its audio. Anyway, there's nothing pulse width modulated here, only a source of AC and a rectifier. Anything that creates a negative voltage will introduce ripple, but the capacitor smoothes it and the op-amp will reject most of it. – tomnexus Jan 29 '15 at 14:44
• @vaxquis, he could use the uC to toggle a FET hooked to the 5V supply. (maybe two FET's, as it has to sink current also.) – George Herold Jan 29 '15 at 14:48
• @vaxquis you made me think about ringing... I now realise there will be big spikes in current, a series resistor between uC and will be essential. Otherwise there will be nothing limiting the current when it switches. Good point. – tomnexus Jan 29 '15 at 14:52

An op-amp's output pin can only swing between its power rails - many op-amps can only get within a volt or so of the rails, while 'rail to rail output' amps can reach voltages very close indeed to their rails. They can't output voltages outside that range, though - the power still has to come from somewhere! I suspect your simulation used a simplified op-amp schematic with no power rails, which doesn't account for where the current is actually coming from.

A switched capacitor inverter is probably your simplest and cheapest option to get -5V rail for your op-amp; ICL7660 and LM2664 are common and affordable options.

• I agree 2664 is cheaper - yet LM2664 is available only in SOT-23 package, and that's the foremost reason I wouldn't recommend it to a newbie (which is the OP's case IMO) due to prototyping overhead for SMDs, power output and dissipation being only a minor issue here; I prefer DIP-available parts for amateur designs, for obvious reasons. For small amounts, the price difference (about 0.5$vs 1$ AFAIR) shouldn't matter on such cheap parts (you can get samples). For a newbie, prototyping a valid SMD PCB is actually quite a costly enterprise, requiring both software skills and hardware supplies. – vaxquis Jan 29 '15 at 14:04

I was thinking of using one of the 4 op-amps within the chip to invert a +5V input to give -5V

No matter what circuit you used you cannot simultaneously generate a negative voltage for the quad op-amp by using one of the op-amps in that same quad package.

Please look at other options for generating the negative rail. This could be achieved by a seperate op-amp wired as an oscillator - you could then use diodes and capacitors for generating a negative rail but, it will probably only produce about -4V.

• Add an inductor to the mix though, and the voltage can go higher ;) – Potatoswatter Jan 30 '15 at 2:14
• Andy, if you have a moment to spare please look at my similar question at this link. Specifically I'm hoping you are wrong about an op amp not being able to generate its own negative supply, but if you are right I really want to understand why. electronics.stackexchange.com/questions/200695/… – Randy Nov 14 '15 at 16:21
• An op-amp can't generate its own negative supply because that would require power out to be greater than power in and that's a problem with the laws of physics in this universe. You might get a tad more attention on your question (in the link) if you were a little bit more diligent about "accepting" answers to some of your recent questions. Just me thinking aloud! – Andy aka Nov 14 '15 at 19:11

No, that won't work. For an op-amp, the supply voltages determine what its maximal output could be. An op-amp can not exceed those boundaries, if you supply it with 0V and 5V, it will not be able to produce anything above or below that.

My guess is that your simulation is simulating an ideal op-amp, not taking the supply effect into account.

No, you can't. As every datasheet for any op-amp will tell you, Vout has to be between Vcc and Vee, some couple of volts from them or very close to them for rail-to-rail op-amps. Also, in 99.9% of the cases you can't use chip's output as it's supply voltage (same goes with using outputs as required ICs reference voltages, which usually won't work unless the pin description states that possibility explicitly).

As to possible solutions to your problem - apart from some good ideas given here (e.g. using charge-pump or PWM-based V- generator), I'd like to share one that worked best for me in my designs.

If you want a +/- input, just apply a DC bias to the input signal, possibly using simple superposition circuit based on two resistors and one capacitor. If the input signal's range is (-3V,+3V), add a +3V bias to it by putting high end on 6V and low end on GND.

Likewise, if you require a (-3V,+3V) output, you can work your op-amp with positive voltages, and then apply either negative bias or simple highpass filter (single RC would probably do the trick) to the output if you really need it. This way you can use any op-amp with single supply rail, plugging the negative supply to GND.

See here for a simulation showing the idea with single-supply +6V/0V op-amp relaxation oscillator filtered to get about -3V to +3V swing using 1uF cap and 100kOhm res highpass and VGND from two resistors.

The obvious caveat (as with every single-supply solution) is that it requires a virtual GND for any common op-amp application (apart from unity-gain buffer and some simple comparators maybe), but you can do that with either two resistors (with a buffer if more current is required) or one "rail splitter" IC (TLE2426 comes to mind here).

You cannot generate this negative rail using only the op-amp itself, even you tie its ground pin to the inverting amplifier's output.

However since you have an Arduino, by leveraging one PWM pin, adding a Schottky diode, a capacitor, an inductor and a logic-level power MOSFET you can add a buck-boost converter to generate this negative rail. You can add an analog input pin and one op-amp to sample this output voltage and provide some regulation. And given you have inductors, diodes and MOSFETs rated for enough current, you can load it pretty heavily like driving a class-AB push-pull power amplifier from this rail.

Yes, one section of a quad opamp can create a V- for itself. All you have to do is add a buffer, as shown in the diagram. When the opamp output is high C2 charges through D1 and D2. When it switches low, Q1 turns on, pulling C3 negative through D3. Voltage loss is fairly large: a 324 amp and 4148 diodes give a V- that is 4V ( or more ) below V+. A rail-to-rail opamp and schotky diodes would be better; maybe 1.5 to 2V loss. It would not do what the OP wanted, and uses so many components that it is not that useful in general, but it is an option.

Component values I used to test it: R1,5: 100K; R2,3: 1M; R4: 330K; C1: 1nF; C2,3 10uF; Q1: 2N3906 ; D1-4: 1N4148. Oscillation frequency was 5KHz, duty cycle about 50%. V+ ranged from 9 to 15V.

As other answers have mentioned, you cannot create a "negative" voltage with an opamp, given positive rails. You have to realize is that voltage is relative, so what you can do is create a "virtual" ground at Vcc/2, and treat 0V as your negative supply and Vcc as your positive supply.

This can be done using an opamp to buffer a voltage division of your power supply:

For example, if you use a DC power supply of 9V, then your Vcc/2, or virtual ground, will sit at 4.5V. Now, you can use this voltage wherever you had ground in your circuit before, the actual 0V as your negative supply, and 9V as the positive supply. This will also ensure you get that +3V to -3V swing at the output of the opamp, I believe the LM324 clips at about |Vcc-1.5|.

Since you are interfacing with an UNO, you will need to be careful with connecting the output of the opamp to any inputs. The DC offset on the output will be 4.5V and the Arduino cannot handle much above 5V. You could decouple the DC with a capacitor but then the Arduino also cannot handle voltages below 0.

• it's been proposed already 2 times, see electronics.stackexchange.com/a/151568/20088 and electronics.stackexchange.com/a/151531/20088 - also, a) since the input signal is -3V/+3V in reference to GND, your idea wouldn't work, since you provided no DC biasing on input, b) you don't need a buffer to have VGND in most cases. – vaxquis Jan 30 '15 at 18:56
• No, OP says the output signal will range from -3V to +3V. I assumed he was referring to the output of the opamp. He says nothing about the input. Yes, I did not mention anything about DC biasing, but you mentioned that in your answer already. I do also provide more intuitive information about how this virtual ground technique works as well as about the UNO. And, since OP has a dual opamp, why not use it? So why the downvote? – Shubham Jan 30 '15 at 19:07
• ->output, a typo. Still, -3V, as well as +3V always refer to GND unless explicitly stated otherwise - that's the convention. Either OP's mistaken, in which case the question hasn't many sense, or you're mistaken here. If the signal would go from -3V to +3V with reference to Vcc/2, we'd instead say it goes from Vcc/2-3V to Vcc/2+3V (which is the case you propose); it's impossible to get -3V/+3V swing with reference to GND on single-supply op-amp. Saying how to create a VGND doesn't answer the OP's question OTOH. – vaxquis Jan 30 '15 at 19:15
• I guess it wasnt so obvious I meant -3V/+3V relative to Vcc/2. The OP's question was whether you can create a negative supply, and that has also been answered many times. – Shubham Jan 30 '15 at 19:28