Electronic – Voltage shift via op amp circuit

analoglevel-shiftingoperational-amplifiervoltage divider

I can't figure out a valid circuit for the following conditions:
I have an input signal varying from 0 V to 3 V. My ADC's voltage reference is 2.048 V. I only care about the input voltage starting from 0.768 V and ending at 2.048 V + 0.768 V.

So 0.768 V at the input (and bellow, since I have no negative voltages in the circuit) gives 0 V at the output.
2.816 V at the input (or higher) gives 2.048 V at the output.

So in practice, I just need to somehow offset the output signal by 0.768 V down (VOUT = VIN – 0.768 V assuming 0V is the minimum value).

enter image description here

I tried to set this up with a non-inverting level shifter circuit, but with no luck- is it the right direction?

enter image description here

Best Answer

This can be very simple, and you only need one op-amp and four resistors. Given the values I've shown, assuming ideal components the solution is exact. As a hint on how to get to this solution, attempt to solve for two cases: the first for when the output is zero, and the second for when the output is equal to Vref.

schematic

simulate this circuit – Schematic created using CircuitLab

To get here:

If \$ V_{out} = 0 \$ , \$ R_3 \$ and \$ R_4 \$ form a voltage divider, \$ R_1 \$ and \$ R_2 \$ form a voltage divider, and \$ V_{in} = V_{off} \$ :

$$ V_n = \frac {V_{ref} R_4} {R_4 + R_3} $$ $$ V_p = \frac { V_{off} R_2 } {R_2 + R_1 } $$ $$ V_n = V_p \text{, so}$$ $$ \text{I. } V_{ref} R_4 \left(R_2 + R_1 \right) = V_{off} R_2 \left(R_4 + R_3\right) $$

If \$ V_{out} = V_{ref} \$, there is no current through \$ V_n \$ so

$$ V_{out} = V_{ref} = V_{p} = V{n} $$

$$ \text{II. } V_{ref} \left(R_2 + R_1 \right) = \left(V_{ref} + V_{off} \right) R_2 $$

Assign \$ R_1 / R_2 = a \$, \$ R_3 / R_4 = b \$ and you will find that \$ \text{I} \$ and \$ \text{II} \$ form a system of two equations, two unknowns. After a little algebra you will end up with

$$ \frac {R_1} {R_2} = \frac {R_4} {R_3} = \frac {V_{off}} {V_{ref}} $$

There's probably an easier way to get this, but the above works from first principles.

You can co-scale R1,R2 and R3,R4 as desired. Since 3k and 8k are not E24 resistors, using (e.g.) 75k and 200k will still be exact but will be more accessible.