K Type Thermocouple gives different reading in PID controller and arduino

I need to monitor the continuous temperature of lead extruder machine. I have used duplex k type thermocouple, where I have taken one channel of k type thermocouple to PID controller and another channel of k type thermocouple to arduino using MAX6675 breakout board.

Now I am facing problem in measuring temperature using two different things(one is PID and another is Arduino) i.e., if the PID controller gives the temperature as 165 deg celsius at the same time my arduino using max6675 will give 159 deg celsius and if I track the temperature measurement in both the things, the PID controller picks up the fastest changes in the temperature like 160, 163, 167, 171 and so on whereas for the same instances my arduino picks up the temperature as 160, 160.50, 161.25,161.75 and so on. The above scenario gives me the highest temperature difference of the PID controller and Arduino using Max6675. If I cross check the temperature measurement using a thermometer, the temperature value of thermometer and PID controller matches exactly.

Now where my system lags to picks up the correct temperature measurement?

Hard to debug without code and hardly any information on the setup.

lg, couka

I don't have PID controller, that has designed by some others whereas I have Arduino code

#include "max6675.h"

int thermoDO = 4;
int thermoCLK = 6;

int thermoCS1 = 5;
int thermoCS2 = 7;
int thermoCS3 = 8;
int thermoCS4 = 9;
int thermoCS5 = 10;
int thermoCS6 = 11;
int thermoCS7 = 12;

MAX6675 thermocouple1(thermoCLK, thermoCS1, thermoDO);
MAX6675 thermocouple2(thermoCLK, thermoCS2, thermoDO);
MAX6675 thermocouple3(thermoCLK, thermoCS3, thermoDO);
MAX6675 thermocouple4(thermoCLK, thermoCS4, thermoDO);
MAX6675 thermocouple5(thermoCLK, thermoCS5, thermoDO);
MAX6675 thermocouple6(thermoCLK, thermoCS6, thermoDO);
MAX6675 thermocouple7(thermoCLK, thermoCS7, thermoDO);

int vccPin = 3;
int gndPin = 2;

void setup() {
Serial.begin(9600);
// use Arduino pins
pinMode(vccPin, OUTPUT); digitalWrite(vccPin, HIGH);
pinMode(gndPin, OUTPUT); digitalWrite(gndPin, LOW);

//Serial.println("MAX6675 test");
// wait for MAX chip to stabilize
delay(500);
}

void loop() {
// basic readout test, just print the current temp

//Serial.print("C = ");
Serial.print(thermocouple1.readCelsius());
//Serial.print(" F = ");
//Serial.print(thermocouple.readFahrenheit());

//Serial.print(" C1 = ");
Serial.print(",");
Serial.print(thermocouple2.readCelsius());
Serial.print(",");
Serial.print(thermocouple3.readCelsius());
Serial.print(",");
Serial.print(thermocouple4.readCelsius());
Serial.print(",");
Serial.print(thermocouple5.readCelsius());
Serial.print(",");
Serial.print(thermocouple6.readCelsius());
Serial.print(",");
Serial.print(thermocouple7.readCelsius());

Serial.println();

delay(1800);
}

All sensors need to be calibrated.

Do either of the sensors read exactly 0 C for ice water and 100 C for boiling water (at sea level)?

boson:
I need to monitor the continuous temperature of lead extruder machine. I have used duplex k type thermocouple, where I have taken one channel of k type thermocouple to PID controller and another channel of k type thermocouple to arduino using MAX6675 breakout board.

Now I am facing problem in measuring temperature using two different things(one is PID and another is Arduino) i.e., if the PID controller gives the temperature as 165 deg celsius at the same time my arduino using max6675 will give 159 deg celsius and if I track the temperature measurement in both the things, the PID controller picks up the fastest changes in the temperature like 160, 163, 167, 171 and so on whereas for the same instances my arduino picks up the temperature as 160, 160.50, 161.25,161.75 and so on. The above scenario gives me the highest temperature difference of the PID controller and Arduino using Max6675. If I cross check the temperature measurement using a thermometer, the temperature value of thermometer and PID controller matches exactly.

Now where my system lags to picks up the correct temperature measurement?

A K-Type thermocouple only puts out a millivolt signal. From 160C to 170C The output is 6.540mV to 6.941mV. So only 401uV difference, less than 1/2 of a millivolt. What is your circuit. How well filtered is the power, How isolated is the MAX6675 from the Arduino?

