MAX 31855 and Thermocouple Errors

Hello All,

I've been struggling with this for a week now and tried everything I can find here and elsewhere, so its time to turn to the help of the gurus.....

I'm working on a cryogenic application that uses 6 T-Type thermocouples running through 6 MAX31855 breakout boards and while everything seemed OK at room temperature it quickly became apparent that all the thermocouples were reading low at temperatures above around room temp and high at temperatures below that :

at +100C they read +88C
at +38C they read +32C
at +20C they read +20C - Which lulled me into a false sense of smugness....
at -22C they read -10C
at -140C they read -80C

To simplify things I stripped off everything else and just left one MAX31855 fitted with a T Type thermocouple and connected as follows:

GND : 0v Breadboard Rail
CS : D2 on NANO
V : +5v Breadboard Rail
SCK : D13 on NANO
SO : D12 on NANO
GND : 0v Breadboard Rail

Nano is connected thus:
GND : 0v Breadbaord Rail
5v : 5v Breadboard Rail

I've tried several MAX31855 libraries and also one solution with a library-less read but all report similar results:

https://github.com/RobTillaart/Arduino/tree/master/libraries/MAX31855
http://www.ElectronCTL.net/Temp/MAX31855.ino

I settled on Rob Tillaarts solution as its fast....

Here's what I've tried:
I've tried several different brands of thermocouple, no significant change.
I've tried a range of capacitors across the terminals of the thermocouple connection, no change.
I've tried connecting the thermocouple directly with bared wire, with crimps and by clamping the connector pins under the screw terminals, no change.
I added the TRACO power brick instead of running of the NANO supply, no change.
I tried replicating everything on really small breadboard using a Micro Pro 5v and really short wires, no change.
I tried using an old MAX6675 I had lying about and got similar results but Im not sure if it would be valid for a T-Type
I tried connecting a K Type but that was similar.

By a process of elimination I guess the only consistent thing is the breakout board, but I'm unsure of how I can test\validate this?

Any suggestions gratefully received....

Kit:
Black Box Tech MAX31855 T Type breakout board, details here:

T Type thin wire Thermocouple:

TRACO Power 24v to 5v power brick: TEN 5-2411 here:
http://docs-europe.electrocomponents.com/webdocs/0090/0900766b80090873.pdf

My code (with thanks to Rob Tillaart):

#include "MAX31855.h"

const int clPin = 13;//CLK. SCK
const int doPin = 12;//DO, Data Out
const int csPin1 = 2;//the pin asked to read  CS

MAX31855 tc1(clPin, csPin1, doPin);

void setup() 
{
  Serial.begin(57600);
  Serial.print("MAX31855 Ver:\t ");
  Serial.println(MAX31855_VERSION);
  Serial.println();

  //CS pins high to turn off
  digitalWrite(csPin1, HIGH); 
    
  tc1.begin();

  digitalWrite(csPin1, LOW); //Switch ON CS
  uint32_t start = micros();
  for (int i=0; i< 10; i++) tc1.read();//After a tc.read() you can do tc.getTemperature() and tc.getInternal()
  uint32_t stop = micros();
  //After a tc.read() you can do tc.getTemperature() and tc.getInternal()
  //repeated getTemperature() will give the same value until a new tc.read()
  digitalWrite(csPin1, HIGH); //Switch OFF CS  
  Serial.print("10 x reads in :\t"); // \t is a TAB
  Serial.print(stop - start);
  Serial.println(" mSecs\t");
 
  float t1 = tc1.getTemperature();
  Serial.print("T1:\t");
  Serial.println(t1, 2);
  Serial.println();

}

void loop() 
{
  digitalWrite(csPin1, LOW); //Switch ON CS
  tc1.read();
  float t1 = tc1.getTemperature();
  digitalWrite(csPin1, HIGH); //Switch OFF CS
  
  Serial.print("T1: ");
  Serial.println(t1, 2);
  
  delay(250);  
}

