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