# Ground in differential opamp situation

I have a setup like such in the provided schematic. The idea is that I do have a -2.5 to 2.5V signal which I'd like to convert to a signal between 0 and 5V.

How should I connect my opamp? Should the negative supply rail be connected to at least -2.5 (-5 in my schematic) or could it be from 0?

Would a situation like this result in a 0-5V output? To what is that 0V referenced in that case?

I hope my question is a bit clear but please let me know if I can provide any more details that you'd like to know to help me out.

• The circuit you show would not behave as you want it to, no matter where you connect the opamp's negative supply pin. You don't have any negative feedback to set the gain, which will result in it behaving as a comparator rather than as an amplifier. Commented Apr 30 at 9:53
• @brhans I think that's what I want. I would like to have the output of the opamp to be the difference between the two inputs. So the difference between the -2.5V supply and the -2.5V to 2.5V signal. This should yield me an output value between 0V and 5V. At least, that is what I desire. I guess that is comparing (comparator)?
– Mart
Commented Apr 30 at 11:32
• Is this output going to an ADC? Commented Apr 30 at 13:18
• yes, it is going to an ADC
– Mart
Commented Apr 30 at 13:20
• @Mart A comparator outputs a voltage close to the positive supply rail when the + input is higher than the - input, and close to the negative supply rail when - is higher than +. It is not a linear circuit that subtracts--it only answers the binary question "is in+ > in-?". Commented Apr 30 at 15:17

This circuit might suit your needs.

simulate this circuit – Schematic created using CircuitLab

Here is a sweep of output voltage vs input voltage.

The same sweep of output voltage vs input voltage can be accomplished with a single op-amp as well. However, the circuit above has the advantage that from the point of view of the input, the circuit appears as a 10 k$$\\Omega\$$ (or whatever value you choose) resistor to ground. With the single op-amp version, the circuit will appear as a resistor connected to the offset voltage, at least in the simplest configuration. Multiple op-amps in a single package are common.

• Five identical 10k resistors are really fun :-) Still, I would connect a 20k R2 to 5V power supply. Commented May 1 at 6:01
• @Circuitfantasist that would work as well. There are many ways to solve this problem. Commented May 1 at 11:11

Your circuit won't do what you want. It has no negative feedback, so the output will be either +5V or -5V, almost never in between. If you use an op-amp in this role, you must control gain with negative feedback, to obtain a controlled, analogue output.

If you don't mind losing some precision, the simplest way to convert a -2.5V to +2.5V signal to an exclusively positive range is with a simple resistor potential divider:

simulate this circuit – Schematic created using CircuitLab

This produces a signal between +92mV and +3.36V, corresponding to an input ranging from -2.5V and +2.5V. That's not the full 5V range, but it might suffice, without requiring an op-amp or a negative supply. You can calibrate (scale and offset) the value in software.

If you require a larger range, then you must have voltage gain, which mandates an amplifier. Be aware that no op-amp can produce an output that extends all the way to its supply potentials. For example, if you use a TLC2272 op-amp with 0V and +5V supplies, you cannot expect an output outside of the range +20mV to +4.98V or so. My suggestions below will output a potential in the range +50mV to +4.95V, corresponding to an input of -2.5V to +2.5V. You'll need to account for this slightly-less-than-unity gain in software. The op-amp you employ should have rail-to-rail output capability, such as the TLC2272.

This circuit requires no negative supply:

simulate this circuit

If you have access to a negative supply, -5V, then the resistor count can be reduced:

simulate this circuit

It seems simpler, but you'll probably have to use compound resistors in series or parallel to produce those unusual values, so there may be no real benefit. The above circuit also inverts, so the output goes from +4.95V down to +50mV as the input rises from -2.5V to +2.5V, which you'll have to compensate for in software:

The best output range I could obtain using only standard E24 resistor values is this next one:

simulate this circuit

This produces an output between +4.8V and +0.29V, as the input goes from -2.5V to +2.5V.

• Note the "no negative supply" example includes the wrong circuit. (It looks like a variation of the negative supply circuit.) Commented Apr 30 at 20:30
• @K.A.Buhr For some reason the editor replaced my second schematic (the no negative supply one) with a copy of one of the later ones. Thanks for pointing out the problem. Commented May 1 at 2:06

