# What circuit can be used to match input to output voltage by using an opamp?

What is the simple way matching an input voltage range to a desired output range.

To be more specific with an example: If I want to convert/match 0V-5V input range to 7V-15V output range linearly, is it possible to do it with an opamp, feedback and a potentiometer ect? I can use a +/-15V dual supply. What should be the topology?

• Related, if not a duplicate: electronics.stackexchange.com/q/115502/65586
– user65586
Sep 28, 2018 at 20:05
• Uhmmm... First you add 7 volts to your signal, then amplify with a value <1, else your output would be 7V-12V. That's the short answer. Look at other designs to get ideas. Come up with something and we will help you with it. Please understand we do not do "Designs on demand".
– user105652
Sep 28, 2018 at 20:35
• How about if I amplify 0-5V by 1.6 gain and then shift it by +7V. The question is how to implement though. 5*1.6 +7 = 15V and 0*1.6+7 = 7V. This mathematically matches but I need an implementation if can be done with this logic.
– cm64
Sep 28, 2018 at 20:47
• You changed the output range from 7V - 11V to 7V - 15V. Are you certain that is what you want? +15V is the limit of your power supply, and you would need an op-amp with rail-to-rail output swing. Many op-amps will accept offset power supplies like +24V/-5V or +18V/-12V.
– user105652
Sep 28, 2018 at 22:07
• yes but 14V is also fine if 15 impossible. I can buy a rail to rail opamp for 15V.
– cm64
Sep 28, 2018 at 22:32

One topology that works in general is to create a standard differential amplifier setup using two pars of resistors having the same ratio.

Let...
VIL = the lowest input voltage
VIH = the highest input voltage
VOL = the desired output voltage when the input is VIL
VOH = the desired output voltage when the input is VIH

Configure the gain to be...
G = (VOH - VOL) / (VIH - VIL).
The resistors are set such that...
R2 / R1 = G

A reference offset voltage VREF is chosen such that...
VREF = VOL - G * VIL

VREF can be derived either from a dedicated buffered reference voltage or a Thevenin equivalent circuit whose output impedance is equal to R2. For example if R2 were 100K and you needed the offset to be 2.5V and you had a 5V supply; then you could split R2 on the positive side into two 200K resistors (one attached to 5V and the other to GND)

The circuit is shown below...

simulate this circuit – Schematic created using CircuitLab

NOTE: If you need G to be negative then you can put the input on the negative side R1 and put GND on the positive side R1. If you need the input to be differential then connect the positive and negative sides of the differential signal to the pair of R1s.

For your specific case you need a gain of 8V / 5V. You can use...
R1 = 4.99K
R2 = 8K = 7.5K + 499 ohms

To make an offset of 7V you have two options.
1) Make a regular voltage divider and buffer it with an op amp setup as a voltage follower. The obvious choices for the divider are 8K (7.5K + 499) and 7K (6.98K).

2) Use a pair of resistors that form a 7V voltage divider with 15V, and have a parallel output impedance of 8K. For this approach we have two equations and two unknowns..
EQ1: 1 / R2a + 1 / R2b = 1/R2

EQ2: VCC * R2a / (R2a + R2b) = VREF

Solving both equations gives...

R2a = R2 * VCC / VREF = 8K * 15V / 7V = 17.14K.
R2b = R2 * VCC / (VCC - VREF) = 8K * 15V / (15V - 7V) = 15K.

• Can this opamp really go to 15V when supplied with +-15V supply?
– cm64
Oct 1, 2018 at 11:59
• @cmd64 No op-amp is going to get all the way to the supply, but depending on the op-amp it may get pretty close. The schematic was not intended to recommend a specific op-amp. I deleted the part number that was shown. Oct 1, 2018 at 13:35

## Problem is reduced to GAIN, OFFSET

• and reduce drop from Vdd at max output using single supply, Vdd=15V

Vi:input range = 0V~5V
Vo:output range = 7V~15V

GAIN$$\ = 1.6 =\frac{ΔVo}{ΔVi}=\frac{8}{5}\$$ using Vin- with negative feedback R ratio, relative to 0V.

• then using non-inverting input for offset and signal
• choose balanced differential Op Amp

OFFSET = Vo = 7V= Vref

when $$\\small {Vi=0V} , ~~let~~ \frac{V_o{min}}{Vdd} =\frac{7V}{+15V} = \frac{R4}{(R4+R5)}\$$

• $$\Av- = \frac{R2}{R1} = 1.6 \$$
• then solve Vout when Vi=0V, 15V with convenient matching ratios.
• $$\\frac{V_{o(min)}}{V_{i(min)}}=\small{gain~ + ~ offset =}\frac{15V}{5V}k_1+V_{ref}k_2= V_{ref}*\frac{(R4||R5) }{ R3+(R4||R5)}*\frac{R1+R2}{R1}\$$
• Since R2/R1 has many solutions, start with a convenient one and pick 0.1% or higher other parts. RRO Op Amps prefer high R loads.>>10k and you want to get as close to 15V Rail as possible, for some reason.
• Solve

