0

MAX31855 Breakout Board Temperature Offset
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

MAX31855 Breakout Board Temperature Offset

by dschnitkey on Tue Sep 14, 2021 9:54 pm

Hello!

I'm working on a project that includes the MAX31855 breakout board for temperature measurements, in conjunction with a K Type thermocouple and an Arduino Mega controller (the schematic is attached below). I've made one completely functional prototype, however, on my second board (with the exact same architecture) the thermocouple is no long accurate, it's giving measurements ~5 degrees C higher than a reference thermocouple.

I've done the following to attempt to troubleshoot:
- I've used the "Adafruit Thermocouple Sensor w/MAX31855K" example code (that script included below) and found that both the thermocouple AND internal chip temperature are too high
- I've switched out the thermocouple, which has shown to be accurate when used with the functioning board
- I've replaced the MAX31855 breakout board with another brand new chip, with the same results.
- I've measured that the voltage across the Vin and GND pins and confirmed it is actually 5V

I'm a bit at a loss of how to solve this, does anyone have any suggestions? Thank you!
Diane

MAX31855_Schematic.jpeg
MAX31855_Schematic.jpeg (151.69 KiB) Viewed 74 times


Code: Select all | TOGGLE FULL SIZE
/***************************************************
  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
#define MAXCS   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);

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

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);
}

dschnitkey
 
Posts: 5
Joined: Thu Jun 10, 2021 7:07 pm

Re: MAX31855 Breakout Board Temperature Offset

by adafruit_support_bill on Wed Sep 15, 2021 5:27 am

Differences between temperature sensors are not unusual. For critical applications, the first step is always to calibrate:
https://learn.adafruit.com/calibrating-sensors

That said, 5 C offset is a bit extreme even for a thermocouple. What are you using as a reference amplifier?

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

Re: MAX31855 Breakout Board Temperature Offset

by dschnitkey on Wed Sep 15, 2021 6:08 pm

I'm referencing both a digital thermometer with a K type thermocouple, as well as the functional MAX31855 + Thermocouple I have (and these two agree with each other)

dschnitkey
 
Posts: 5
Joined: Thu Jun 10, 2021 7:07 pm

Re: MAX31855 Breakout Board Temperature Offset

by adafruit_support_bill on Thu Sep 16, 2021 7:12 am

I've done the following to attempt to troubleshoot:
- I've used the "Adafruit Thermocouple Sensor w/MAX31855K" example code (that script included below) and found that both the thermocouple AND internal chip temperature are too high

Are both measurements high by the same amount?
- I've switched out the thermocouple, which has shown to be accurate when used with the functioning board
- I've replaced the MAX31855 breakout board with another brand new chip, with the same results.
- I've measured that the voltage across the Vin and GND pins and confirmed it is actually 5V

That appears to rule out all the usual suspects. Have you tried swapping boards with your original functional prototype?

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

Re: MAX31855 Breakout Board Temperature Offset

by dschnitkey on Mon Sep 20, 2021 12:25 pm

Are both measurements high by the same amount?

Yes, they both seem to be off by the same amount.

That appears to rule out all the usual suspects. Have you tried swapping boards with your original functional prototype?

I have not tried this, the breakout board is soldered in place, so it is very difficult to swap them, and I'd like to avoid damaging the functional prototype.

My collaborators who have used this board several times have said they've never had to calibrate this part, which makes me concerned that something is wrong. These are my ideas of what to try next:
- Test all of the remaining MAX31855 boards I have (I have about 5) with a new arduino and see if they all behave this way
- Attempt a 3 point calibration with the existing board and see if it is consistent/accurate afterwards

I will update with my results, thanks for the help so far! Please let me know if there are other tests I should try.

dschnitkey
 
Posts: 5
Joined: Thu Jun 10, 2021 7:07 pm

Re: MAX31855 Breakout Board Temperature Offset

by adafruit_support_bill on Mon Sep 20, 2021 12:49 pm

From your original post:
- I've replaced the MAX31855 breakout board with another brand new chip, with the same results.

Did you swap a whole breakout board, or just the MAX31855 chip on it? A single board (or chip) with a large offset could be just a random defective chip. But two that behave the same tends to indicate a different kind of problem.

Can you post a clear close-up photo showing the labeling on the two chips tested? And if possible, one of the chip on the working prototype.

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

Re: MAX31855 Breakout Board Temperature Offset

by dschnitkey on Thu Sep 23, 2021 8:05 pm

I swapped the whole board, not just the chip. I bought 5 boards in this order, and I tested two more of them which have the same problem. I'm attaching those boards, hooked up to an arduino mega. The wires are hooked up like this:
Vin to 5V
Gnd to Gnd
DO to 3
CS to 4
CLK to 5

And I've attached the test code I used below. The two chips pictured showed an internal temperature of ~24.4 and ~26 respectively when the room temperature is actually ~22. Can you see anything wrong with how I've wired it? This wiring is identical to the wiring on my prototypes.
Thanks!

Code: Select all | TOGGLE FULL SIZE
/***************************************************
  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
#define MAXCS   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);

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

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
IMG_2507.jpg
IMG_2507.jpg (354.17 KiB) Viewed 29 times
IMG_2508.jpg
IMG_2508.jpg (438.13 KiB) Viewed 29 times

dschnitkey
 
Posts: 5
Joined: Thu Jun 10, 2021 7:07 pm

Re: MAX31855 Breakout Board Temperature Offset

by adafruit_support_bill on Fri Sep 24, 2021 8:13 am

The headers on those two are not installed correctly for use in a breadboard. The short pins should be inserted from the bottom and soldered from the top. Installed as they are, they will not make reliable contact with the breadboard.

The photos do confirm that the chips are the "K" version of the chip, so they should have the correct slope and offset for K-type junctions.

The two chips pictured showed an internal temperature of ~24.4 and ~26 respectively when the room temperature is actually ~22.

"room temperature" typically varies quite a bit - depending on where in the room you measure it. Active electronic devices in particular generate their own heat. That is why it is important to locate the 'cold junction' of the TC as close as possible to the chip.

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

Re: MAX31855 Breakout Board Temperature Offset

by dschnitkey on Fri Sep 24, 2021 12:09 pm

The headers on those two are not installed correctly for use in a breadboard. The short pins should be inserted from the bottom and soldered from the top. Installed as they are, they will not make reliable contact with the breadboard.


Right, thank you. In my final design they are soldered in place, I am just trying to quickly test them without soldering here.

"room temperature" typically varies quite a bit - depending on where in the room you measure it. Active electronic devices in particular generate their own heat. That is why it is important to locate the 'cold junction' of the TC as close as possible to the chip.


I was measuring the room temperature with another K type thermocouple about a foot away from the chip, and was thinking that was a good representation. I wasn't accounting for the fact the chip heats up. I suppose my next step then will be hooking these up to the thermocouple and seeing if there is still an offset.

Thanks for your help!

dschnitkey
 
Posts: 5
Joined: Thu Jun 10, 2021 7:07 pm

Please be positive and constructive with your questions and comments.