Overview
The max31865 node reads temperature from PT100 or PT1000 RTD (Resistance
Temperature Detector) sensors using the Maxim MAX31865 RTD-to-digital converter. Supporting 2-, 3-, and 4-wire
RTD configurations, it provides exceptional accuracy and stability for precision temperature measurement
in laboratory, industrial process, and scientific applications.
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) |
| rtdType | select | PT100 | RTD sensor type: PT100, PT1000 |
| wires | select | 3 | RTD wire configuration: 2, 3, or 4 |
| refResistor | number | 430 | Reference resistor value in ohms (430 for PT100, 4300 for PT1000) |
| unit | select | celsius | Temperature unit: celsius, fahrenheit |
RTD Wire Configurations
2-Wire
- Simplest connection
- Wire resistance included in measurement
- Best for short cable runs
- Lowest cost
3-Wire (Recommended)
- Compensates for wire resistance
- Most common configuration
- Good balance of accuracy and cost
- Suitable for most applications
4-Wire
- Full wire resistance compensation
- Highest accuracy
- Required for long cable runs
- Laboratory-grade measurement
Output
{
"temperature": 23.45,
"resistance": 109.12,
"rtdType": "PT100",
"wires": 3,
"unit": "celsius",
"fault": null,
"timestamp": 1640000000000
} Fault codes: null = no fault, "OVUV" = over/undervoltage,
"RTDIN-" = RTDIN- open, "REFIN-" = REFIN- open,
"REFIN+" = REFIN+ open, "RTD_LOW" = RTD below threshold,
"RTD_HIGH" = RTD above threshold.
Wiring
MAX31865 to Raspberry Pi
VIN → 3.3V
GND → GND
SDO (MISO) → GPIO 9 (MISO)
SDI (MOSI) → GPIO 10 (MOSI)
CLK → GPIO 11 (SCLK)
CS → GPIO 8 (CE0)
For PT100 use 430 ohm Rref. For PT1000 use 4300 ohm Rref. Check jumper settings on breakout board for 2/3/4-wire mode.
3-Wire RTD Connection
PT100 RTD (3-wire) MAX31865
───────────────── ────────
Wire 1 (Red) → RTD+
Wire 2 (Red) → RTD-
Wire 3 (White) → F+
Board Jumpers (3-wire mode):
- Solder jumper on "2/3" position
- Cut trace on "4" position
Enable SPI:
sudo raspi-config
# Interface Options → SPI → Enable Example: Laboratory Temperature Logger
High-precision temperature logging with statistical analysis for laboratory environments.
// Function node: Precision temperature statistics
var temp = msg.temperature;
var resistance = msg.resistance;
var stats = flow.get('tempStats') || {
readings: [],
windowSize: 60 // Keep last 60 readings
};
stats.readings.push(temp);
if (stats.readings.length > stats.windowSize) {
stats.readings.shift();
}
// Calculate statistics
var n = stats.readings.length;
var sum = stats.readings.reduce((a, b) => a + b, 0);
var mean = sum / n;
var variance = stats.readings.reduce((acc, val) => {
return acc + Math.pow(val - mean, 2);
}, 0) / n;
var stdDev = Math.sqrt(variance);
var min = Math.min(...stats.readings);
var max = Math.max(...stats.readings);
flow.set('tempStats', stats);
msg.payload = {
temperature: temp.toFixed(3),
resistance: resistance.toFixed(2),
mean: mean.toFixed(3),
stdDev: stdDev.toFixed(4),
min: min.toFixed(3),
max: max.toFixed(3),
range: (max - min).toFixed(3),
samples: n,
stable: stdDev < 0.05
};
return msg; Example: Industrial Process Monitor
Monitor process temperatures with alarm bands and trend detection.
// Function node: Process alarm handler
var temp = msg.temperature;
var fault = msg.fault;
// Check for sensor faults first
if (fault !== null) {
msg.payload = {
alarm: "SENSOR_FAULT",
severity: "critical",
message: "RTD sensor fault: " + fault,
timestamp: msg.timestamp
};
msg.topic = "alarms/critical";
return msg;
}
// Process alarm bands
var setpoint = 85.0; // Target process temperature
var warnHigh = 90.0;
var warnLow = 80.0;
var alarmHigh = 95.0;
var alarmLow = 75.0;
var alarm = "NORMAL";
var severity = "info";
if (temp >= alarmHigh || temp <= alarmLow) {
alarm = "ALARM";
severity = "critical";
} else if (temp >= warnHigh || temp <= warnLow) {
alarm = "WARNING";
severity = "warning";
}
msg.payload = {
temperature: temp.toFixed(2),
setpoint: setpoint,
deviation: (temp - setpoint).toFixed(2),
alarm: alarm,
severity: severity,
inSpec: (temp >= warnLow && temp <= warnHigh)
};
msg.topic = "process/temperature";
return msg; Common Use Cases
Laboratory Measurement
High-accuracy temperature logging for scientific experiments, calibration baths, and environmental chambers.
Industrial Process Control
Monitor and control process temperatures in chemical, pharmaceutical, and food manufacturing.
HVAC Systems
Precision temperature sensing for supply/return air, chilled water loops, and zone control.
Cold Chain Monitoring
Track temperatures in refrigerated storage, freezers, and transport for compliance logging.