## Solution

TRUST but VERIFY

QA1 is used to set the 1.6 gain on the input voltage.
QA2 is just inverting.

V4 is the input, a 0 to 5 volts sine wave.

The output is a 7 to 15 volts sine wave.

simulate this circuit – Schematic created using CircuitLab

Or you can use the next circuit, it has a higher input impedance.

QA4 is the voltage source.
QA1 does the gain and offset.

simulate this circuit

• Can this opamp really go to 15V when supplied with +-15V supply?
– cm64
Oct 1, 2018 at 11:59
• No. This is not a rail to rail op amp. You would have to choose another one. The circuit would be the same though. You can use a TS912 , it can go to +-16 V and it is rail to rail: st.com/resource/en/datasheet/ts912.pdf Oct 1, 2018 at 12:35
• I have access to this docs-emea.rs-online.com/webdocs/1385/0900766b813852e8.pdf Can this be used as well?
– cm64
Oct 1, 2018 at 13:00
• Yes. Have a look at Output Voltage Swing. If you use +-15V, depending on the load you could get as much as +-14.5 V. But since this part handles 44 V, you can easily stretch +-Vcc to +-16 V and get proper 7-15 volts excursion. Oct 1, 2018 at 13:56
• I suspect you don't need this many active stages to achieve the same effect. I'll post an alternate later. Oct 1, 2018 at 14:47

Here's a quick and dirty way to do it. You can calculate the positions of the pots if you want, but it's probably faster to just build it, give it a test signal, and tweak it until it measures right.

simulate this circuit – Schematic created using CircuitLab

The extra arrows on the pots represent clockwise rotation of the knob, or upward movement of a slider. Offset has a little bit of influence on Gain, but the ratio of values keeps the interaction fairly low.

If you've had a basic course in opamp circuits, you might recognize this as a non-inverting amplifier, but with the gain network replaced by a pot to make it variable, and the ground (actually reference) terminal replaced by another pot to make it variable also.

This might also be a good way to show that an opamp itself has no concern whatsoever for "ground" as we call it. Its sole job is to move the output as needed to make the two inputs equal, within the constraints of its power supply of course, and in the direction specified by the input polarities. Ground does not appear anywhere in that job description.

Here's another way to do it, based on an inverting amplifier.

simulate this circuit

If you need a non-inverted output, then you'll need to add another inverting amp, exactly per the textbook, either up front to feed this or at the end to correct it.

And finally, one more way to do it, based this time on a summing amp, which is itself based on an inverting amp.

simulate this circuit

It works a little bit differently than the other two in that the offset is treated as its own legitimate input, whereas the other two change the reference that their single input is compared to.

Not all of the adjustments shown are necessary; Gain_offset and one of the other two Gains could be fixed, leaving two real-time adjustments just like the other two circuits. This simply shows what's possible.

The loop back from the wiper to an end terminal is basically a functional safety net. It'll work exactly the same way without it...until the pot fails. At that point, you have a choice of open-circuit (infinite resistance) if you didn't use the loop back, or full-valued but finite resistance if you did. Either way, the wiper is required; it's the end terminal that's optional.

And here's one more interesting little bit. While keeping the operation linear, you can make the controls logarithmic (audio) in the last circuit by replacing the Gain_in and maybe Gain_offset pots with this.

simulate this circuit

This works because the summing node is held at 0V by the opamp (provided it's not saturated of course), and so the 20k resistor is effectively to the same 0V as the pot. Given a constant input, a loaded pot like this produces a response in between itself and the load that, with the ratio shown, pretty well approximates an audio volume control. Feed that through the standard model of a summing amp, using that intermediate voltage and the load resistor only, and you'll see that the idea works.

To look at signal linearity, as you asked for originally, you keep the pot constant and simplify the circuit, splitting the pot into two resistors in series, combining the lower one in parallel with the summing resistor, etc. So you should be able to see that the signal response is still linear; it's only the control response that isn't.

Note: There is no attempt to match the range of controllability between these circuits. The values shown are somewhat real-world, but still very much nominal.

We can make this quite simple. This can be done with one stage, assuming that you have low output impedance in the previous stage:

The resistor values can be found by the following relationships:

$$\ \frac {R_4} {R_3} = \frac {1.6 \cdot 15} 7 \$$

$$\ \frac {R_2} {R_1} = \frac {16} {15} \$$

It's then a matter of choosing resistor values that will be easily available in the E24 series. These ones get to 0% and 0.3%, respectively, before taking into account component tolerance.

And it works:

You will need a rail-to-rail op-amp, and depending on your desired frequency response you should also add capacitors across R4 and R2.

• What is V3 in real?
– cm64
Oct 2, 2018 at 0:29
• @cm64 That's just a way to get a sine wave between 0 and 5V. In real life that wouldn't exist as a physical supply. Oct 2, 2018 at 0:30