Hi,
not great at analog and op-amp design... and I am trying to measure a voltage that varies continuously from 10V to 24V from the ADC in a micro that only runs at 3V3.
Is there a way to map the input voltage range of 10V to 24V output to an output voltage of 0V–3.2V using only a single supply op-amp that runs only from the 3V3 rail?
In other words then the input voltage is 10V the output is 0V and when the input voltage is 24V the output is 3.2V.
Thank you
A very simple voltage divider would shift [+10 to +24 V] to [+1.33 to +3.20 V]: would that be good enough for your application?
An op-amp can be used. The x-axis of the simulation is the input voltage V1, which is swept from 10V to 24V and y-axis is the output.

I used the website linked below to help me design it.
https://earmark.net/gesr/opamp/gain_offset.htm
Thank you both!
@Zero999 that schematic is exactly what I was looking for. Thank you. What simulation tool did you use?
@TimFox a voltage divider would not work because of the ADC resolution.
Thank you
Yes, with the simple solution (no applied offset) you would lose about 40% of the digital output range of the ADC. For some applications, that might be OK for a cheap solution.
Thank you both!
@Zero999 that schematic is exactly what I was looking for. Thank you. What simulation tool did you use?
@TimFox a voltage divider would not work because of the ADC resolution.
Thank you
I used LTSpice to simulate the circuit. It's freely available.
If you're concerned about accuracy, then use a proper voltage reference, such as the TL431, rather than the supply voltage for the reference.
https://www.ti.com/lit/ds/symlink/tl431.pdfJust use 2.495V or whatever for Vref in the calculator. It's the ratio of the resistors which matter, rather than the values. I multiplied them all by 1000, because the low values it generates would use a lot of power.
https://earmark.net/gesr/opamp/case8.htm
To add to what Zero999 posted above, it's recommended that you use the reference voltage for the ADC to create the offset voltage. For example in that circuit if the 3.3V 'ref' net is the reference for the ADC, then all is good. But if the ADC actually uses another reference voltage, then any drift between the two references will show up as measurement error. It's even possible for you to end up with worse accuracy/precision than a simple voltage divider with no offset.
If you tell us specifically what MCU you are using we can give more specific guidance.
Thank you both for the additional very useful information!