K thermocouple values not stable (Max31855) / Information on Relay

Thread Starter

Kadav

Joined May 11, 2018
148
Hello
I have a max31855 Datasheet , using arduino (1.8.13) and I am seeing the values of the thermocouple bouncing, I would love to say that the problem lies in the code but the code uses a library that is a bit hard for me to understand . Or that the problem is in connection

I also noticed that the code belongs to another breadkoub board that is completely different from mines on the left is my breakout board and on the right is the board that the library uses
cds.JPG
The library board’s datasheet is Datasheet of the arduino used in the library
Can you please help me to figure this out ??

Thank you very much

The code below looks like this

Code:
/***************************************************
  This is an example for the Adafruit Thermocouple Sensor w/MAX31855K

  Designed specifically to work with the Adafruit Thermocouple Sensor
  ----> https://www.adafruit.com/products/269

  These displays use SPI to communicate, 3 pins are required to
  interface
  Adafruit invests time and resources providing this open source code,
  please support Adafruit and open-source hardware by purchasing
  products from Adafruit!

  Written by Limor Fried/Ladyada for Adafruit Industries.
  BSD license, all text above must be included in any redistribution
****************************************************/

#include <SPI.h>
#include "Adafruit_MAX31855.h"

// Default connection is using software SPI, but comment and uncomment one of
// the two examples below to switch between software SPI and hardware SPI:

// Example creating a thermocouple instance with software SPI on any three
// digital IO pins.
#define MAXDO   3  // pin 3 connect to pin 3
#define MAXCS   4  // pin 3 connect to pin 4
#define MAXCLK  5

// initialize the Thermocouple
Adafruit_MAX31855 thermocouple(MAXCLK, MAXCS, MAXDO);

// Example creating a thermocouple instance with hardware SPI
// on a given CS pin.
//#define MAXCS   10
//Adafruit_MAX31855 thermocouple(MAXCS);

void setup() {
  Serial.begin(9600);

  while (!Serial) delay(1); // wait for Serial on Leonardo/Zero, etc

  Serial.println("MAX31855 test");
  // wait for MAX chip to stabilize
  delay(500);
  Serial.print("Initializing sensor...");
  if (!thermocouple.begin()) {
    Serial.println("ERROR.");
    while (1) delay(10);
  }
  Serial.println("DONE.");
}

void loop() {
  // basic readout test, just print the current temp
   Serial.print("Internal Temp = ");
   Serial.println(thermocouple.readInternal());

   double c = thermocouple.readCelsius();
   if (isnan(c)) {
     Serial.println("Something wrong with thermocouple!");
   } else {
     Serial.print("C = ");
     Serial.println(c);
   }
   //Serial.print("F = ");
   //Serial.println(thermocouple.readFahrenheit());

   delay(1000);
}
The setup looks like
cap23.JPG

the results look like this

g'.JPG
 

Furieux F

Joined Aug 15, 2016
7
I also had the same problem which I solved by placing 100nF capacitor between thermocouple’s positive and negative rails.
But I had a different MAX31855 breakout board.

F.
 

Thread Starter

Kadav

Joined May 11, 2018
148
Those boards do not look completely different to me. The Adafruit board follows the reference design closely. Excluding the voltage regulator on the Adafruit board, both boards have about the same number of passive devices. It's a very simple design.

I do not find your results for "jumping around" too impressively excessive. Air currents can cause that much difference. You may want to skip the next paragraph and go to experimental results.

Some things to check, which you probably have already done:
Let's assume you have triple checked the voltage supply and your supply is stable and regulated. Do you have the red TC wire connected to negative? (It might be a good habit to use yellow instead of red for + in the design you show.) Did you scrape the TC leads a little before connecting? Are the screw contacts tight? Is your TC the correct one? Is the junction welded?

Your experimental results:
1) Shield both the PCB and TC from air currents. I put a little piece of soft insulating foam on top the IC chip. I did not encase the chip as it probably produces some heat too.
2) As for the TC, a mixture of ice and water in a styrofoam container or thermos will be fairly constant (but not 0.00°). You can also stick the TC into a chunk of Styrofoam to shield it.
I have tried to eliminate the air and everything but the values seem to be not constant i don't get it
 

MrSoftware

