# Measuring temperature with a PTO and a microcontroller

I want to measure temperatures in a home oven using a resistance thermometer and a microcontroller.

A simple circuit that is often used is a voltage divider feeding an ADC pin.

Other circuits include a Wheatstone bridge and constant current sources. I have also seen circuits using an op-amp ahead of the ADC.

Finally there seem to be chips designed especially for this purpose such as TI's ADS1248 .

What I am looking for is a pointer to a good discussion of the tradeoffs between these various approaches and when one might choose one approach over another. In particular how does one approach a "balanced" solution in that it would make little sense to use a high precision op-amp ahead of a low-bit ADC. for example.

-

You first need to decide what resolution you need over what temperature range, and everything is just math that follows from that.

I would start with seeing if connecting the thermistor to ground on one end and a pullup on the other, then the junction of those two into a microcontroller is good enough. The analog voltage will be non-linear in various ways, but temperatures don't change fast so the micro can apply a large amount of math to ultimately get you degC, degF, or whatever.

From the min and max temperatures you want to measure and the thermistor datasheet, you can find the min and max thermistor resistance values you need to deal with. Size the pullup so that the min and max values result in voltages about equally far from center. The pullup resistor method will have the most thermistor resistance resolution in the center of the range. Another way of saying this is you will be measure the thermistor resistance most accurately when it has the same resistance as the pullup resistor.

Do the math and determine what the resistance step per A/D count is at each end of the range, then figure out what temperatures those correspond to and therefore what temperature delta one A/D count represents at the min and max points. You can easily get micros with 12 bit A/Ds built in. If this computation tells you the worst case temperature resolution is good enough with 12 bits, then that's all you need for electronics and the rest is math in firmware.

Note that resolution and accuracy are two different things. The electronics thru to the A/D must have at least your minimum required resolution. The accuracy might be worse depending on the accuracy of the thermistor and the pullup resistor. If you can test the unit in known temperatures, then you can calibrate out this accuracy with constants in the math in the firmware.

-
Olin, thanks for the information. Would you be willing to elaborate and discuss alternatives beyond just a voltage divider? –  JonnyBoats Oct 19 '11 at 3:23
@Jonny: All the other methods are more complicated, so you should do the math first and see if a simple voltage divider is good enough. You can use a current source to measure resistance linearly. Note that resistance may not be lineraly proportional to temperature, but this might still give you a more uniform resolution accross the temperature range. It would help if you gave some specifics of what range you are trying to measure, what resolution and accuracy you need, and a link to the thermistor datasheet. –  Olin Lathrop Oct 19 '11 at 11:29