Skip to main content

max31855

K-type thermocouple amplifier for high-temperature measurement up to 1350°C.

Overview

The max31855 node reads temperature from K-type (and other) thermocouples using the Maxim MAX31855 cold-junction compensated thermocouple-to-digital converter. Communicating over SPI, it provides 14-bit thermocouple temperature data and built-in fault detection. Ideal for kilns, ovens, industrial furnaces, and any application requiring high-temperature measurement.

1350°C
Max Temperature
±2°C
Accuracy
14-bit
Resolution
SPI
Interface

Properties

Property Type Default Description
spiBus number 0 SPI bus number
spiDevice number 0 SPI device (chip select): 0 = CE0, 1 = CE1
spiSpeed number 5000000 SPI clock speed in Hz (max 5 MHz)
type select K Thermocouple type: K, J, N, S, T, E, R
unit select celsius Temperature unit: celsius, fahrenheit

Thermocouple Types

Type Range Best For
K -200 to 1350°C General purpose, most common
J -210 to 760°C Vacuum, reducing atmospheres
N -270 to 1300°C High stability, nuclear
S -50 to 1768°C Very high temperature, platinum
T -200 to 350°C Cryogenics, food processing
E -270 to 870°C Highest output, cryogenics
R -50 to 1768°C Very high temperature, platinum

Output

{
  "temperature": 482.25,
  "internalTemp": 25.5,
  "thermocoupleType": "K",
  "unit": "celsius",
  "fault": null,
  "timestamp": 1640000000000
}

Fault codes: null = no fault, "OC" = open circuit (no thermocouple), "SCG" = short to GND, "SCV" = short to VCC.

Wiring

MAX31855 to Raspberry Pi

VCC → 3.3V

GND → GND

DO (MISO) → GPIO 9 (MISO)

CLK → GPIO 11 (SCLK)

CS → GPIO 8 (CE0)

Do not connect thermocouple wires directly to a breadboard. Use the screw terminal on the breakout board.

Enable SPI

sudo raspi-config
# Interface Options → SPI → Enable

# Verify SPI is available:
ls /dev/spi*
# Should show /dev/spidev0.0

# Connection diagram:
#
#  Thermocouple    MAX31855     Pi
#  ───────────    ─────────   ────
#   + (Yellow) → T+
#   - (Red)    → T-
#                  VCC  →  3.3V
#                  GND  →  GND
#                  DO   →  MISO
#                  CLK  →  SCLK
#                  CS   →  CE0

Example: Kiln Temperature Controller

Monitor kiln temperature and follow a programmable firing profile.

max31855 function gpio-out
// Function node: Kiln firing profile controller
var temp = msg.temperature;
var fault = msg.fault;

// Safety: shut down on fault
if (fault !== null) {
    msg.payload = 0; // OFF
    msg.alert = "Thermocouple fault: " + fault;
    return msg;
}

// Firing profile (ramp/soak segments)
var profile = [
    { target: 600, rate: 100, soak: 30 },   // 100°C/hr to 600°C, hold 30min
    { target: 1000, rate: 150, soak: 15 },  // 150°C/hr to 1000°C, hold 15min
    { target: 1250, rate: 50, soak: 60 }    // 50°C/hr to 1250°C, hold 60min
];

var state = flow.get('kilnState') || {
    segment: 0,
    phase: "ramp",
    startTime: Date.now()
};

var segment = profile[state.segment];
var targetTemp = segment ? segment.target : 0;

// Simple on/off control with hysteresis
var hysteresis = 5;
var heaterOn = false;

if (temp < targetTemp - hysteresis) {
    heaterOn = true;
} else if (temp >= targetTemp) {
    heaterOn = false;
}

flow.set('kilnState', state);

msg.payload = {
    heater: heaterOn ? 1 : 0,
    currentTemp: temp,
    targetTemp: targetTemp,
    segment: state.segment,
    phase: state.phase
};

return msg;

Example: Multi-Zone Oven Monitor

Read multiple thermocouples across different oven zones and detect imbalances.

// Function node: Zone temperature analysis
var temp = msg.temperature;
var zone = msg.topic; // e.g. "zone1", "zone2", "zone3"

var zones = flow.get('ovenZones') || {};
zones[zone] = { temp: temp, time: Date.now() };
flow.set('ovenZones', zones);

var keys = Object.keys(zones);
if (keys.length < 2) return null; // Wait for all zones

var temps = keys.map(k => zones[k].temp);
var avg = temps.reduce((a, b) => a + b, 0) / temps.length;
var maxDiff = Math.max(...temps) - Math.min(...temps);

msg.payload = {
    zones: zones,
    averageTemp: avg.toFixed(1),
    maxDifference: maxDiff.toFixed(1),
    balanced: maxDiff < 20,
    alert: maxDiff >= 20 ? "Zone imbalance detected: " + maxDiff.toFixed(0) + "°C spread" : null
};

return msg;

Common Use Cases

Kiln / Furnace Control

Monitor and control ceramic kiln or metal furnace temperatures with programmable firing profiles.

Oven Monitoring

Track multi-zone oven temperatures in commercial baking or industrial heat treatment processes.

Exhaust Gas Temperature

Measure exhaust gas temperatures in engines, boilers, or combustion systems for efficiency tuning.

Soldering / Reflow

Control reflow oven profiles for PCB soldering with precise temperature ramp and soak stages.

Related Nodes