5
\$\begingroup\$

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. Schematic with opamp setup

\$\endgroup\$
7
  • 5
    \$\begingroup\$ 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. \$\endgroup\$ Commented Apr 30, 2024 at 9:53
  • \$\begingroup\$ @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)? \$\endgroup\$ Commented Apr 30, 2024 at 11:32
  • \$\begingroup\$ Is this output going to an ADC? \$\endgroup\$ Commented Apr 30, 2024 at 13:18
  • \$\begingroup\$ yes, it is going to an ADC \$\endgroup\$ Commented Apr 30, 2024 at 13:20
  • 3
    \$\begingroup\$ @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-?". \$\endgroup\$ Commented Apr 30, 2024 at 15:17

4 Answers 4

4
\$\begingroup\$

This circuit might suit your needs.

schematic

simulate this circuit – Schematic created using CircuitLab

Here is a sweep of output voltage vs input voltage.

enter image description here

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.

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

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:

schematic

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:

schematic

simulate this circuit

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

schematic

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:

enter image description here

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

schematic

simulate this circuit

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

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Note the "no negative supply" example includes the wrong circuit. (It looks like a variation of the negative supply circuit.) \$\endgroup\$ Commented Apr 30, 2024 at 20:30
  • \$\begingroup\$ @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. \$\endgroup\$ Commented May 1, 2024 at 2:06
0
\$\begingroup\$

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.

enter image description here

enter image description here

\$\endgroup\$
7
  • \$\begingroup\$ Maybe -2.5 V offset voltage to the inverting circuit input and Vin to the non-inverting circuit input? \$\endgroup\$ Commented May 1, 2024 at 5:05
  • \$\begingroup\$ Tyassin, It is not a good idea to remain silent in such cases (if you want to become a respected contributor to SE EE). \$\endgroup\$ Commented May 2, 2024 at 15:13
  • 1
    \$\begingroup\$ 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? \$\endgroup\$ Commented May 2, 2024 at 18:19
  • \$\begingroup\$ 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... \$\endgroup\$ Commented May 2, 2024 at 18:26
  • 1
    \$\begingroup\$ 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. \$\endgroup\$ Commented May 2, 2024 at 19:04
0
\$\begingroup\$

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.

The task

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…

schematic

simulate this circuit – Schematic created using CircuitLab

STEP 1.1

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

schematic

simulate this circuit

STEP 1.2

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.

schematic

simulate this circuit

STEP 2.1

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").

schematic

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.

schematic

simulate this circuit

The short circuit disappears if we swap the two sources…

schematic

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.

schematic

simulate this circuit

STEP 2.5

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.

schematic

simulate this circuit

STEP 2.6

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.

schematic

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

schematic

simulate this circuit

Vin = 0 V

schematic

simulate this circuit

Vin = 5 V

schematic

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).

STEP 3.3.1

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

schematic

simulate this circuit

STEP 3.3.2

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.

schematic

simulate this circuit

The only problem is that it is inverted.

STEP 3.3.2

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

\$\endgroup\$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.