Sensor Temperature – Cheap Temperature Sensing with MCU


I am looking for a cheap solution for sensing temperature with a MCU. My requirements are:

  • 2 channels
  • temp range: 30-35°C
  • temp resolution: 1-2 K
  • cable distance (MCU -> sensor) 10cm – 2m are acceptable
  • relative temperature between two channels is sufficient, no absolute temperature is required

My starting point is two thermocouples with thermocouple amplifiers, but this seems to be overkill for my application. Thermocouples run at 10$ at Radiospares, amps at 5$ which would cost 30$ just to estimate a temperature.

What is a good direction to look for a cheaper solution. NTCs?

Edit 18 July 2012

After stevenvh extended his answer to show the high degree of linearity that can be obtained with NTCs, I invested some time to reconsider whether NTCs are not a better solution.

I am not sure however that I am able to follow stevenvh in his reasoning on the error that can be obtained with NTCs on the cheap compared to semiconductor chips.

To get the temperature with an NTC the following functions come into play:

  1. transfer function \$ H_{T_a\rightarrow R_{NTC}}(R_{25},B_{25/85}) \$ converting the ambient temperature to a resistance
  2. the voltage produced by the voltage divider \$ H_{R_{NTC}\rightarrow V}(V_{excitation},R_{NTC}, R_{lin}) \$
  3. AD conversion \$ H_{V\rightarrow bits}(V, V_{ref}, \sigma_{conversion}) \$
  4. linear curve approximation: \$ H_{bits\rightarrow T_{est}}(bits, \sigma_{approx}) \$

The error sources the I see are thus:

  1. NTC value errors: 1% each for the \$ R_{25} \$ and the \$ B_{25-85} \$ values: total about 2%
  2. 1% for the linearisaton resistor value and let's say 0.5% for the excitation voltage source
  3. For a PIC16F1825 the internal reference voltage used for the ADC has 6% uncertainty. In addition, the ADC itself has integral, differential, offset and gain errors each of the order of 1.5 lsb. At 10 bits, the latter combined are at most 0.5%.
  4. As stevenvh demonstrated in his answer, the linear approximation has an error of merely 0.0015% in the range of interest.

The error in the estimation of the temperature will thus clearly be dominated by the error of the ADV voltage reference and the errors in the resistor values. It will clearly be in excess of the 6%. The error due to linear approximation is utterly negligible as stevenvh pointed out.

An uncertainty of 6% at 300 Kelvin is equivalent to an temperature error of 18K. The temperature chips have an error of about 1K. At 300K this corresponds to an uncertainty of 0.3%.

It would appear to me that it is out of the question to beat this with an NTC without extremely careful calibration and performance verification. The uncertainty in the linearisaton resistors, the excitation voltage or the ADC each viewsed in isolation push the uncertainty of the NTC solution above this. Or do I have a major mistake in my reasoning?

At the moment I am convinced that NTCs can be a high-precision temperature sensing solution but on the cheap it would appear to me that their performance will be a shot in the dark.

Best Answer

1-2 degrees is an easy resolution (even when you mean accuracy, which is not the same!). I would consider LM75 and it various clones, or a DS1820/18S20/18B20/1822. Microchip has a lot of temperature sensors, including LM75 clones for < $1. The voltage output versions are cheap, but I would prefer a digital one.