Max31855 temperature error

I'm having trouble getting sensible readings from a MAX31855 breakout board connected to my arduino via a bidirectional level shifter. For the longest time I couldn't get it to read anything and eventually found by looking at the bits in an integer that the SPI function returns that it was showing the error "Thermocouple is connected to ground". Sure enough I got the magnifying glass out and there is a trace on the PCB from Ground to T-. Is there any reason this would be suitable? It is a cheap eBay copy that looks nothing like it did in the picture :confused: suppose that is to be expected.

That is not the issue anyway, I ran a razor blade through that trace and I am now getting readings on my thermocouple that look something like this from the serial monitor.

MAX31855 test
Internal Temp = 22.56
C = 16.50
Internal Temp = 22.50
C = 16.50
Internal Temp = 22.56
C = 16.25
Internal Temp = 22.56
C = 16.25
Internal Temp = 22.56
C = 16.25
Internal Temp = 22.56
C = 16.25

The TC has been resting at room temperature for hours so it should read closer to the internal temp of the IC right? If I pinch it with my fingers it raises to ~25 or so and if I touch it to an ice cube it drops to -4 or so.

Is there anything I can do to improve the accuracy of this device? Is this a common issue running from a dirty arduino MCU? I have got a small 100pF capacitor across the TC terminals which seems to help a little but not much.

From the datasheet:

T- Thermocouple Input. See Table 1. Do not connect to GND.

So it doesn't seem to be suitable to have a connection there. Get another break out board from a supplier that did a better job.

Is this a common issue running from a dirty arduino MCU?

I keep mine clean, but the problem is pretty obviously the worthless sensor board, possibly with a fake or reject 31855 chip.

Thanks for replies. I couldn't imagine it is the breakout board, since it only has one other component being a capacitor across Vcc and Ground as data sheet requests. The chip - maybe... Being all the way down here in NZ Adafruit want almost $40 for shipping the $15 board which makes the eyes water. The eBay one was $3 and free shipping to NZ haha... How the Chinese manage that I have no idea.

I played around with it some more today, boiling water and ice slurry, it is actually not terrible - are these results within the ballpark or I still have a dodgy chip?

MAX31855 test
Internal Temp = 20.94
C = 18.25

.....

Internal Temp = 20.94
C = 55.25
Internal Temp = 21.00
C = 96.25
Internal Temp = 20.94
C = 96.50
Internal Temp = 21.00
C = 98.00
Internal Temp = 21.00
C = 96.50
Internal Temp = 21.00
C = 98.00

.....

Internal Temp = 21.06
C = 67.00
Internal Temp = 21.06
C = 50.75
Internal Temp = 21.06
C = -0.75
Internal Temp = 21.06
C = -1.00
Internal Temp = 21.12
C = -0.75
Internal Temp = 21.12
C = -0.25
Internal Temp = 21.12
C = 0.00

.....

Internal Temp = 21.19
C = 2.25
Internal Temp = 21.19
C = 96.50
Internal Temp = 21.25
C = 96.25
Internal Temp = 21.19
C = 94.75
Internal Temp = 21.25
C = 97.00
Internal Temp = 21.25
C = 97.00

jremington:
I keep mine clean, but the problem...

:stuck_out_tongue_closed_eyes: You know what I mean lol

You know what I mean lol

Actually, I have no idea what you mean. The ATMega chips used in the Arduino are perfectly functional, completely debugged computers, and they do exactly what your program tells them to do.

The CPUs are never a source of measurement error.

You didn't tell us which Aduino you're using, which level shifter, and how you power that breakout board.
The datasheet shows a possible CJ temp error of four degrees (-2C to +2C).
Same for the thermocouple result.
You could calibrate that away in software.
Leo..

I'm using an Arduino Uno, a no-name 4ch level shifter identical to the one in the image. I have the Max31855 breakouts Vcc, and the level shifters low voltage reference tied to the 3.3V pin on the arduino.

I have made some changes and am getting quite acceptable results now. I've done away with USB power and gone to a 9V battery (now writing results to an SD card), and soldered the thermocouple wires and capacitor directly to breakout board. I tested between each step and both proved helpful. The raw output for boiling/iced water was something like 98.5 and 1.0. The output below is after 2 point calibration.