I settled on Rob Tillaarts solution as its fast....

I'm sure robyifowler's solution is faster because it's using the hardware SPI while Rob's version emulates SPI in software.

at +100C they read +88C
at +38C they read +32C
at +20C they read +20C - Which lulled me into a false sense of smugness....
at -22C they read -10C
at -140C they read -80C

How did you measure the comparing value?
How did you connect the thermocouples to the breakouts? Photos?

Have you checked that you really got a t type 31855?

Hello Pylon,

Thanks for taking the time to reply, much appreciated

I didn't time the response between Corry Fowlers and Rob Tilliaart, but both are much faster than I need. In the finished state Im sampling at about 1 Hz. I'll have another look at Corry's but the output is the same anyhow.

I measured the 'actuals' using two other devices: A JUMO digital thermostat and also a hand held Fluke fitted with a thermocouple probe. Both are calibrated and gave very similar readings. Im pretty sure they are correct.

I also put the Fluke probe and my probe in a kettle and boiled it. The fluke read 99.8C my probe 80C and I've done the same with some liquid N2, Fluke measured -140C, mine read -80C.

I've tried four ways of connecting the probes physically as described in my original post but there's a photo attached - all methods seem to result in the same reading.

With a magnifying glass I can just read 'MAX31885 T' on the chip on the breakout board. Does the T signify T type I wonder ? On the reverse side they have 'Type T' written on them.

Thanks

I never used T type thermocouples, my experience is limited to K types but from the description I would have expected them to behave more or less the same.

Try reading again with coryifowler's library and set DEBUG to 1. The library should write the raw data reading out in HEX. Try this at some extreme temperatures if possible and post the results. I'm interested in the error flags this value contains. Maybe we find some indications there why the values are not accurate.

With a magnifying glass I can just read 'MAX31885 T' on the chip on the breakout board.

Yes, the T stands for the type (according to the datasheet).

Thanks Pylon,

Yes I think K types are very similar - my knowledge of thermocouples has only started in the last few weeks so most of it is new to me.

I'm away from my liquid nitrogen supply for a few days, but attached is a couple of print outs using Cory's library in DEBUG mode, hopefully it means more to you than me!

I'm a bit limited to what temperatures I can use here at home - my cooker and my freezer.... :~

Attached are printouts from both, any use?

This is on a Micro Pro 5v wired very simply as per the attached photo.

Thanks for your help,

++++EDIT+++
Also attached is a Boiling water file set - about 88.5C but measured as 100C with an (uncalibrated) cooking thermometer from my kitchen drawer...

hot.txt (16.7 KB)

cold.txt (17.3 KB)

boiling water.txt (4.56 KB)

Water boils at 100 C if you are at 1 atmosphere of pressure, or about sea level, but it drops quickly with elevation. What is your elevation?

Hello jremington,

Here at home I'm at 600ft ASL (so should be about 99.3 C I reckon) and my thermo peaked at 88.75C, but at my previous test I was only at about 40ft ASL and the thermocouples still read only about 88\89C in a boiling kettle - then I had a calibrated Fluke in there too which read a shade under 100C.

I'm stumped.....!? My next test will be to use a different make of breakout board as that seems to be the only common factor.

Thanks

I'm away from my liquid nitrogen supply for a few days, but attached is a couple of print outs using Cory's library in DEBUG mode, hopefully it means more to you than me!

Maybe :). Unfortunately the values are good, the chip doesn't recognize any fault.

Have you found any schematics of that board? In my opinion it's a bit strange that they say that the module operates with Vcc and logic in the range 3V3 to 5V. The chip operates only at 3V3 (according to the datasheet, page 2: absolute maximum ratings for Vcc is 4.0V), so maybe that information is just wrong and you have to drive it with not more than 3.3V to get reliable results. It's possible that the module includes a voltage regulator but we don't know it. You might measure the voltage between pin 1 and 4 of the chip during operation.
On the linked page another user complained in a similar way, he also doesn't get correct temperature readings but with an R type module. I probably would try to power the module with 3V3, use a level converter for the SPI pins and see what result I get then. I don't know if you have a level converter on stock. An ADC (the MAX 31855 basically is a rather exact ADC) always needs a reference voltage to compare to. The MAX31855 is able to produce that internally but I don't know if that's exact if the supply is out the specified voltage range.

