Anyone that can help with MAX31865 sensor?

hey! I’ve been working my way through Hass and ESPhome for a while now, what and cool systems!

The last few days I started working with ESPhome for the max31865 RTD translator, to make sure I can run this chip I have ESPhome Dev. I have ordered the PT100 and PT1000 version and have one of the type sensors. I have ESPhome running on and ESP32 DEVKITV1 and running hassIO on and VM.

The MAX31865 sensor works with PT temp sensors and thay I want to use this type of sensor for floor cooling and heating. I am currently running into the problem of not getting a clear reading from my MAX. these are the logs:

[08:43:24][W][max31865:017]: Overvoltage/undervoltage fault between measurements

[08:43:24][W][max31865:020]: RTDIN- < 0.85 x V_BIAS (FORCE- open) between measurements

[08:43:24][W][max31865:023]: REFIN- < 0.85 x V_BIAS (FORCE- open) between measurements

[08:43:24][W][max31865:026]: REFIN- > 0.85 x V_BIAS between measurements

[08:43:24][W][max31865:030]: RTD Low Threshold between measurements

[08:43:24][W][max31865:033]: RTD High Threshold between measurements

[08:43:24][D][sensor:092]: 'Living Room Temperature': Sending state -242.02000 °C with 2 decimals of accuracy

[08:43:39][E][max31865:101]: Overvoltage/undervoltage fault

[08:43:39][E][max31865:104]: RTDIN- < 0.85 x V_BIAS (FORCE- open)

[08:43:39][E][max31865:107]: REFIN- < 0.85 x V_BIAS (FORCE- open)

[08:43:39][E][max31865:110]: REFIN- > 0.85 x V_BIAS

[08:43:39][D][sensor:092]: 'Living Room Temperature': Sending state nan °C with 2 decimals of accuracy

[08:43:54][D][sensor:092]: 'Living Room Temperature': Sending state -242.02000 °C with 2 decimals of accuracy

[08:44:09][D][sensor:092]: 'Living Room Temperature': Sending state -242.02000 °C with 2 decimals of accuracy

[08:44:24][W][max31865:017]: Overvoltage/undervoltage fault between measurements

[08:44:24][W][max31865:020]: RTDIN- < 0.85 x V_BIAS (FORCE- open) between measurements

[08:44:24][W][max31865:023]: REFIN- < 0.85 x V_BIAS (FORCE- open) between measurements

[08:44:24][W][max31865:026]: REFIN- > 0.85 x V_BIAS between measurements

[08:44:24][W][max31865:030]: RTD Low Threshold between measurements

[08:44:24][W][max31865:033]: RTD High Threshold between measurements

[08:44:24][D][sensor:092]: 'Living Room Temperature': Sending state -242.02000 °C with 2 decimals of accuracy

[08:44:39][W][max31865:017]: Overvoltage/undervoltage fault between measurements

[08:44:40][W][max31865:020]: RTDIN- < 0.85 x V_BIAS (FORCE- open) between measurements

[08:44:40][W][max31865:023]: REFIN- < 0.85 x V_BIAS (FORCE- open) between measurements

[08:44:40][W][max31865:026]: REFIN- > 0.85 x V_BIAS between measurements

[08:44:40][W][max31865:030]: RTD Low Threshold between measurements

[08:44:40][W][max31865:033]: RTD High Threshold between measurements

[08:44:40][D][sensor:092]: 'Living Room Temperature': Sending state -242.02000 °C with 2 decimals of accuracy

[08:44:54][E][max31865:101]: Overvoltage/undervoltage fault

[08:44:54][E][max31865:104]: RTDIN- < 0.85 x V_BIAS (FORCE- open)

[08:44:54][E][max31865:107]: REFIN- < 0.85 x V_BIAS (FORCE- open)

[08:44:54][E][max31865:110]: REFIN- > 0.85 x V_BIAS

[08:44:54][D][sensor:092]: 'Living Room Temperature': Sending state nan °C with 2 decimals of accuracy

[08:45:09][D][sensor:092]: 'Living Room Temperature': Sending state -242.02000 °C with 2 decimals of accuracy

I tested with 3.3v and 5.5v in case it was in one power supply, used the same config for both board. nothing seems to happen at all because when I take the voltage off I still get the same input in the log.

Hopefully someone here can help. This is my Config:

configuration entry
spi:
  miso_pin: GPIO25
  clk_pin: GPIO33

sensor:
  - platform: max31865
    name: "Living Room Temperature"
    rtd_nominal_resistance: 100
    reference_resistance: 100
    cs_pin: GPIO32
    update_interval: 15s

below I have two pictures of my setup, in this case the PT100 version.

hopefully I have provided enough information for someone to help! if there are any questions I would like to hear this :slight_smile:

If you have the PT1000 and the accompanying variant of the MAX31865 your resistance values may not be right…

Here’s mine for reference:

esphome:
  name: water_tank
  platform: ESP32
  board: heltec_wifi_kit_32

wifi:
  ssid: !secret hab_ssid
  password: !secret hab_key

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "WaterHeater"
    password: !secret esphome_ap_pwd

captive_portal:

# Enable logging
logger:
  logs:
    sensor: DEBUG

# Enable Home Assistant API
api:
  password: !secret api_pwd
  
ota:
  password: !secret ota_pwd
  
# Enable logging
logger:
  level: debug
  logs:
    i2c: debug
    ssd1306_i2c: debug
    wifi: debug
    app: debug
    component: debug

