# Mapping a voltage range to whole ADC range using opamps

I want to use a micro for measuring temperature using PT-1000 sensor for range -40C to 150C. I have come up with these draft information, I appreciate it if a pro person can confirm my thoughts are OK before I pay a lot for parts and PCB and fail miserably.

The ADC of micro is 3.3V and 12bits. so it means 0V willl be 0 and 3.3V will be 4095 (in an ideal world?)

I have checked the PT1000 LUT, it seems that at -40C it has 842.7 Ohms and at +150C it has 1573.3 Ohms.

so I need to adjust this range for my ADC input. e.g. at -40C the ADC should show 0 and at 150C it should show 4095.

Here is the initial voltage divider, I chose R25 to be 10k to limit the current and possibly noise as well? so at -40C and +150C the voltage going to the input of first opamp will be: $${V_{-40} = \frac{3.3\times842.7}{10k+842.7}= 256_{mV}}$$ $${V_{+150} = \frac{3.3\times1573.3}{10k+1573.3}= 449_{mV}}$$

So I need to map 256mV to 449 mV to approximately 0V to 3.3V, hence the amplification stages here:

For mapping -40C to 0V I have (dont mind the values in the picture, they are not up to date) R26 = 33k and R27 = 2.7k, which yields: $${V_{out} = \frac{3.3\times2.7k}{33k+2.7k}= 249_{mV}}$$ which is 6.4mV less than 256mV (I choosed the resistor based on E12 range)

And finally I need a gain of 7.34 to map 449mV to 3.3V: R30(feedback) = 68k, R28 = 10k Therefor gain = 68k/10k = 6.8x

So again, before I pay lots of money for PCB and components, do you think I will achive what I need?

• What you need to do is to subtract the lower voltage (256mV for -40C.) Then, you must multiply by the range. You have chosen to calculate the gain needed to get 3.3V out of 449mV. That is wrong. Once you subtract 256mV from the input, you only have a range from 0 to 193mV, so you need to calculate the gain to get 3.3V from 193mV
– JRE
Aug 24, 2016 at 9:25
• @JRE Thanks, but I did not understand your point I am afraid. You mean the value of the resistors are wrong or the connection of opamps are wrong? Aug 24, 2016 at 9:29
• You want to change the range from (256mV to 449mV) to be (0V to 3.3V.) You must first subtract 256mV from your input value. Then your gain is 3.3V/(449mV-256mV)= 3.3V/193mV=17.1
– JRE
Aug 24, 2016 at 9:31
• Also, it would be foolish to try and use within 50 mV of 0V or Vref for an ADC as generally offset and gain errors will create deadbands in these regions. Read the data sheets. Aug 24, 2016 at 10:17
• TI's Designing Gain and Offset in Thirty Seconds may be of interest (if you have half a minute). Aug 24, 2016 at 10:58

You are ill-advised in using the lower 50 mV and the upper 50 mV of an ADC's range unless the details in the data sheet assure you that the zero offset, gain error and reference errors allow part of these regions to be used. It is my experience that you will never find an ADC that realistically specifies 0 to Vref as the full input range even if it says so on page 1 of the data sheet.

Gain error: -

Offset error: -

So, estimate the usable range of the ADC and rework your formulas taking into account op-amp offset errors. I would recommend using LTSpice (free from LTI) to double check your values.

Alternatively just use the range as it i.e. 256 mV to 449 mV - this as a percentage of 3.3 volts (Vref) is 5.8% or, for a 12 bit ADC, 239 bits of resolution. This is 1.26 LSBs per degree and if you want more resolution (not accuracy of course) then take multiple samples and average. Noise will cause the values to dither and you get process gain by this action that gives you a resolution significantly greater than that implied by 12 bits.

If you are unhappy with that just use an amplifier to raise the 449 mV to about 3.25 volts (a gain of 7.238). Your new map will be: -

• 256 mV ==> 1.853 V
• 449 mV ==> 3.250 V

That will use 1.397 volts of the 3V3 range of the ADC or 9.13 LSBs per degree C.

Don't get hung up on maximizing the range and incurring extra errors due to resistor tolerances etc. Think simple and think accuracy/drift.