Post a schematic of your ADC circuit.

Chuck.

Attached my circuit schematic.

Please answer the question in reply #3.

Yes. All my sensor works perfectly. It senses 0 deg for ice and 100 deg for boiling water and Its calibrated perfectly.

boson:
Attached my circuit schematic.

Attached is a schematic of a circuit I use. Note the inductor between the 5v Vcc power and my ADC's power. The Power Supply filters (100nf, 10nf). The RC input filters between the Probes and the ADC.

I am surprise you are seeing such a small variation.

Chuck.

ThermoCouple V2.pdf (45 KB)

Attached is my PCB schematic

PCB.pdf (15.7 KB)

For Post No 3, I have already given my answer. It works well at 0 deg for ice and 100 deg for boiling water. I have tested this scenario under two conditions,

  1. Just by connecting single thermocouple with max6675
  2. By connecting seven thermocouples and with respective max6675 with seven different hot baths.

The above two scenarios works well at 0 deg and 100 deg. All the thermocouples are perfectly calibrated.

int vccPin = 3;
int gndPin = 2;

pinMode(vccPin, OUTPUT); digitalWrite(vccPin, HIGH);
pinMode(gndPin, OUTPUT); digitalWrite(gndPin, LOW);

Any reason for grounding and powering the sensors through Arduino pins.
Leo..

Wawa:
int vccPin = 3;
int gndPin = 2;

pinMode(vccPin, OUTPUT); digitalWrite(vccPin, HIGH);
pinMode(gndPin, OUTPUT); digitalWrite(gndPin, LOW);

Any reason for grounding and powering the sensors through Arduino pins.
Leo..

I have given, the VCC and GND of Max6675 to Arduino and i m not giving the VCC and GND to thrmocouples.

boson:
I have given, the VCC and GND of Max6675 to Arduino and i m not giving the VCC and GND to thrmocouples.

That does not make sense (to me).

Max6675 ground(s) should be connected directly to an Arduino ground pin.
VCC might be ok switched with a pin, since a MAX6675 only draws ~1mA.
Don't see why though.
An RC (or LC) filter from the 5volt pin would be safer.

This has probably nothing to do with the problem you're having.
Maybe you should swap sensors (or CS pins), to see if you can find a pattern.
Leo..

Wawa:
That does not make sense (to me).

Max6675 ground(s) should be connected directly to an Arduino ground pin.
VCC might be ok switched with a pin, since a MAX6675 only draws ~1mA.
Don't see why though.
An RC (or LC) filter from the 5volt pin would be safer.

This has probably nothing to do with the problem you're having.
Maybe you should swap sensors (or CS pins), to see if you can find a pattern.
Leo..

ok sure. Let me check with RC or LC circuit and i will check the performance.

Wawa:
That does not make sense (to me).

Max6675 ground(s) should be connected directly to an Arduino ground pin.
VCC might be ok switched with a pin, since a MAX6675 only draws ~1mA.
Don't see why though.
An RC (or LC) filter from the 5volt pin would be safer.

This has probably nothing to do with the problem you're having.
Maybe you should swap sensors (or CS pins), to see if you can find a pattern.
Leo..

Is there any other ways to change the sampling time of Max6675?

I had a problem with interference on a MAX6675 shield - erratic readings. Solved with a 47uF between the thermocouple -ve input and ground...

regards

Allan.

allanhurst:
I had a problem with interference on a MAX6675 shield - erratic readings. Solved with a 47uF between the thermocouple -ve input and ground...

regards

Allan.

Thank You. Thank you for your suggestion. Let me check this with the system.

Will the ambient temperature affect the temperature measurement? I had come across the following scenario in my yesterday's observation

Yesterday morning, my ambient temperature was 29 deg celsius, so my Max6675 with Arduino gives me the temperature difference of 2 deg cel with respect to the PID controller, whereas yesterday's noon temperature was 35 deg cel in such case my Max6675 with Arduino gives me the temperature deviation of 5 to 8 deg cel with respect to PID controller.

So now my question is, will the ambient temperature affects my system because of the cold junction compensation of thermocouple?

No - that's what cold junction compensation is all about.. The max6675 has it built-in.
Allan