# Temperature sensing

To build a feedback controller, you'll need a way to measure the error. This measurement is done by the sensor! In this case, we're controlling a temperature system so we need a temperature sensor. Theres a few options out there, each one good for certain applications, so we'll go through the different kinds and what we can expect

# But first...

The feedback controller uses the error in the output to determine what action to take. That means that the error has to be as 'correct' as possible. Its way more important to spend \$ on a good temperature sensor than on a controller or heater. (Not that those are not important things either but if you had an extra \$1…) Why? Because if your sensor accuracy varies by ±2°C then it doesn't matter too much if your controller has 0.1°C precision.

(From the very nice Wikipedia article on accuracy and precision

## Accuracy

This is what most people mean, its how close the sensor is to "Real Temperature". If a sensor is inaccurate to ±1°C that means that a measurement of 25°C (assuming everything else is perfect) could be anywhere between 24-26°C

Something that is inaccurate can sometimes be 'fixed' by calibrating it against a precise & accurate sensor.

## Precision

Precision is how 'repeatable' that measurement is - so if you have that ±1°C accuracy sensor and its precise to 0.1°C then a measurement of 25°C could 'really' be 24.3°C (because thats within the accuracy) but every time you get a reading of 25°C it will be no greater than 24.4C or smaller than 24.2°C - precision is the consistency of measurements.

If a sensor is imprecise, theres really not much you can do about it. A precise but inaccurate sensor can be calibrated, but each one must be calibrated individually since the inaccuracy changes from one to another.

So what is more important? Well, if you don't care what the temperature is, but you want to make sure it stays the same (steady) then precision is more important than accuracy. If you want the temperature to be exactly correct, then you need accuracy (and of course precision).

You may be able to calibrate sensors, if they are inaccurate, but it depends on whether the inaccuracy is consistant over the range ('its always 1°C too high') which makes it easy. Or if the inaccuracy varies ('its sometimes 1°C too high and sometimes 1°C too low'). Of course, if you have a digital lookup table and a precise but inaccurate sensor you are good to go - just tabulate each entry you want with the actual reading

# Different sensors to choose from!

Here are the most common sensors we'll look at

## Thermocouples

Thermocouples are extraordinarily common for use as temperature measuring devices. They have a lot of 'pros' to them - including huge range (more than 1000°C!) and interchangability (all K types are the same and can be swapped out). They're common and cheap and if you don't care too much about accuracy they're fine. If you need to measure hot things, they're your only choice!

In particular here I'll refer to K type. J type is also common and T is more accurate but the off-the-shelf chips are for K (and J) and so that's what hobbyists like

### Accuracy & Precision

K type thermocouples have accuracy of 2.2°C (±1.1°C) or 0.75% (whichever is higher) and precision of about 0.5°C (±0.2°C)

Because the voltages across the wires are so small (in the uV range!) the precision probably has more to do with your amplifier and any hash (noise) pickup than with the thermocouple itself.

I find it confusing that products like the Thermapen have 0.1°F precision displays when the product accuracy & precision is almost certainly much lower (that is, less precise). If anyone understands this, would appreciate an explanation.

### Range

K thermocouples can be used from -350°C to 1350°C - a huge range which is basically the big plus. J type can go up to 750°C

### Amplifiers & Interfaces

The MAX6675 has a resolution of 0.25°C.

However, the error (inaccuracy?) is about +-8 LSB. 2*8*0.25°C = 4°C (±2°C) that should be added on TOP of the ±1.1°C / 0.75% sensor probe inaccuracy

### Pricing

Thermocouples themselves can be had for cheap - we've seen K-type for \$3/each. They're also incredibly common, available anywhere you can get a multimeter (multimeters often have them as probes)

The expensive part is the amplifier - unless you're going to build your own (which is hard, you need extremely low bias and low offset input amplifiers) the chips will cost you about \$13