In the interest of getting my hands dirty with a bit of analog circuitry, I am trying to convert a 13V - 9V voltage swing of a battery to the 0 - 3.3V measurable by the adc of my mcu.
Now I realized that a simple voltage divider with a division 4 would give me a one volt swing, so the 12 bit adc of the mcu would give me more than enough data, but this is more a learning exercise than a practical engineering challenge.
My Idea was to:
Take the 13-9 voltage swing
Divide it by 3 to yield a 4.34 - 3 V swing using a voltage divider
Use a simple opamp buffer as to not load the divider
Subtract 2.8 V from it using a differential amp, yielding a 1.5V to 0.2 V swing
and then amplify the signal by 2.1, yielding the desired 3.15 to 0.42 V swing.
The voltage divider and buffer are easy enough to implement. The multiplication by 2.1 can be achieved using a non inverting amplifier.
It is the subtraction of 2.8V that is proving to be challenging.
My idea was to setup a differential amp with a gain of 1, and set the non-inverting input to the 2.8V. This would however require a relatively precise 2.8V. I could implement a zener voltage reference, but that seems to be a very complex solution to a simple subtraction.
Is there a better way to scale this signal? I have a 5V and a 3.3V rail available.
Even if there is, Any ideas on how you could subtract 2.8V from a signal, that is not a differential amp?