In concluding this series on temperature measurement, I thought I should mention a few gotchas that got me. Thermocouples can have all kinds of packaging around the junction to make them easier to handle and to affix them to the heat source, like a metal clip. Sometimes the junction contacts the metal (intentionally), so when it is connected to some metal like a boiler, the thermocouple is grounded. The thermocouple will still work, but if either of the connections will not tolerate a ground connection -- beware. I used a full wave rectifier to generate DC power on my board, which meant that its 0V was a diode drop from ground. It released the magic smoke from the diode bridge.
A thermocouple junction encapsulated by a mounting tab. The yellow connector indicates a K type thermocouple and will fit into any thermocouple thermometer. The connector will be black for a J type, blue for a T type, purple for an E type, and so on.
Thermocouple wires are colored to indicate the type, with the negative wire of the pair always marked counterintuitively as red. A lot of instrumentation uses thermocouple connectors (see figure above) where the pins are made from the same alloy as the thermocouple wires. They are also colored for the thermocouple type, but if you read the Agilent application note (and many others), it becomes apparent that the actual connector is not necessary if you are designing your own equipment. It will transition to copper somewhere, and the resulting thermocouples will null out. And always make sure you have a resistor from the negative line of the thermocouple to 0 V of your design. Frequently, op-amps/instrumentation amps won't give you the desired result without it.
Beware of what exactly you are sensing, as in the case of the DS18S20. Sometimes it helps to bond the sensor to the object with thermally conductive epoxy. This is relevant to measuring the cold junction temperature. Since the cold junction sensor should be measuring the temperature of the actual connector contacts of the thermocouple wires, just having the sensor on the board next to the connector may contribute to an error due to thermal air currents and board conduction (to say nothing of self-heating of the sensor if it is a thermistor).
Finally, we all need to consider calibration. In designing the electronics, it is preferable to have some kind of source that you can use to simulate the temperature and take all the way through its range. As a hobbyist, you could make a simulator using resistors and pots (for thermistors and RTDs) and a resistor divider and pots for a thermocouple (and a very good DVM). If you are doing this professionally, you really need a calibrator. There are dedicated calibrators like those made by Altek. I must say that one of the most essential pieces of equipment I have is the model 741 general-purpose calibrator from Fluke.
Having said that, there is a bigger problem in the calibration of an onboard temperature sensor, irrespective of sensor technology. When you build the device, how do you know what the temperature is at the sensor? Do you work on ambient? How accurate is the thermometer you are using? And on and on. You can get a flavor of the results from Max Maxfield's blog on EE Times (a sister site), I'm becoming hot and bothered….
My question to all the readers: What devices do you use to measure temperature? What advantages do you perceive in those particular ones?