millis temp
1059 17.60
1641 19.39
2224 19.39
2805 19.39
3387 19.39
3969 19.39
4551 19.39
5133 19.39
5714 19.39
6297 19.64
6879 19.90
7460 20.15
8042 20.15
8625 20.15
9206 20.41
9788 20.41
10371 20.41
10952 21.17
11534 55.36 -Boiling water
12116 99.49
12698 99.23
13280 99.74
13862 99.49
14445 99.49
15028 98.98
15609 99.49
16191 99.74
16774 99.74
17355 99.74
17937 99.49
18519 99.49
19101 99.49
19683 99.23
20264 99.49
20847 99.74
21429 99.49
22010 63.78 -Removed from water
22592 51.79
23175 46.94
23756 43.11
24338 41.33
24924 40.31
25505 39.80
26087 38.52
26670 36.48
27251 2.30 -Ice slurry
27833 0.51
28414 0.51
28997 0.51
29579 0.51
30160 0.26
30742 0.26
31325 0.51
31906 0.51
32490 0.26
33072 0.26
33653 0.26
34236 0.26
34820 0.26
35402 0.26
35984 0.26
36566 0.26
37147 0.51
37729 2.55 -Removed from water
38311 4.34
38893 5.61
39475 7.40
40056 9.69
40639 10.97
41221 11.22
41802 11.22

USB power is incredibly dirty usually, its not good for sensitive analog electronics. In general the
best way to do analog is with a linear regulator or a battery.

MarkT:
USB power is incredibly dirty usually, its not good for sensitive analog electronics. In general the
best way to do analog is with a linear regulator or a battery.

Yep I do realise that and is what I was getting at re dirty Arduino. Soldering the TC to the board helped at least as much as switching to stable power too. Definitely worth doing away with the terminal block.

Halo, I have a problem with Max31855 reading. It's okay when reading ambient temperature but whenever I place it into boiling water (either with the electricity turned on or turned off), the reading became nan. I don't know what to do, kindly help me.
thankyou

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

int Counter = 0;

Adafruit_MAX31855 thermocouple[2] = {Adafruit_MAX31855(6,5,4), Adafruit_MAX31855(12,11,10)};
OneWire ds(9);

void setup()
{
// ts.SetOffset(0);
// set offset for temperature measurement.
Serial.begin(9600);
}

void loop()
{

Serial.print("DATA, DATE, TIME,");
Counter = Counter + 1;
float ds = getTemp();
ds = ((ds + 2.1552)/1.0519);
Serial.print(Counter);
for (int i = 0; i < 2; i++)
{
Serial.print(",");
Serial.print(thermocouple*.readCelsius(), 1);*

  • }*
  • Serial.print(",");*
  • Serial.print(ds,1);*
  • Serial.print(",");*
  • Serial.println();*
  • delay(200);*
    }
    float getTemp(){
  • //return the temperature from one DS18S20 in Deg Celcius*
  • byte data[12];*
  • byte addr[8];*
  • if ( !ds.search(addr)){*
  • //no more sensors on chain, reset search*
  • ds.reset_search();*
  • return -1000;*
  • }*
    if ( OneWire::crc8( addr, 7) != addr[7]){
  • Serial.println("CRC is not valid!");*
  • return -1000;*
    }
    ds.reset();
    ds.select(addr);
    ds.write(0x44,1); //start conversion with parasite power on at the end
    byte present = ds.reset();
    ds.select(addr);
    ds.write(0xBE); // Read Scratchpad
    for (int i = 0; i < 9; i++){ // we need 9 bytes
    _ data = ds.read();_
    }
    ds.reset_search();
    byte MSB = data[1];
    byte LSB = data[0];
    float tempRead = ((MSB << 8) | LSB); //using two's compliment
    float TemperatureSum = tempRead / 16;
    return TemperatureSum;
    }

It's okay when reading ambient temperature but whenever I place it into boiling water (either with the electricity turned on or turned off), the reading became nan.

The MAX31855 isn't constructed to be put into water, the same is true for most thermocouples on the market. Have tried to put the thermocouple on the pot containing the boiling water? Does it provide meaningful data? Why is there OneWire code in your sketch?