Thanks again Pylon,

Im coming to the same conclusion as the other reviewer I think - (the review has strangely disappeared) but I'll try the voltage measurement. Its a shame as the boards feel and look nicely made.

In the meantime I've ordered one of these:
http://www.ebay.co.uk/itm/MAX31855-Quad-Ch-T-Type-Thermocouple-Breakout-MAX6675-upgrade-3V-Arduino-Comp-/331184452404?

I'll report back on how that one performs....

This supplier also doesn't offer schematics unfortunately, I never buy from such suppliers.

At least the manufacturer has a web site and provides some information about the module. This module has to be supplied with 3V3 and must only be connected to 3V3 logic, so you need a level converter to connect it to your Nano.

pylon:

The chip operates only at 3V3 (according to the datasheet, page 2: absolute maximum ratings for Vcc is 4.0V), so maybe that information is just wrong and you have to drive it with not more than 3.3V to get reliable results. It's possible that the module includes a voltage regulator but we don't know it. You might measure the voltage between pin 1 and 4 of the chip during operation.

When operating the voltage between pin 1 and 4 of the MAX31855T on the breakout board is 3.109 V, which I think is just within the recommended operating range of the chip as per spec sheet (3.0v to 3.6v). Im feeding the breakout board with 5.06v from Vcc on the Arduino so I guess there must be a voltage regulator on the board.

When operating the voltage between pin 1 and 4 of the MAX31855T on the breakout board is 3.109 V, which I think is just within the recommended operating range of the chip as per spec sheet (3.0v to 3.6v). Im feeding the breakout board with 5.06v from Vcc on the Arduino so I guess there must be a voltage regulator on the board.

But are there also level converters on the board for the signal lines? And how stable is the power supply? It seems that several people are experiencing the same problems, so I would guess that this board is badly designed. The more direct your access to the chip is, the better the datasheet will tell you how to operate. If you have circuitry in between, you should have the schematics to know how these components might behave.

I believe your issue is a mismatch between Thermocouple type and measurement board.

Even though K and T Type are 'pretty much the same' it is in fact not.
41 µV/°C versus 43 µV/°C a 7.31% difference which matches your errors.

Wiki...
Type K (chromel – alumel) is the most common general purpose thermocouple with a sensitivity of approximately 41 µV/°C
(chromel positive relative to alumel when the junction temperature is higher than the reference temperature).[10] It is inexpensive, and a wide variety of probes are available in its ?200 °C to +1350 °C / -330 °F to +2460 °F range.

Type T (copper – constantan) thermocouples are suited for measurements in the ?200 to 350 °C range. Often used as a differential measurement since only copper wire touches the probes. Since both conductors are non-magnetic, there is no Curie point and thus no abrupt change in characteristics. Type T thermocouples have a sensitivity of about 43 µV/°C

PS
I too have written a K-Type library for the MAX31855...

Thermocouples that are very cheap but good:

Thanks George,

I'm pretty sure that I am using a T type thermocouple (they are labelled 'T' Type) and a T type board (the chip is suffixed 'T'). I've tried several makes of T type thermocouple, all give the same result, so I suspect the board.

Kit:
Black Box Tech MAX31855 T Type breakout board, details here:

T Type thin wire Thermocouple:

Curiously I've just noticed that increasing the temperature of the MAX31855T (by putting my finger on it) increases the reported temperature of the thermocouple too - to the correct temperature of the room. I'll try this when I get back in the lab with some liquid N2.

Im waiting for the postman to deliver some new 'Playing with Fusion' T type boards, so we'll see how those work.

Thanks for posting...

