0

Thermocouple Equation
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Thermocouple Equation

by bigginsking on Mon Jul 17, 2017 1:41 am

hello,

I've got two of the " Analog Output K-Type Thermocouple Amplifier - AD8495" boards and I've been doing some testing with boiling water, ice and room temperature.

When I use the suggested equation I get about 10 C lower than expected at room temp and boiling and around 6.5 C lower than expected in ice water.

I'm not 100% sure what the right equation is but it is something closer to (Vout-1.2)/0.005

Code I'm using is here:
Code: Select all | TOGGLE FULL SIZE
unsigned long  timer;
  unsigned long printinterval = 1000000;
    unsigned long printtime = 100000;
    float temp1;
    float temp2;
  float sensorValue1;
  float sensorValue2;

      int cyclepin=4;
 
// the setup routine runs once when you press reset:
void setup() {

  pinMode(cyclepin, OUTPUT);
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
      temp1 = 0 ;
      temp2 = 0 ;
     timer = micros();   
}
 
// the loop routine runs over and over again forever:
void loop() {
     timer = micros();
  // read the input on analog pin 0:
   sensorValue1 = analogRead(A0)*0.01+sensorValue1*0.99; // this does some averaging between analog reads to try to cancel out noise
   sensorValue2 = analogRead(A1)*0.01+sensorValue2*0.99;
PORTD^= B00010000; 

if (timer > printtime)
{
    temp1 = ((5*sensorValue1/1024)-1.2)/0.005; // the equation in question, I think that the value subtracted from the voltage should be 1.2 rather than 1.25.
    temp2 = ((5*sensorValue2/1024)-1.2)/0.005;
  // print out the value you read:
  Serial.print(temp1);
  Serial.print(" ");
  Serial.println(temp2);
  printtime = printtime+printinterval;
}
 
}

bigginsking
 
Posts: 1
Joined: Mon Jul 17, 2017 1:32 am

Re: Thermocouple Equation

by adafruit_support_bill on Mon Jul 17, 2017 10:33 am

No sensor is perfect. Virtually all sensors require calibration for accurate results.

With analog sensors you also have the added variability of your ADC to account for. As long as the response is linear, the most straightforward approach is to use the formula shown here:
https://learn.adafruit.com/calibrating- ... alibration

adafruit_support_bill
 
Posts: 62964
Joined: Sat Feb 07, 2009 10:11 am

Re: Thermocouple Equation

by vsch on Wed Oct 04, 2017 10:40 pm

Actually, the instructions for connecting the thermocouple are missing the "cold-junction" for most accurate readings.

A cold-junction is another thermocouple, preferably from the same batch of wire which is used to eliminate difference in galvanic voltages generated at the connector. Without this second thermocouple your readings will vary unpredictably with connector temperature.

In order to make use of the cold junction compensation of the amplifier you need a second thermocouple junction in thermal contact with the amplifier IC for best results. That way it is at a known temperature which the IC can compensate. Hence the "cold-junction-compensated" in its description.

The cold junction thermocouple has one of its wires connected to the same color wire (lets say yellow) from the hot-junction (the one measuring the temperature).

Then the other wire (red in this case) from the cold junction thermocouple is used in the connector for the yellow wire. The red wire from the hot junction thermocouple connected to the red terminals on the board.

The cold-junction thermocouple should be in thermal contact with the IC case for best results. Otherwise any difference between IC temperature and the cold junction will introduce errors.

In this configuration the galvanic voltage at the connector is cancelled out because you have the same materials coming into contact and the only offset is the voltage across the cold junction which the MAX3185x compensates because this junction is at a known temperature.

In the tutorial for connecting the thermocouple the difference of temperature reading from actual will vary with connector temperature and will not be compensated by the amplifier chip for two reasons:

1. the chip compensates for a cold junction which is not present. The error will vary with the temperature of the IC.
2. the connector contacts are made with two different materials of the thermocouple probe and will each introduce different galvanic voltage errors that vary with temperature of the connector and any temperature differences between the two contacts.

Thermocouple-Cold-Junction.png
Thermocouple-Cold-Junction.png (5.67 KiB) Viewed 90 times

vsch
 
Posts: 1
Joined: Wed Oct 04, 2017 10:20 pm

Re: Thermocouple Equation

by adafruit_support_bill on Thu Oct 05, 2017 5:44 am

Actually, the instructions for connecting the thermocouple are missing the "cold-junction" for most accurate readings.

The AD8495 has internal cold-junction compensation: https://cdn-shop.adafruit.com/datasheet ... 6_8497.pdf

adafruit_support_bill
 
Posts: 62964
Joined: Sat Feb 07, 2009 10:11 am

Please be positive and constructive with your questions and comments.