# Help selecting feedback and ground resistors for a gain and offset circuit

I have an input signal from -3.3V to 3.3V and the ADC I would like to use can only read from 0 to 3.3V.

I also have access to a stable source of power at 3.3V.

From previous visits, I have tried to read Carter's "Designing Gain and Offset Circuits" as best I can.

Based on:

• Vref = 3.3
• Vout fs = 3.3
• Vout zs = 0
• Vin fs = 3.3
• Vin zs = -3.3

I believe: my m = 0.5 > 0 and my b = 1.65 > 0. Thus, I am in Carter's first scenario (Carter's Figure 1):

simulate this circuit – Schematic created using CircuitLab

For R1, I have selected 10 kOhm. I have computed R2 to be the same 10 kOhm.

HELP:

1. (I think R1 = 10 k Ohm is OK, right?) [EDIT: Thanks for confirmation]
2. I do not know how to find Rf. Will a 10 k Ohm be OK?
3. When I try to compute Rg, I get 0 in the denominator! What resistance should I choose? [EDIT: Thank you @Michael ~ OK no resistor here]
4. Is the LM358 [EDITED @Dwayne Reid Thank you.] NE5532 is a reasonable amplifier for this project? If not, please provide some guidance.

• A 0 in denominator for R_g might suggest that the resistance should be infinite aka an open. If you analyze this for this situation, it's correct, you just need a voltage follower. R1 and R2 are a voltage divider that half the input voltage, giving you a value of 0.5 * (Vin + Vref), which in your case is exactly what you want. Commented Mar 22, 2020 at 6:16
• @Michael Thank you. Commented Mar 22, 2020 at 8:39

Let's analyze what you need to do.

1) Input voltage is plus minus 3.3V, reference supply is 3.3V. Your choice of resistors R1 & R2 is good. Check: if input is 3.3V, input to op amp is 3.3V. If input is zero Volts, input to op-amp is 3.3V /2. If input is -3.3V, input to op-amp is zero Volts.

2) Determine the total gain of the input resistor network. Inspection tells us that it is 0.5.

3) Determine the gain required from the op-amp.

I'm going to digress a little bit here. The LM358 is an okay op-a,p. but lousy input offset voltage error and a major problem here: the highest output voltage is about (Vdd - 2 Volts). IF you run the LM358 from a higher voltage than your 3.3V rail, you can make it work. But if all you have is that 3.3V rail, you need a different op-amp.

Now let's look at what gain you need from the op-amp.

From statement (1) above, the output voltage range of the input divider network 3.3V through 0V. Since that is also the desired output voltage range, the op-amp need a gain of (1.0) or unity gain.

It's really that simple!

• thank you for the quick reply. Do you have any opinion about the NE5532 opamp for this "gain" and offset application? Commented Mar 22, 2020 at 7:32

simulate this circuit – Schematic created using CircuitLab

Figure 1. Simplified solution.

You have worked out the offset / divider solution correctly and have a voltage follower with a gain of 1.

Your source impedance is the combination of the two 10 kΩ resistors in parallel - 5 kΩ. If you're ADC has an input impedance of 500 kΩ or more you can feed directly in without worrying about loading effects. No op-amp needed.

• Do note that 5 kΩ input impedance into a 500 kΩ ADC means 1% error, which is worse than 8-bit resolution. Of course, if the impedances are well controlled, you could do a correction in software. Lastly, an ADC I’m familiar with (the integrated one in STM32 microcontrollers) has a much lower impedance of only 50 kΩ, corresponding to a 10% error. So the use of an op amp may be indicated here. Commented Mar 22, 2020 at 13:59