How to bias a voltage for an ADC
Rearranging:


38 V maps to 3.3 V 
24 V maps to 1.65 V 
10 V maps to 0 V 








simulate this circuit &ndash; Schematic created using CircuitLab

Figure 1. An 11.5:1 potential divider.

The simplest solution is to use a potential divider with a ratio of 38:3.3 or 11.5:1. This would result in:


38 V maps to 3.3 V 
24 V maps to 2.08 V 
10 V maps to 0.868 V


The 0.868 V offset can be removed in software. Again, you lose a little resolution with this approach.

If a negative voltage supply is available then the offset can be removed.







simulate this circuit

Figure 2. With a negative rail available the offset at minimum input voltage can be removed.

How:


The span is 38 - 10 = 28 V.
This has to be scaled to 3.3 V so a divider ratio of 28 / 3.3 = 8.5:1. Let's use 7.5k and 1k to give us the required ratio.


Now we need to figure out the negative reference voltage.


At 10 V in Vout will be 0 V. With the 8.5:1 ratio we will need to hold Vref at \$ - \frac {1}{8.5} 10 = -1.18 V \$.


So, R1 = 7.5k, R2 = 1k, Vref = -1.18 V should do the trick.

I'll leave it to you to work out how to create the reference voltage.