Okay... then they should match.
You could try my library as it's entirely integer and tested at 0c and 100c with K-type.
The library will work with any thermocouple type as long as the probe and chip are matched.

Well my new 'Playing with Fusion' T type board and bi-directional level shifter arrived from US the other day so I rebuilt the circuit as the attached picture, connected up a T Type, loaded the sketch supplied by the guys at playing with fusion....

...and it reads with the same kind or error as the BBTech board.... arghh now I'm wondering if there is something fundamentally wrong with the MAX 31855. Has anyone out there ever got reliable readings from this chip?

I tried the code below based on Cory Fowler's library too, same result.

Noticing that the board doesnt like to be poked or moved (it results in error readings) I also wonder if there is something wrong with building this circuit on a breadboard - I've seen a few posts on the forum suggesting this can be problematic with some devices. Any experience of this anyone?

Any other suggestions anyone? This is driving me bonkers.....

Here's the hardware Im now using:

Playing with Fusion Level shifter : Playing With Fusion - Bi-Directional Level Translator with LDO (8ch)
Playing with Fusion 4 Channel T Type MAX31855T board : Playing With Fusion - MAX31855 T-Type Thermocouple Sensor Breakout (4ch)
There's a Playing with Fusion sketch at the site too.

...and here's the code adapted from Cory's example.

#include <SPI.h>
#include <MAX31855.h>

const int csPin1 = 10;//the pin asked to read  CS
const byte scale = 0;   // 0 is Celsius/Centigrade, ~80µs. 1 is Kelvin, ~108µs. 2 is Fahrenheit ~100µs. 3 is Rankine, ~100µs.
byte error;
double external;
double internal;

MAX31855 TC1(csPin1);

void setup(){
  Serial.begin(57600);
  pinMode(csPin1, OUTPUT);
  digitalWrite(csPin1, HIGH);
}

void loop(){
  TC1.getTemp(external, internal, scale, error);
  Serial.print("Cold Junction Temp: ");
  Serial.print(internal);
  Serial.print("C   ");
  Serial.print("Thermocouple Temp: ");
  Serial.print(external);
  Serial.println("C");
  if (error & 0x01){
    Serial.println("ERROR: Thermocouple Open!!");
  }else if (error & 0x02){
    Serial.println("ERROR: Thermocouple Shorted To Ground!!");
  }else if (error & 0x04){
    Serial.println("ERROR: Thermocouple Shorted To Power!!");
  }
  delay(1000);
}

...and it reads with the same kind or error as the BBTech board.... arghh now I'm wondering if there is something fundamentally wrong with the MAX 31855. Has anyone out there ever got reliable readings from this chip?

Yes, I use the K-Type with the Adafruit board and it is very stable.
One of the reasons I wrote my own MAX31855 library was because all other libraries I could find simply ignore the MAX31855 returned error codes.

 //CS pins high to turn off
  digitalWrite(csPin1, HIGH); 
    
  tc1.begin();

  digitalWrite(csPin1, LOW); //Switch ON CS

You should not be toggling the csPin1.
This is handled by the library. " digitalWrite(csPin1, LOW)" will signal the MAX31855 to start a new conversion.
toggling the csPin1 in your code should be removed. That should help!

Thanks again George,

I tried your library, neat, but same result. I'm now convinced its hardware problem rather than software. I love to hear from anyone who has successfully used a MAX 31855T with a T Type as I'm beginning to suspect the chip as both the the BBetch and Playing with Fusion breakouts give similar results, the common factor being the MAXIM chip. Or perhaps its the way I've wired it - did your K Type set up work OK on a breadboard?

I suspected perhaps a mis-labelled thermocouple, was a K type masquerading as a T type? I tried a brand new one. Nope same thing.

I wish I could use a K Type, but the application demands a T type.

Thanks for your post....

Or perhaps its the way I've wired it - did your K Type set up work OK on a breadboard?

I've only used it with the Adafruit 31855 K-Type board.
It includes a 3v3 regulator.