Joined Oct 29, 2013
1,975
If the posts above didn't solve it, especially #3, then scope the power for your ADC board. If there's any noise then that can be a problem. You can also take a guess at it and put a couple of ceramic capacitors across the power terminals, start with a 10nF and try different sizes. Also check the datasheet for the MAX chip to be sure that breakout board followed their recommendations. Additionally you can try to solve it in software by oversampling and averaging your readings.
 

jpanhalt

Joined Jan 18, 2008
11,088
If problems continue, you might consider the MAX31856. It's digital (SPI), but since you are already using the Arduino, that should not be a be great issue. It recommends more filtering, as well as a bias.

1595880574884.png
You cannot add that bias to the MAX31855, but you could try that filtering design to see if it helps. However, until you rule out air currents (i.e., the TC results are correct), I would not make any changes.
 

Furieux F

Joined Aug 15, 2016
7
If the posts above didn't solve it, especially #3, then scope the power for your ADC board. If there's any noise then that can be a problem. You can also take a guess at it and put a couple of ceramic capacitors across the power terminals, start with a 10nF and try different sizes. Also check the datasheet for the MAX chip to be sure that breakout board followed their recommendations. Additionally you can try to solve it in software by oversampling and averaging your readings.
Yes, in software I also took 10 readings and then average of that. This helps to stabilize final reading as well.
 

Thread Starter

Kadav

Joined May 11, 2018
148
The digital version (MAX 31856) allows that to be done by setting a single register value.
@jpanhalt which capacitor is good for small ground noise ?
is it the high capactor( that have high capacitance in micro farads) or small capacitance (nano farads) , how does capacitance works with the noise . what's the relationship i read but did not understand well .
 

Thread Starter

Kadav

Joined May 11, 2018
148
Another question from the below adafruit library code ?
Should the value that we are supposed to read be internal Temp or C ?
I am having trouble becoming familiar with the library i am learning the library as i post this question so Please bear with me.

Because if it is Internal Temp then it makes sense but if it is C, something must be wrong because of the variations are too high

Here is my readings ( please tell me if it is C or Internal Temp )

1595930940153.png


Adafruit library code:
/***************************************************
  This is an example for the Adafruit Thermocouple Sensor w/MAX31855K

  Designed specifically to work with the Adafruit Thermocouple Sensor
  ----> https://www.adafruit.com/products/269

  These displays use SPI to communicate, 3 pins are required to
  interface
  Adafruit invests time and resources providing this open source code,
  please support Adafruit and open-source hardware by purchasing
  products from Adafruit!

  Written by Limor Fried/Ladyada for Adafruit Industries.
  BSD license, all text above must be included in any redistribution
****************************************************/

#include <SPI.h>
#include "Adafruit_MAX31855.h"

// Default connection is using software SPI, but comment and uncomment one of
// the two examples below to switch between software SPI and hardware SPI:

// Example creating a thermocouple instance with software SPI on any three
// digital IO pins.
#define MAXDO   3  //pin 3 connect to pin 3
#define MAXCS   4   //pin 1 connect to pin 4
#define MAXCLK  5   //pin 4 connect to pin 5
// initialize the Thermocouple
Adafruit_MAX31855 thermocouple(MAXCLK, MAXCS, MAXDO);

// Example creating a thermocouple instance with hardware SPI
// on a given CS pin.
//#define MAXCS   10
//Adafruit_MAX31855 thermocouple(MAXCS);

void setup() {
  Serial.begin(9600);

  while (!Serial) delay(1); // wait for Serial on Leonardo/Zero, etc

  Serial.println("MAX31855 test");
  // wait for MAX chip to stabilize
  delay(500);
  Serial.print("Initializing sensor...");
  if (!thermocouple.begin()) {
    Serial.println("ERROR.");
    while (1) delay(10);
  }
  Serial.println("DONE.");
}

void loop() {
  // basic readout test, just print the current temp
   Serial.print("Internal Temp = ");
   Serial.println(thermocouple.readInternal());

   double c = thermocouple.readCelsius();
   if (isnan(c)) {
     Serial.println("Something wrong with thermocouple!");
   } else {
     Serial.print("C = ");
     Serial.println(c);
   }
   //Serial.print("F = ");
   //Serial.println(thermocouple.readFahrenheit());

   delay(1000);
}
 