A differential amplifier with a gain of 1 and 2.5V as offset. Theoretically no need for a negative supply for the opamp, but if it has to go all the way to 0 it is properly needed.

• Maybe -2.5 V offset voltage to the inverting circuit input and Vin to the non-inverting circuit input? Commented May 1 at 5:05
• Tyassin, It is not a good idea to remain silent in such cases (if you want to become a respected contributor to SE EE). Commented May 2 at 15:13
• Hi sorry did not mean to be silent. If the original question was to shift a -2.5V to 2.5V input signal to 0V to 5V. Then I would do as I suggested. I don't fully think I understand the connections you suggest? Is it for another circuit or add on to the differential amplifier? Commented May 2 at 18:19
• I see... But you have a differential amplifier with only one of the circuit inputs (noninverting) used. Can't you also use the other (inverting) circuit input? It seems a better solution... Commented May 2 at 18:26
• OK..Yes it could give the same result. But then you need a negative supply. But yes you need an extra supply either 2.5V or -2.5V If you have a dual opamp package then you could use the other to make the 2.5V offset from the 5V supply and then a voltage divider. Commented May 2 at 19:04

# A need of circuit “philosophy”

The only thing that remains after these good specific circuit solutions is to summarize them by revealing the "philosophy" on which they are built.

For the purposes of these conceptual explanations, I will simplify the OP's task a bit: We need to make an input voltage that varies in the range of -5 V to 5 V…

simulate this circuit – Schematic created using CircuitLab

… vary in the range of 0 V to 10 V.

simulate this circuit

# Basic idea

But is not it best to reveal the most general idea first, and then discuss its specific implementations? Because ideas are something eternal that does not depend on specific implementations…

Obviously, the idea here is to add a 5 V offset voltage Voff to the input voltage Vin (Vout = Vin + Voff). Then, when the input voltage varies between -5 V and 5 V, the output voltage will vary between 0 V and 10 V.

# Implementation

Simply put, we need a summer to sum the two voltages. What is the simplest way to sum voltages?

## Series summer

Apparently, in series according to the KVL is the best way. To do this, we connect the two voltage sources in series, and the whole circuit to the load.

simulate this circuit

But what is the summer here? It is what remains after removing the input sources and the load, i.e. a piece of wire ("nothing").

simulate this circuit

However, there is a problem - the offset source is floating (ungrounded). If we simply ground it (e.g., through a 1 Ω ammeter SHORT), a short circuit occurs and a high 5 A current flows through Vin.

simulate this circuit

The short circuit disappears if we swap the two sources…

simulate this circuit

… but the "floating" input source does not suit us either; both sources must be grounded. However, then the load will be "floating"... and we do not want that either.

simulate this circuit

How do we solve this last problem? We need a device (an amplifier with a gain of 1) with a “floating” (differential) input and a grounded (single-ended) output.

simulate this circuit

This is the solution I proposed to @Tyassin in my comment.

## Parallel summer

The solution above needs an op-amp with differential input. But imagine that we have only an amplifier with a single-ended (grounded) input (that was a century ago).

Trying to connect directly Vin and Vref in parallel: Cannot we sum the voltages of the two sources by simply connecting them in parallel? It does not because they come into conflict and a high 5 A current flows.

simulate this circuit

Mitigating the conflict: So, we have to mitigate the conflict by connecting resistors R1 and R2 in series to voltage sources. What is the summer here? It is a little more "complicated" - the two resistors R1 and R2. This humble circuit deserves more attention; so let's examine it manually at three input voltage values:

Vin = -5 V

simulate this circuit

Vin = 0 V

simulate this circuit

Vin = 5 V

simulate this circuit

Finally, let's sweep Vin. What we see is that this circuit both attenuates (two times) and sums the input voltages, i.e. it is a weighted-input summer. As you can see, Vout (in blue) is two times smaller than above (ignore the orange curve; it is only to "cheat" the simulator autoscaling).

Amplified by a non-inverting amplifier: Then let's amplify 2x the output voltage.

simulate this circuit

This is the @Tyassin's solution.

Op-amp inverting summer: With the same success we can amplify the output voltage (current) with an inverting (transimpedance) amplifier.

simulate this circuit

The only problem is that it is inverted.

This is the left part of the @Math Keeps Me Busy's circuit solution.