How Do You Use the MAX31865 RTD-to-Digital Converter with a PT100 Sensor?
Last updated 29 June 2026 · 11 min read
Direct Answer
The MAX31865 is a dedicated SPI-interface RTD-to-digital converter for PT100 and PT1000 sensors. It drives excitation current through the RTD and a precision external reference resistor, measures the ratio ratiometrically with a 15-bit ADC, and returns the result over SPI. For PT100: connect a 430 Ω (±0.1%) reference resistor between FORCE1 and REFIN+; wire the RTD between RTDIN+ and RTDIN- (with FORCE2 as the low-side current return). Write 0xC1 to the configuration register to enable bias voltage, auto-conversion, 2/4-wire mode, and 50 Hz mains filter. Read the 16-bit RTD register at addresses 0x01/0x02, discard the fault bit (LSB), and calculate R_RTD = (code / 32768) × 430. Convert to temperature using T ≈ (R_RTD − 100) / 0.385 for a linear approximation above 0°C, or the Callendar-Van Dusen polynomial from IEC 60751 for full-range accuracy.
Detailed Explanation
The MAX31865 from Analog Devices (formerly Maxim Integrated) replaces the discrete analog measurement chain required for RTD interfacing. Where a custom design needs a precision current source, low-drift reference resistor, instrumentation amplifier, and high-resolution ADC, the MAX31865 integrates all of these into a single 8-pin IC with an SPI interface. The host microcontroller configures it over SPI, triggers or schedules conversions, and reads back a 15-bit resistance code that maps directly to RTD resistance.
For the theory of PT100/PT1000 sensors — excitation current, 2/3/4-wire connections, the IEC 60751 standard, and when to choose an RTD over a thermistor — see PT100 and RTD fundamentals. This page covers the MAX31865 IC implementation specifically.
How the MAX31865 Works
The IC operates on a ratiometric principle. Bias voltage from the internal FORCE outputs drives current through an external reference resistor (R_REF) and the RTD — both in the same series current path. The 15-bit ADC measures the voltage across the RTD (RTDIN+/RTDIN−) and the voltage across the reference resistor (REFIN+/REFIN−), computing their ratio:
RTD_CODE = (V_RTD / V_RREF) × 2¹⁵
= (R_RTD / R_REF) × 32768
Because both voltages share the same excitation current, any variation in that current cancels. Measurement accuracy depends only on the reference resistor's precision and the ADC linearity — not on a stable current source.
Hardware Connections
Reference Resistor and Excitation Path
The reference resistor connects between FORCE1 and REFIN+. REFIN− connects to RTDIN+ (the high side of the RTD), and RTDIN− connects to FORCE2, completing the excitation current loop:
FORCE1 → R_REF (430 Ω) → REFIN+
↓
REFIN− = RTDIN+ → [PT100 RTD] → RTDIN− = FORCE2
Reference resistor selection:
| RTD type | R_REF (nominal) | Required tolerance | Max temperature coefficient |
|---|---|---|---|
| PT100 | 430 Ω | ±0.1% | 25 ppm/°C |
| PT1000 | 4300 Ω | ±0.1% | 25 ppm/°C |
Use a precision metal-film resistor (e.g. Vishay MRS or Panasonic ERA series). A ±1% resistor introduces approximately ±2.6°C systematic error at room temperature — the reference resistor is the primary accuracy bottleneck in the signal chain.
2-Wire, 3-Wire, and 4-Wire RTD Connections
2-wire (avoid for accuracy-critical applications): RTDIN+ and RTDIN− connect directly to the two RTD terminals, sharing the same wires as the excitation current. Cable resistance adds directly to the RTD reading, causing a positive temperature offset. Acceptable only for cable runs under approximately 0.5 m at low accuracy requirements.
3-wire (standard industrial practice): Three wires run to the RTD — one shared force/sense wire and two individual sense wires. The MAX31865 compensates for lead resistance by measuring it separately via FORCE2 during the conversion cycle. Set bit 4 of the configuration register to enable 3-wire compensation. This assumes all three leads have equal resistance, which is a valid assumption for matched cables.
4-wire (best accuracy): Two dedicated force wires carry the excitation current (via FORCE1 and FORCE2 through the RTD); two separate sense wires connect RTDIN+/RTDIN− directly at the RTD terminals, carrying negligible current. Lead resistance of the sense wires causes no voltage error. Use 4-wire for cable runs over approximately 5 m, or when accuracy better than ±0.5°C is required. This mode uses the same configuration register setting as 2-wire (bit 4 = 0).
SPI Interface Connections
The MAX31865 supports SPI Mode 1 or Mode 3 (CPHA = 1 in both cases — data clocked on the falling edge of SCLK). Maximum SCLK is typically 5 MHz per the datasheet. Pull CSB low to begin a transaction. If reads return 0xFF despite correct wiring, an SPI mode mismatch is the most likely cause — see diagnosing SPI CPOL/CPHA faults for a logic-analyser-based diagnosis approach.
| MAX31865 pin | MCU SPI pin |
|---|---|
| SDI | MOSI |
| SDO | MISO |
| SCLK | SCK |
| CSB | GPIO (active-low chip select) |
| VDD | 3.3 V or 5 V |
| GND | GND |
Mount a 100 nF ceramic decoupling capacitor between VREG and GND as close to the IC as practical.
SPI Registers and Configuration
Read addresses are the register index (0x00–0x07); write addresses are the register index with bit 7 set (0x80–0x87).
Configuration register (read: 0x00, write: 0x80):
| Bit | Name | Value 0 | Value 1 |
|---|---|---|---|
| 7 | VBIAS | Off | On — required before any conversion |
| 6 | Conversion mode | Manual (use 1-shot) | Automatic continuous |
| 5 | 1-shot | — | Start one conversion (self-clearing) |
| 4 | 3-wire | 2-wire or 4-wire mode | 3-wire compensation enabled |
| 3:2 | Fault detection | Off | Controlled by cycle |
| 1 | Fault status clear | — | Clears fault register (write 1, reads back 0) |
| 0 | 50/60 Hz filter | 60 Hz rejection | 50 Hz rejection |
Recommended configuration values:
| Use case | Config byte | Notes |
|---|---|---|
| 2/4-wire, 50 Hz mains, auto | 0xC1 | Default for Australia; continuous conversion |
| 3-wire, 50 Hz mains, auto | 0xD1 | 3-wire PT100, Australia |
| 2/4-wire, 60 Hz, auto | 0xC0 | For 60 Hz regions or isolated laboratory |
| 2/4-wire, 50 Hz, single-shot | 0xA1 | VBIAS on, one-shot trigger, then disable bias |
For battery-powered products, use single-shot mode: enable VBIAS, wait at least 10 ms for settling, trigger a conversion (write bit 5), wait approximately 75 ms (50 Hz filter), read the result, then disable VBIAS to eliminate quiescent current through R_REF.
RTD data registers (0x01 and 0x02):
A sequential two-byte read beginning at 0x01 returns the full 16-bit RTD register:
Bits [15:1] = 15-bit RTD ADC code (MSB first)
Bit [0] = Fault bit (1 = fault detected — check fault status register)
Fault status register (0x07):
| Bit | Fault condition | Typical cause |
|---|---|---|
| 7 | RTD high threshold exceeded | Open RTD lead or over-range |
| 6 | RTD low threshold exceeded | Shorted RTD |
| 5 | REFIN− above 0.85 × VBIAS | Open reference resistor connection |
| 4 | REFIN− below 0.85 × VBIAS | Same — open reference resistor |
| 3 | RTDIN− below 0.85 × VBIAS | Open RTD lead or disconnected sensor |
| 2 | Overvoltage/undervoltage fault | Input out of range |
Reading and Converting Temperature
Step 1 — Read the RTD Code
// Read 2 bytes from register 0x01 (RTD MSB) and 0x02 (RTD LSB)
uint8_t msb = spi_read_register(0x01);
uint8_t lsb = spi_read_register(0x02);
uint16_t raw = ((uint16_t)msb << 8) | lsb;
if (raw & 0x0001) {
// Fault bit is set — read fault status register for diagnosis
uint8_t fault = spi_read_register(0x07);
handle_fault(fault);
return;
}
uint16_t rtd_code = raw >> 1; // 15-bit ADC code (fault bit removed)
Step 2 — Convert Code to Resistance
#define R_REF 430.0f // Reference resistor in ohms (PT100)
#define R0 100.0f // PT100 nominal resistance at 0°C
float r_rtd = ((float)rtd_code / 32768.0f) * R_REF;
Expected values for PT100 with a 430 Ω reference:
| Temperature | PT100 resistance | RTD code (approx.) |
|---|---|---|
| −40°C | 84.27 Ω | 6432 |
| 0°C | 100.00 Ω | 7629 |
| 25°C | 109.73 Ω | 8372 |
| 100°C | 138.51 Ω | 10567 |
| 200°C | 175.84 Ω | 13418 |
Temperature resolution: approximately 0.034°C per LSB (430 / 32768 Ω ÷ 0.385 Ω/°C), which is sufficient for virtually all PT100 applications.
Step 3 — Convert Resistance to Temperature
Linear approximation (0°C to approximately +200°C, typically within ±0.5°C):
// T ≈ (R_RTD - R0) / (R0 × α)
// α = 0.00385 Ω/Ω/°C (IEC 60751 alpha coefficient for standard platinum)
float temp_c = (r_rtd - R0) / (R0 * 0.00385f);
Callendar-Van Dusen polynomial (IEC 60751, better than ±0.1°C above 0°C):
For T ≥ 0°C, the IEC 60751 relationship is:
R(T) = R0 × (1 + A×T + B×T²)
where A = 3.9083 × 10⁻³ °C⁻¹ and B = −5.775 × 10⁻⁷ °C⁻².
Solving quadratically for T:
#define CVD_A 3.9083e-3f
#define CVD_B -5.775e-7f
float temp_c = (-CVD_A + sqrtf(CVD_A * CVD_A - 4.0f * CVD_B * (1.0f - r_rtd / R0)))
/ (2.0f * CVD_B);
For temperatures below 0°C, an additional C term (−4.183 × 10⁻¹² °C⁻⁴) is required per IEC 60751. For sub-zero accuracy, a pre-computed IEC 60751 lookup table is the most practical firmware approach.
Fault Detection
Check the fault bit on every reading and inspect the fault status register when it is set. Latched faults persist until explicitly cleared — write bit 1 of the configuration register:
uint8_t config = spi_read_register(0x00);
spi_write_register(0x80, config | 0x02); // Set bit 1 to clear fault status
Design Considerations
- Power-on settling: After enabling VBIAS (bit 7 of Config = 1), wait at least 10 ms before triggering a conversion. The bias circuit requires time to settle before the reference resistor voltage is stable enough for an accurate reading.
- 50 Hz filter for Australian designs: Australia operates on 50 Hz mains. Set the filter bit (bit 0 = 1 in Config) to reject 50 Hz interference from nearby power circuitry and long RTD cable runs. The 50 Hz filter setting extends the effective conversion time to approximately 75 ms.
- Reference resistor placement and quality: Mount the reference resistor close to the MAX31865. Use a precision metal-film resistor rated ±0.1% with a temperature coefficient of ≤ 25 ppm/°C. Carbon-film resistors (typically ±100–200 ppm/°C) will dominate the measurement error. Do not use a general-purpose 470 Ω or other E24-series value in place of 430 Ω — the mismatch shifts every temperature reading proportionally.
- Cable shielding for long RTD runs: RTD cables over approximately 3 m in industrial environments pick up 50/60 Hz and RF interference. Use shielded twisted-pair cable and connect the shield to a single ground point at the measurement electronics end. The MAX31865's built-in noise filter provides rejection of in-band mains noise. For broader guidance on reducing noise in sensor interfaces, see sensor signal conditioning basics.
- Single-shot mode for power-sensitive designs: In battery-powered products, disable VBIAS between readings. The quiescent current flowing through R_REF in continuous mode contributes to battery drain. In single-shot mode, current is only drawn during the brief conversion window.
For complex sensor integration — including RTD interface design, multi-channel data acquisition, PCB layout, and embedded firmware — Zeus Design provides end-to-end electronics engineering services.
Common Mistakes
- Wrong reference resistor value: The 430 Ω reference resistor is not interchangeable with the nearest E24-series value (470 Ω). A 10% mismatch shifts the RTD code and produces a proportional temperature offset that cannot be corrected by firmware calibration alone without also updating the R_REF constant. Use 430 Ω precisely, or update both the resistor and the software constant to match.
- Not enabling VBIAS before conversion: If a conversion is triggered with bit 7 of the configuration register at 0, the excitation circuit is inactive. The RTD code returns near zero or sets a fault. Always enable VBIAS and wait 10 ms before the first conversion.
- Mismatched wire mode configuration: A 4-wire RTD operated in 3-wire mode (or vice versa) produces inaccurate readings or fault conditions. Verify the physical wiring and confirm bit 4 of the configuration register matches it.
- Ignoring the fault bit: The LSB of the 16-bit RTD register is a fault flag, not part of the resistance code. Reading the raw 16-bit value without right-shifting includes this bit in the calculation, producing a resistance value about twice the real one at the fault boundary. Always right-shift by 1 before using the code.
- Using the linear approximation below 0°C: The approximation T ≈ (R_RTD − 100) / 0.385 is accurate to within approximately ±0.5°C from 0°C to +100°C but diverges significantly at sub-zero temperatures. Use the Callendar-Van Dusen polynomial or an IEC 60751 lookup table for measurements below 0°C.
Frequently Asked Questions
- What reference resistor value should I use with the MAX31865 for PT100 and PT1000?
- For PT100, the reference resistor should be 430 Ω — approximately 4.3× the PT100 nominal resistance at 0°C, as recommended in the MAX31865 datasheet. For PT1000, use 4300 Ω (4.3× the 1000 Ω nominal). Use a precision metal-film resistor rated ±0.1% tolerance with a temperature coefficient of 10–25 ppm/°C or better. The accuracy of the temperature measurement is directly limited by the reference resistor's precision — a ±1% resistor contributes approximately ±2.6°C of systematic error for PT100.
- Why does the MAX31865 use a ratiometric measurement instead of a precision voltage reference?
- A ratiometric design makes the measurement independent of the excitation current value. The MAX31865 measures the ratio V_RTD / V_RREF — both voltages are generated by the same excitation current flowing through the RTD and the reference resistor in series. If the excitation current changes due to temperature, supply voltage variation, or load variation, both voltages change by the same proportion and the ratio remains constant. The only components that need to be stable are the reference resistor and the ADC's linearity — both much easier to achieve than a precision constant-current source.
- How do I configure the MAX31865 for a 3-wire PT100?
- Set bit 4 of the configuration register to 1. For 3-wire, auto-conversion, and 50 Hz filter, write 0xD1 to the configuration register (write address 0x80). In 3-wire mode, the IC connects FORCE2 to the reference resistor side during the measurement cycle and measures a compensation voltage to subtract the lead-resistance error. This compensation assumes all three lead wires have equal resistance — a valid assumption for cables of the same gauge and length from sensor to electronics. For cables with unequal lead lengths, a 4-wire connection gives better accuracy.
References
Related Questions
How Do PT100 and RTD Temperature Sensors Work?
Covers PT100/PT1000 RTD sensors: 2-wire, 3-wire, and 4-wire connections, excitation current, Wheatstone bridge conditioning, and when to choose an RTD.
How Do You Interface a Digital Temperature Sensor?
Covers DS18B20 (1-Wire, parasite power, multiple devices) and MCP9808 (I2C, alert pin) interfacing — circuit requirements and MCU firmware notes.
What Is a Thermistor and How Do You Use One?
Covers NTC thermistor voltage divider circuits, Steinhart-Hart equation, self-heating error, ADC interface, and selection for temperature measurement.
Sensor Signal Conditioning Basics
Covers signal conditioning for sensors: op-amp gain, offset, 4-20mA interface, anti-aliasing filter design, ADC input protection, and two-point calibration.
What Is SPI (Serial Peripheral Interface)?
SPI is a synchronous full-duplex serial bus for connecting microcontrollers to peripherals at high speed. Learn how SCLK, MOSI, MISO, and CS work.