Attachments

jpanhalt

Joined Jan 18, 2008
11,088
I don't know what the Arduino library does. However, the MAX31855 datasheet calls the "cold junction" temperature the internal temperature. That's consistent with the meaning of the words:

1595931548491.png

The cold junction is sometimes called reference too. It is inside the epoxy shell of the chip, so basically, it is the chip's temperature.

The temperature of your thermocouple is labeled "C" in your data.

Have you tried a Styrofoam block or ice water as a more constant test of your TC?
 

Thread Starter

Kadav

Joined May 11, 2018
148
I don't know what the Arduino library does. However, the MAX31855 datasheet calls the "cold junction" temperature the internal temperature. That's consistent with the meaning of the words:

View attachment 213340

The cold junction is sometimes called reference too. It is inside the epoxy shell of the chip, so basically, it is the chip's temperature.

The temperature of your thermocouple is labeled "C" in your data.

Have you tried a Styrofoam block or ice water as a more constant test of your TC?
Oooh ok i am going to try it now i will tell you . the result

Thank you
 

Thread Starter

Kadav

Joined May 11, 2018
148
I don't know what the Arduino library does. However, the MAX31855 datasheet calls the "cold junction" temperature the internal temperature. That's consistent with the meaning of the words:

View attachment 213340

The cold junction is sometimes called reference too. It is inside the epoxy shell of the chip, so basically, it is the chip's temperature.

The temperature of your thermocouple is labeled "C" in your data.

Have you tried a Styrofoam block or ice water as a more constant test of your TC?
Oooooh ok now it makes sense . i didn't know about the principle of a thermocouple to know about the cold junction.

thanks


i am going to prepare a glass of ice to check . thanks very much i will get back to you
 

jpanhalt

Joined Jan 18, 2008
11,088
A glass of ice water may work. But there will be temperature gradients in it. An insulated glass, thermos, or foam cup might be better.
 

MrSoftware

Joined Oct 29, 2013
1,975
As stated above, read the maxim data sheet, the info they put in those is extremely important, and the devil is always in the details. Some chips generate noise themselves and need capacitors to be stable, this is one reason the datasheet is so important. In general, different size capacitors will filter different noise frequencies, it's not unusual to need multiple capacitors of different sizes if you've got a lot of noise at different frequencies. Here is an excellent introduction video on it:

 

Reloadron

Joined Jan 15, 2015
5,787
In a few words from the manufacturers data sheet:

"Noise Considerations Because of the small signal levels involved, thermocouple temperature measurement is susceptible to powersupply coupled noise. The effects of power-supply noise can be minimized by placing a 0.1µF ceramic bypass capacitor close to the VCC pin of the device and to GND. The input amplifier is a low-noise amplifier designed to enable high-precision input sensing. Keep the thermocouple and connecting wires away from electrical noise sources. It is strongly recommended to add a 10nF ceramic surface-mount differential capacitor, placed across the T+ and T- pins, in order to filter noise on the thermocouple lines".

You make no mention which I saw if your Type K Thermocouple is of the grounded or un grounded type?

A type K thermocouple is not exactly a precision temperature measuring device:

Type K:
MAXIMUM TEMPERATURE RANGE
Thermocouple Grade
– 328 to 2282°F
– 200 to 1250°C
Extension Grade
32 to 392°F
0 to 200°C
LIMITS OF ERROR
(Whichever is greater)
Standard: 2.2°C or 0.75% Above 0°C
2.2°C or 2.0% Below 0°C
Special: 1.1°C or 0.4%
COMMENTS, BARE WIRE ENVIRONMENT:
Clean Oxidizing and Inert; Limited Use in
Vacuum or Reducing; Wide Temperature
Range; Most Popular Calibration
TEMPERATURE IN DEGREES °F
REFERENCE JUNCTION AT 32°F

An "ice bath" was generally made in an insulated "Dewars Flask". Before electronic compensation was available. You may want to read through this old page to get an idea of what the temperature measurement process is all about. While you do have a stability issue your first set of numbers looked fine, the latter no. Considering the uncertainties I see no reason to take a Type K reading two places to the right of the decimal?

Ron
 
Top