# Amplifier Gain and Offset (Positive m and Negative b)

My question is regarding gain and offset of an amplifier.

simulate this circuit – Schematic created using CircuitLab

I've used various references however I believe the circuit I want to build is somewhat unique in which I want to convert an input voltage from a sensor which ranges from 2-4 volts. I want to convert the 2-4 volts so that my amplifier output is from 0-10V where 2V corresponds to 0V and 4V corresponds to 10V.

I read through the following post Can someone explain this gain & offset op-amp circuit? and read the famous TI document.

After calculating my "m" (gain) I essentially got m=4.8780 and after calculating my offset "b" I got b=-10.6439.I then proceeded to calculating the necessary resistor values other than Rf which I selected as 51.1k just because I needed to start somewhere in order to proceed with the calculation in this document.

Here's the problem, I'm generating error in my output (i.e. instead of out seeing 10V at the output when 4V is present at the input I receive 13V (that's a 3V diff and a significant error %). How can I remove or remedy this so that I get closer to a 10V output (same goes for 2V input. Instead of seeing 0V I see approx 3V at the output. I can post the math if someone needs to see it however looking at the equation I don't see which of the resistor is actually having a huge effect on this error. How can this be remedied?

Note: On paper the math works out however I'm wondering if Pspice/TINA Ti is having an issue simulating this.

I don't know where you got the numbers from. Your circuit should give you (1+51.1/11.9) * 2V + 2V out with 4V applied, which is 12.59V out, and 2V out with 2V applied. You can easily run the simulation in Circuitlab if you want (flip your power supplies first, they are reversed).

You want a gain of 5 (2V change = 10V on the output) so the resistor ratio must be 4:1. Say you use 40K and 10K.

For offset to 0 for 2V in, note that the gain is -4 (as compared to +5) from the inverting input so you need to apply 5/4*2V = 2.5V to the 10K resistor, as shown below:

simulate this circuit – Schematic created using CircuitLab

• I was a little off on the voltages I displayed my apologies. The correct values should be 2.18-4.23. Forgive my opamp voltages as I never used CircuitLab which was also giving me issues simulating your circuit. I tried your circuit in TINA-TI and Pspice and it worked fine. My only issue is I was a little thrown off by the equation you displayed. – cylus Feb 24 '16 at 3:10
• You initially stated for the non-inverting input "(1+51.1/11.9) * 2V + 2V out with 4V applied", where I thrown off by is the additional 2V that is added. Is this the difference between my input voltage of 2-4V to the positive input of the opamp. If so, then looking at your circuit, the formula for Vout = (1+R1/R2)*V2+(V2H - V2L) with V2H = V2 High and V2L = V2 Low, correct? Also how do you assume I need a resistor ratio 4:1? – cylus Feb 24 '16 at 3:10
• Using your component names, gain ($\Delta$ Vout/$\Delta$ Vin) from non-inverting input resistor (1+Rf/Rg), output will be V3 volts when input is V3 volts (offset). Since you need a gain of 5, Rf/Rg = 5-1 =4. Vout = (1+Rf/Rg)Vin - (Rf/Rg)V3. – Spehro Pefhany Feb 24 '16 at 10:43