Take the 2-minute tour ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

I'm trying to interface to a type-K thermocouple with an ATXMEGA128A4U and have been experiencing some difficulty and I'm hoping someone can confirm the process I am using.

Details.. 1. TC is connected to standard A/D input via an AD8223 instrumentation AMP with a gain of 106 and an offset of half my A/D reference voltage of 1.25V offset. My A/D reference voltage is 2.5V 2. I am using a standard 10K NTC for the cold junction reference. It's soldered directly to the TC socket and I have calibrated it in an incubator and am confident that my cold junction temperatures are being converted and processed correctly by the processor.

Basically, I am not getting the output that I would expect across a fairly narrow temperature range of 0-80C. I'm not 100% sure that I'm processing properly. If we ignore the calculations I am using for the conversions for now, am I correct to think that I can take the TC output in mV and use the NIST lookup table to convert that mV to a temperature and then subtract my cold junction temperature (which will always be close to Ambient 20C) to get my tip temperature or is there more to it?

To illustrate my problem, I just placed the ThermoCouple in a mug of 76.4C water (confirmed with Fluke 51II ThermoCouple Meter) and Im getting an output of 5.151mV with my NTC reading the Cold Junction at 18.4C. According to the NIST table, 5.151mV equates to 125.5C. When I subtract the 18.4C cold junction I'm left with 107.1C. Clearly not correct. I'm actually using rational polynomials for the conversions in code but I thought I would refer to the look-up chart analogy to keep things simple for the sake of this post. I'm hoping that someone might be able to confirm my logic before I go any deeper.

Perhaps I'm thinking about this the wrong way. Feedback is greatly appreciated.

share|improve this question
I don't see a flaw in the principles of operation of your circuit. With thermocouples, however, the devil is often in the details. The usual suspects are: supply rail arrangement, voltage reference arrangement. Can you post a schematic of your circuit? Welcome to EE.SE, by the way. –  Nick Alexeev Aug 11 at 6:46

4 Answers 4

I suspect that you are overlooking the input offset voltage of the AD8223. The data sheet says it's typically 250 uV. Multiplying by your gain of 106 gives an output offset of 26 mV, so that would more than account for your problems.

Try shorting the inputs together and look at the output. Subtract that number from your 5 mV, and see how that works.

share|improve this answer
That sound like it. Do people use chopper amps on TC inputs? (Otherwise it's not just the offset voltage, but also the drift in offset.) –  George Herold Aug 11 at 15:56

You should be compensating the thermocouple value first THEN feeding this value into the look-up table to produce a temperature value. Consider this picture: -

enter image description here

Clearly, compensation is done first then translation to frequency afterwards. Here is what maxim say: -

Crunching the Numbers - Once you establish a method of cold-junction compensation, the compensated output voltage must be translated into the corresponding temperature. See this.

The voltage to temperature conversion is non-linear so doing it the wrong way round will throw-up some errors.

share|improve this answer

To do thermocouple compensation perfectly you need both forward and reverse functions. You should convert the CJC temperature to a voltage for a Chromel-Alumel thermocouple, then sum that with the voltage from the thermocouple. Needless to say both conversions must use the same (arbitrary) reference temperature (usually 0°C or 32°F. Given a 0°C typical reference you'll typically be adding a negative number.

It can be done with single direction polynomial at some loss of accuracy over a wide ambient range (to be more accurate, range of temperatures at the input terminals). Pick a reference temperature that is more realistic than 0°C, say 20°C. The thermocouple voltage from your ADC should be 0uV at 20°C (if the copper junctions are at 20°C), You take the voltage reading from your ADC and add the mV from the polynomial for 20°C (a fixed number). Now your polynomial output will be exactly 20°C for 0mV and will follow the thermocouple curve. Convert the NTC resistance to temperature and subtract 20°C from that. Now add the difference to the output of the polynomial.

For debugging check each step- offset or gain errors will have large effects-- for example with input terminals shorted (with copper bypassing thermocouple materials) and CJC disabled you should see exactly 20°C output. Put the CJC compensation in and you should see the temperature of the terminal block.

Getting very accurate thermocouple readings is non-trivial and every step needs to be verified carefully. Getting good dynamic tracking of ambient changes can be a challenge outside of a lab environment.

share|improve this answer

Firstly, thanks to everyone for their responses, every answer has been very helpful and I'm now pretty close to getting what I want. At the end of the day, there were a few issues.

  1. I had too much capacitance on my 1.25V supply. My devices spends most of its time in sleep mode and wakes up for around 100mS to sample, I was cutting it a bit close and the supply wasn't stabilizing.
  2. I was using a shunt regulator and the series resistor I chose was a bit small which equated to small error.
  3. I was adjusting the offset with a temperature value at the end of my calculations rather than subtracting my offset in counts first.
  4. Some logical errors explained above.

Again, thanks to all for their input.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.