i2c:
  sda: 4
  scl: 15

spi:
  clk_pin: 18
  mosi_pin: 23
  miso_pin: 19

sensor:
  - platform: max31865
    name: "Tank Temperature"
    cs_pin: 5
    update_interval: 10s
    id: tank_temp
    reference_resistance: "4300 Ω"
    rtd_nominal_resistance: "1000 Ω"

font:
  - file: "clacon.ttf"
    id: my_font
    size: 12

text_sensor:
  - platform: wifi_info
    ip_address:
      name: ESP IP Address
      id: wlan_ip_address
    ssid:
      name: ESP Connected SSID
      id: wlan_ssid
      
display:
  - platform: ssd1306_i2c
    model: "SSD1306 128x64"
    reset_pin: 16
    address: 0x3C
    lambda: |-
      std::string ip_str = id(wlan_ip_address).state;
      std::string ssid_str = id(wlan_ssid).state;
      it.printf(0, 10, id(my_font), "SSID: %s", ssid_str.c_str());
      it.printf(0, 24, id(my_font), "IP: %s", ip_str.c_str());
      it.printf(0, 38, id(my_font), "Temp: %f", id(tank_temp).state);

2 Likes

Hey man,
Supper thanks for your quick response! I didn’t have my config right. Adjusted the config and now my measurement is correct! I had a bit of trouble getting clear on which pins to put what, but that works now:

clk pin = CLK
mosi pin = SDI
Miso pin = SDO
cs_pin = CS

I do not quite understand how I find out the values ​​of my PT1000 but the values ​​from your config seem to work, this week I am going to do calibration test with analog prod termostat and the PT1000 in a container of ice water

thees sites helpt me out:
https://www.arduino.cc/en/reference/SPI

Cheers Luuk

Hi, I am trying to setup a max31865, in ESPhome. It gives me a “Platform not found, sensor.max31865”
Is yours still working?

hey, yes it still works for me, I have my esphome on the dev environment. and you have to look at the filters that I had to add from @Devanl

Here is the code snippet that I am using with the master branch

spi:
  clk_pin: 18
  mosi_pin: 23
  miso_pin: 19

sensor:
  - platform: max31865
    name: "Tank Temperature"
    cs_pin: 5
    update_interval: 10s
    id: tank_temp
    reference_resistance: "4300 Ω"
    rtd_nominal_resistance: "1000 Ω"

I am having similar troubles hooking up a Pt100 to an esp32cam via a max31865.
The logging is: Sending state -242.02000 °C with 2 decimals of accuracy
Here is my wiring and set up.


spi:
  clk_pin: GPIO13
  miso_pin: GPIO15
  mosi_pin: GPIO14


sensor:
  - platform: max31865
    name: "Temperature"
    id: still_temp
    cs_pin: GPIO02
    update_interval: 15s
    reference_resistance: 430 Ω
    rtd_nominal_resistance: 100 Ω
    rtd_wires: 2
    mains_filter: 50 Hz

Any help is appreciated thanks.

Ok figured it out, looks like some conflicts on some of the pins I was using. Here is a working circuit diagram and link to the project:
stillcam-circuit-diagram-1.0
https://gitlab.com/PseudoNet/still-monitoring

Hi!

I’m having problems putting a PT1000 in working conditions. I’ve tried several combinations of PIN and everytime i get the following error:

[W][max31865:033]: RTD High Threshold between measurements
[E][max31865:099]: SPI bus read all 0 or all 1 (0xFFFF), check MAX31865 wiring & power.
[D][sensor:127]: 'name': Sending state nan °C with 2 decimals of accuracy

If I plug-in a 1000 Ohm resistor instead of the probe:

[W][max31865:020]: RTDIN- < 0.85 x V_BIAS (FORCE- open) between measurements
[W][max31865:026]: REFIN- > 0.85 x V_BIAS between measurements
[W][max31865:033]: RTD High Threshold between measurements
[E][max31865:099]: SPI bus read all 0 or all 1 (0xFFFF), check MAX31865 wiring & power.
[D][sensor:127]: 'name': Sending state nan °C with 2 decimals of accuracy

And, if I short terminals:

[D][sensor:127]: 'name': Sending state -240.79410 °C with 2 decimals of accuracy
[D][sensor:127]: 'name': Sending state -240.73567 °C with 2 decimals of accuracy
[D][sensor:127]: 'name': Sending state -240.76488 °C with 2 decimals of accuracy
[D][sensor:127]: 'name': Sending state -240.79410 °C with 2 decimals of accuracy

And this is my code:

spi:
  clk_pin: 18
  mosi_pin: 23
  miso_pin: 19


sensor:
  - platform: max31865
    name: "Temperatura Caldaia"
    cs_pin: 5
    update_interval: 10s
    id: temp_caldaia
    reference_resistance: "4300 Ω"
    rtd_nominal_resistance: "1000 Ω"
    rtd_wires: 2
    mains_filter: 50 Hz

Can’t figure out where I’m wrong…

Tests done:

  • 2 Different MAX6185 modules
  • ESP8266 D1 mini and ESP32 development board
  • Different power sources
  • Different pin used (the ones in the shown config are the official datasheet VSPI bus)
  • 1 PT1000 probe and 1 kΩ resistor
  • 430Ω and 4300Ω setting
  • 100Ω and 1000Ω setting

Everytime the same behaviour