A thermocouple is the temperature probe to reach for when a DS18B20 or a typical I²C room sensor cannot tolerate the heat. A K-type probe can monitor an exhaust pipe, oven or barbecue, but its output is only a tiny voltage. The MAX31856 converts that signal into a digital temperature, applies cold-junction compensation and communicates with an ESP32 over SPI. ESPHome can then publish the result to Home Assistant without a custom Arduino sketch.
This guide covers the actual wiring, a complete ESPHome configuration, choosing among thermocouple types, wiring multiple probes, troubleshooting unstable or missing readings and building useful Home Assistant monitoring. It also explains the limits of a sensor connected to a Wi-Fi microcontroller: a convenient monitoring project is not a replacement for a certified high-temperature safety controller.
MAX31856 vs MAX31855 vs MAX31865: choose the right interface
These part numbers look nearly identical but the probe technology matters more than the name. MAX31856 and MAX31855 read thermocouples; the MAX31865 reads platinum resistance temperature detectors (RTDs) such as PT100 and PT1000. You cannot substitute one probe type for the other by changing a line of YAML. The MAX31856 also supports more thermocouple types than the commonly used K-type MAX31855 modules.
| Interface | Probe | Practical distinction |
|---|---|---|
| MAX31856 | Thermocouple: B, E, J, K, N, R, S or T | Select the actual type in ESPHome; SPI uses clock, MOSI, MISO and chip select. |
| MAX31855 | Thermocouple; check the specific chip variant | Simpler interface, with thermocouple-type support tied to the IC variant. |
| MAX31865 | PT100/PT1000 platinum RTD | Measures resistance; RTD wiring and breakout reference resistor affect readings. |
If your probe is marked PT100 or PT1000, use our MAX31865 with ESP32 and ESPHome guide instead. This article assumes a genuine MAX31856 breakout and a thermocouple whose type you can identify.
What the MAX31856 measures—and what its specifications do not promise
A thermocouple produces a small voltage related to the temperature difference between its measurement junction and its connection terminals. The MAX31856 measures the probe signal, senses its own cold-junction region and calculates an approximate junction temperature. It includes linearisation data for eight standard thermocouple types, 50/60 Hz interference filtering and fault detection for conditions including an open probe. The converter returns the processed temperature in degrees Celsius.
Analog Devices specifies a fine digital temperature resolution of 0.0078125°C. That does not mean a complete project measures temperature accurately to a hundredth of a degree. Probe tolerance, connector metals, cold-junction thermal gradients, mechanical contact and electrical noise can contribute much larger errors. A high-resolution dashboard can still be consistently wrong if the wrong probe type is selected or the breakout is sitting in a hot enclosure.
The converter supports output temperatures from around −210°C to +1800°C depending on thermocouple type. The breakout board, terminal block, cable insulation and probe itself do not automatically share that entire range. Keep the electronics in an environment within their own ratings and position only a correctly rated probe in the hot zone. For exact temperature limits and error conditions, consult the manufacturer’s MAX31856 documentation and the probe specification.
Parts and electrical compatibility
- ESP32 development board: the wiring below targets a conventional ESP32 DevKit; change GPIO assignments for other ESP32 variants or boards with built-in peripherals.
- MAX31856 breakout: preferably a documented 3.3 V logic-compatible module. The Adafruit breakout has a regulator and level shifting; unbranded boards may not.
- Known thermocouple: a properly rated K-type probe is a common starting point, but use the actual type supplied with your application.
- Stable USB power, suitable connecting wires and an enclosure: keep the ESP32 and converter away from heat, steam and exposed metalwork.
- Home Assistant with ESPHome: optional for basic measurement, but useful for history, alerts and dashboards.
Important power distinction: the bare MAX31856 IC uses roughly 3.3 V supply and logic. On an Adafruit-style breakout, the VIN pin accepts regulated 3–5 V and the board conditions SPI logic, so powering VIN from the ESP32’s 3V3 rail is a simple choice. A pin marked 3Vo on that breakout is a regulated output, not an extra sensor input. If your module has VCC rather than VIN, check its schematic or seller’s documented pinout before applying 5 V. Never assume a bare-chip board has the Adafruit regulator or level shifters.
Wire the MAX31856 to a standard ESP32 DevKit
SPI uses a clock, one data line in each direction and an individual chip-select signal. The table uses the familiar classic ESP32 pins GPIO18, GPIO19 and GPIO23, plus GPIO27 for chip select. These are examples, not universal pin numbers for every ESP32-S3, C3 or custom board. Confirm the actual board labels and available pins before connecting anything.
| MAX31856 breakout label | ESP32 DevKit connection | Function |
|---|---|---|
| VIN (regulated breakout only) | 3V3 | Breakout supply; verify its required supply first. |
| GND | GND | Common logic/power ground. |
| CLK / SCK | GPIO18 | SPI clock from ESP32. |
| SDO / DO | GPIO19 | Sensor data out → ESP32 MISO. |
| SDI / DI | GPIO23 | ESP32 MOSI → sensor data in. |
| CS | GPIO27 | Dedicated active-low chip select. |
| 3Vo | Not connected | Regulated-output pin on the Adafruit breakout. |
| FLT / DRDY | Not connected | Optional hardware status lines; not needed by ESPHome’s basic sensor configuration. |
| T+ / T− terminals | Matching thermocouple leads | Probe signal; observe polarity and correct probe type. |
Disconnect power while wiring. The breakout and ESP32 need a shared electronic ground for SPI, but this does not mean the thermocouple probe should be bonded to a dangerous conductor or that the instrument is galvanically isolated. A grounded-junction probe can introduce an unwanted electrical path from the measured equipment into the converter. Where a probe may contact live mains wiring, high-voltage heaters or equipment with fault currents, use an appropriately isolated, rated measurement system rather than connecting an ordinary USB-powered ESP32 directly.
Connect the thermocouple correctly
Connect the two probe conductors to T+ and T−, following the probe manufacturer’s polarity identification. Reversing them often creates a reading that moves in the wrong direction as the tip heats. The lead colours are not globally consistent: IEC and ANSI conventions differ, and connector colours or jacket markings are more useful when checked against the specific probe’s datasheet. Avoid deciding polarity from a random image of a different probe.
For extension wiring, use thermocouple-compatible extension or compensating cable and matching connectors suited to the probe type and operating conditions. Ordinary copper splices between dissimilar metals can introduce new junctions and measurement error if the junction temperatures differ. If possible, keep the breakout’s terminal block at a reasonably uniform, stable ambient temperature; one side heated by a power regulator or a nearby hot pipe can compromise cold-junction compensation.
An insulated-junction probe may reduce electrical coupling to the object being measured, whereas a grounded-junction probe can respond quickly but brings additional considerations about earthing, noise and safety. Check whether the probe sheath and measurement junction are electrically connected before placing it against powered equipment. A thermocouple’s advertised temperature rating also depends on sheath material and insulation—not merely on its letter type.
Complete ESPHome YAML for a K-type thermocouple
Create a new ESPHome device for your actual board. The configuration below uses a standard ESP32 DevKit, an SPI-connected MAX31856 and one K-type probe. Your ESPHome secrets file must define wifi_ssid, wifi_password and api_encryption_key, or you should replace those placeholders with your own securely stored values. The API encryption key is not the Wi-Fi password. The example uses the current ota: platform-list syntax.
esphome:
name: thermocouple-monitor
friendly_name: Thermocouple Monitor
esp32:
board: esp32dev
framework:
type: esp-idf
logger:
api:
encryption:
key: !secret api_encryption_key
ota:
- platform: esphome
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
spi:
clk_pin: GPIO18
miso_pin: GPIO19
mosi_pin: GPIO23
sensor:
- platform: max31856
name: "Probe Temperature"
id: probe_temperature
cs_pin: GPIO27
thermocouple_type: K
mains_filter: 50 Hz
update_interval: 5s
accuracy_decimals: 1
The spi: section defines a shared bus. The max31856 sensor tells ESPHome which GPIO selects this particular converter, which thermocouple linearisation to use and which mains-frequency interference to suppress. ESPHome’s documented default sensor update interval is 60 seconds; five seconds is more useful for many heat-monitoring projects but is not a guaranteed reaction time for safety protection. Select 60 Hz instead of 50 Hz if that better matches your local interference environment.
The displayed decimal setting changes presentation, not physical accuracy. In Home Assistant, a name such as “Probe Temperature” describes the actual junction temperature, while the cold-junction measurement remains internal to ESPHome’s standard MAX31856 sensor. Do not assume this platform exposes independent fault flags or a separate cold-junction entity; the underlying chip has more features than the basic documented ESPHome component.
Flash the board and verify the first reading
Validate the YAML in the ESPHome dashboard, connect the ESP32 by USB for its first installation and install the compiled firmware. When the node connects to Wi-Fi, add it through Home Assistant’s ESPHome integration. Open ESPHome logs and check that the MAX31856 is configured with the expected chip-select pin, thermocouple type and 50/60 Hz filter. If the node appears online but its temperature entity is unavailable, troubleshoot the sensor side rather than changing unrelated Home Assistant settings.
Start with the probe tip at room temperature, allowing the electronics to stabilise before drawing conclusions. Warm just the tip with your hand or a safe, mild heat source: the reported temperature should rise. Then allow it to cool. A touch test only confirms direction and broad plausibility; it cannot verify probe calibration over a wide temperature range. Do not immediately test by placing a new, unverified assembly in a furnace or touching the exposed junction to a live heater element.
Select the correct thermocouple type
The MAX31856 understands eight linearisation families: B, E, J, K, N, R, S and T. The type is a property of the physical probe’s alloy pair, not a mode that can convert any probe into another. Setting thermocouple_type: K for a type J probe may produce a plausible-looking room-temperature reading but increasing error as the measurement temperature changes.
| Type | Typical reason to consider it | Before using it |
|---|---|---|
| K | Common general-purpose temperature probes and hobby oven/BBQ projects. | Check actual sheath, insulation and probe temperature rating. |
| J | Existing industrial or legacy equipment that already uses J probes. | Verify the connector and extension cable are J-compatible. |
| T | Applications involving lower temperature or suitable controlled environments. | Confirm the chosen probe’s rated range and construction. |
| N | A higher-temperature application using an explicitly specified N probe. | Do not substitute for K without matching the probe and configured type. |
| E | Existing equipment or probes explicitly marked E. | Check the probe datasheet rather than relying on wire colour. |
| R / S / B | Specialist noble-metal, high-temperature probe assemblies. | Probe, insulation and installation cost/requirements may dominate; follow supplier specifications. |
To change type in ESPHome, set thermocouple_type: J (or the actual supported letter) and install the updated firmware. If your probe has no reliable marking or documentation, do not try to identify its type solely by comparing a single ambient-temperature reading. The ESPHome MAX31856 reference lists the supported configuration values and notes that the default is K.
Multiple thermocouples on the same ESP32
Every MAX31856 breakout can share the same CLK, SDI and SDO connections, provided each device has its own CS line. This is standard SPI behaviour and lets you monitor, for example, both oven air and an external metal surface with separate thermocouples. Thermocouple leads connect to their own converter terminals; do not join multiple probes onto one input or put their sensor wires onto the digital SPI bus.
With the first breakout on GPIO27, connect a second breakout’s CS to GPIO26 and add another sensor beneath the first in the existing sensor: list:
- platform: max31856
name: "Surface Temperature"
cs_pin: GPIO26
thermocouple_type: K
mains_filter: 50 Hz
update_interval: 5s
accuracy_decimals: 1
The snippet above is an additional sensor entry, not a second top-level sensor: block. Both converters use the previously defined SPI pins and share ground and a suitable power rail. For a compact enclosure, route their thermocouple cables away from the ESP32 antenna, switching power supply and relay wiring. If the SPI bus is long or heavily loaded, shorten the digital connections before attempting to “fix” noisy temperatures with smoothing filters.
When to use multiple SPI buses
Most two- or three-probe builds need only one SPI bus; use a separate bus if there is a genuine pin conflict or a different peripheral requires an incompatible setup. ESPHome supports named SPI buses, and the MAX31856 component can select one using spi_id. Avoid copying ESP32 DevKit pin numbers to an ESP32-C3 or ESP32-S3 without checking their available pins and boot-related constraints. The ESPHome SPI documentation explains named buses and hardware/software implementations.
Home Assistant dashboard and alerts
Once the ESPHome device is added to Home Assistant, the temperature entity can be placed on a dashboard history graph with an appropriate time range. Keep the chart scale realistic; a thermocouple used in a 250°C oven does not need a 0–2000°C graph simply because some probe types can theoretically reach much higher temperatures. Name every entity after the measured location so you do not confuse hot-air temperature with a surface or exhaust temperature.
For a notification-only example, the automation below alerts when the probe reports above 180°C for at least 30 seconds. Replace the entity and notify service with those in your own Home Assistant installation; this threshold is illustrative, not a safe operating limit for any particular appliance.
alias: Thermocouple temperature alert
triggers:
- trigger: numeric_state
entity_id: sensor.thermocouple_monitor_probe_temperature
above: 180
for: "00:00:30"
actions:
- action: notify.mobile_app_your_phone
data:
title: "Temperature alert"
message: "Probe temperature has exceeded 180 °C."
mode: single
A numeric-state trigger fires when a valid reading crosses its threshold; it does not keep repeating just because the reading remains above it. Its for: timer is not a persistent safety timer across Home Assistant restarts or automation reloads. If the sensor goes unavailable, the absence of an alert is not evidence that the equipment has cooled. For unattended heaters, boilers or industrial machinery, retain independent thermostats, over-temperature cut-outs and any required certified protection separate from ESPHome and Wi-Fi.
Why a reading can be wrong despite an apparently good SPI connection
Wrong thermocouple type: the SPI transaction can be completely healthy while the conversion uses the wrong linearisation table. Compare the probe’s stamped or documented type with thermocouple_type and check the matching connector or extension cable. A plausible room-temperature result cannot rule out this problem.
Cold-junction errors: the converter is compensating for the temperature where the probe connects to the board. Place the terminal block and chip away from heat sinks, power resistors, direct sunlight and the heater being measured. Give the board time to reach a stable local temperature. A hot connector at one temperature and a chip at another will introduce errors that digital rounding cannot fix.
Contact and response time: a thick stainless probe in still air responds more slowly than a small exposed junction. A loose surface probe may read surrounding air instead of the workpiece. A slow reading is not necessarily an ESPHome update issue: it may reflect probe mass, thermal contact and airflow. Use suitable mechanical mounting and allow the measurement to settle.
Electrical interference: millivolt-level thermocouple signals are vulnerable to motor drives, igniters, relays, long unshielded cables and unwanted grounding paths. Separate low-level probe wiring from mains and inductive loads, use appropriate cable and choose the relevant mains_filter. The chip includes filtering and fault detection, but software smoothing should not be used to disguise large discontinuities or invalid readings.
Troubleshooting: no temperature, spikes, impossible values
| Symptom | Likely checks and useful next action |
|---|---|
| ESPHome fails to compile | Check indentation, supported thermocouple_type, 50 Hz/60 Hz formatting and correct ESP32 board selection. |
| Temperature entity absent or unavailable | Check the node’s logs, MAX31856 power, 3.3 V logic compatibility, CLK/SDI/SDO direction and individual CS wiring. |
| Temperature falls when tip is warmed | Confirm T+/T− polarity and the probe’s actual positive and negative conductors. |
| Reasonable at room temperature, wrong when hot | Confirm thermocouple type, connector metals, cable rating and cold-junction placement. |
| Large spikes when heater or motor switches | Separate probe and mains wiring, check grounding/isolation, cabling, supply stability and mains_filter. |
| Fails after adding a second converter | Check both boards have distinct CS pins, shared digital ground, compatible SPI logic and sufficient power. |
| Temperature is permanently high or low | Inspect terminal tightness, probe damage, shorts to sheath, open probe and whether the breakout’s input terminals are actually connected. |
If the temperature is unavailable, first inspect ESPHome logs rather than adding arbitrary filters:. A filter cannot repair bad wiring or turn an invalid sensor value into a trustworthy measurement. You can temporarily remove the thermocouple and check for a reported fault, then reconnect it securely, but fault behaviour and log wording depend on the ESPHome version and breakout. The MAX31856 IC has open-probe and threshold detection; ESPHome’s basic documented sensor configuration does not promise that every fault-status register will become a separate Home Assistant entity.
For stubborn hardware problems, verify the breakout model and pin labels against its own documentation: inexpensive modules sometimes replace SDI/SDO with DIN/DOUT, or use different input protection and supply arrangements. A board advertised as MAX31855 is not a MAX31856 merely because the screw terminals and SPI pins look similar. Check the chip marking, not just the shop listing.
Practical installation and maintenance
Keep the ESP32, converter and their low-voltage wiring in a ventilated, protected enclosure outside the hot or wet process. Secure thermocouple connections mechanically, avoid routing probe cables through moving machinery, and provide strain relief where a cable passes through metalwork. If you monitor food preparation, use a food-contact-rated probe and cleanable sheath; a generic metal-tip sensor is not automatically suitable for direct food contact.
Create a baseline test: record the room-temperature result, compare a stable reference point if appropriate, then repeat at a controlled temperature relevant to the intended use. Note the probe location, type and cable changes. If readings drift after replacing a cable or connector, investigate thermocouple wiring before applying a software offset. A fixed offset may make one test point look right while concealing a much larger high-temperature error.
The value of this setup is remote logging, long-term trends and useful notifications. If a network outage, ESP32 reboot, broken probe or Home Assistant downtime would create a dangerous situation, the application needs independently functioning safety hardware. The MAX31856 can be part of an informative monitoring system without becoming the sole temperature-protection device.
Related ESP32 guides
- MAX31865 with ESP32 and ESPHome: PT100/PT1000 temperature monitoring — for resistance probes rather than thermocouples.
- ESPHome OTA update recovery — network troubleshooting and USB reflashing when an installed ESPHome node becomes unreachable.
Official documentation and further reading
- ESPHome MAX31856 sensor component — supported YAML options, wiring and platform requirements.
- ESPHome SPI bus — pin definitions, multiple devices and bus selection.
- Analog Devices MAX31856 specifications and datasheet — supported types, accuracy, fault detection and electrical limits.
- Adafruit MAX31856 breakout pinouts — VIN/3Vo distinction, level shifting and SPI connections for its specific board.
- Home Assistant numeric-state trigger — threshold-crossing and duration behaviour.