ESPHome's MAX31855 driver now discards corrupted thermocouple reads
An ESPHome pull request checks two reserved bits in the MAX31855 thermocouple chip's output and drops reads where they are set, a sign of SPI noise.
Credits
- Source byline knkaiser Source ↗
Earliest dated source:
The full story
ESPHome reads MAX31855 thermocouple chips over SPI. Two bits in the chip's 32-bit output are reserved and always read 0, so a word with either set must be corrupt, for example from noise on long wires, yet the driver was publishing it as a real temperature.
This pull request checks those bits, logs a warning with the raw word, sets the component's warning status and skips that update, leaving the previous value. An all-zero word is still accepted, because 0 °C on both junctions is a valid reading.
A companion pull request corrected the driver's comment on conversion timing against the datasheet: the chip converts continuously, in 70 ms typical and 100 ms maximum.
How it was done
Tools
Themes
Loading themes…
Sources
From the maker's own write-up or code. We summarise what they report; we haven't tested it ourselves.
- ESPHome Project: [max31855] Discard reads with reserved bits setSource byline: knkaiserPublished
The pull request that discards corrupt reads.
- The project: developers.esphome.io
ESPHome's contributor guide, linked from the pull request.
- ESPHome Project: [max31855] Correct conversion timing commentSource byline: knkaiserPublished
The companion pull request correcting the timing comment.