Datasheet
MAX31856_TCTYPE_T
MAX31856_VMODE_G8
MAX31856_VMODE_G32
The last two are not thermocouple types, they're just 'plain' voltage readings (check the datasheet for more details, we
don't use these modes in the library)
If you're ever not sure which mode you're in, query it with
Once that's set you can read the cold junction temperature, which will return a floating point Celsius reading. This is
the temperature detected inside the MAX31856 chip ('ambient' temp)
Or, of course, the temperature at the end/tip of the thermocouple, likewise a floating point #
Faults
The MAX31856 has a wide-ranging fault mechanism that can alert you via pin or function when something is amiss.
Don't forget to test this functionality before relying on it!
You can read faults with
Which will return a uint8_t type with bits set for each of 8 different fault types. You can test for each one with this set of
code:
The last two faults are built in. For the low/high threshholds, you can set those with two functions.
For the cold junction (chip) temp, use:
max.getThermocoupleType()
max.readCJTemperature()
max.readThermocoupleTemperature()
max.readFault()
uint8_t fault = max.readFault();
if (fault) {
if (fault & MAX31856_FAULT_CJRANGE) Serial.println("Cold Junction Range Fault");
if (fault & MAX31856_FAULT_TCRANGE) Serial.println("Thermocouple Range Fault");
if (fault & MAX31856_FAULT_CJHIGH) Serial.println("Cold Junction High Fault");
if (fault & MAX31856_FAULT_CJLOW) Serial.println("Cold Junction Low Fault");
if (fault & MAX31856_FAULT_TCHIGH) Serial.println("Thermocouple High Fault");
if (fault & MAX31856_FAULT_TCLOW) Serial.println("Thermocouple Low Fault");
if (fault & MAX31856_FAULT_OVUV) Serial.println("Over/Under Voltage Fault");
if (fault & MAX31856_FAULT_OPEN) Serial.println("Thermocouple Open Fault");
}
© Adafruit Industries https://learn.adafruit.com/adafruit-max31856-thermocouple-amplifier Page 17 of 20










