Question on the MAX31865 Platinum RTD Temperature Sensor

I’m installing a hydronic radiant heat system in my home. I’d like to use ESPHome to monitor the water temperature in 8 different spots (4 zones, supply and return temp for each zone). I plan to use a PT100 temp sensor and a Max31865 board using the ESP Max31865 integration on a ESP32 board.

The integration requires an SPI bus and this added to the configuration

spi:
  miso_pin: GPIO4
  mosi_pin: GPIO5
  clk_pin: GPIO0

I need a separate Max31865 for each of the 8 temp probes, but I’d like to use as few ESP32 boards as possible. Can I hook the miso_pin, mosi_pin, and clk_pin from all 8 max31865 boards to the same GPIO pins on the ESP32? So, the ESP32 GPIO4 pin would have the miso_pin from all 8 max31865s connected to it. Is this possible?

Hi Brad, wow your going for it. I have been in A/C for 35 years and that big to have supply and return temps for 4 zones in your home… but that’s why we love HA and ESPHome you can get what you like :grinning:

On side note have a look at this its new to Shelly last week.

Shelly Therostatic Radiator Valve

I know I’m not answering your question but it may help you.

What I would do if you would like to read water temp is… put in a pocket into your system then use thremo paste and insert a temp sensor into the pocket. This way it easy to remove later without draining your system if something goes wrong. You can purchase the pockets and screw them in, looks like PT100 without the sensor or if your using copper pipe you can make your own. Another option is to just cable tie the sensor to the pipe under your insulation. Just depends on what you like.

Sensor I used is a Dallas Temp Sensor

In the past I used these ESP32 ATOM Lite they look good and don’t have any sticky out bits. Then use pin 32. I have only connected one sensor to the ATOM lite in the past but you may be able to connect 2 to it (Supply & Return), not sure.

Code below for you if you chose to go down this route.

Also get yourself Grove Cable so you can plug in your sensor to Atom Lite, just cut one end off and solder the wires to your sensor… make sure you put in the 4.7KΩ resistor between Red (+) and white (data) cables and use some heat shrink over your connections.

This looks clean and neat and easy to service if require later down the track.

# Genuine DS18B20 Temperature Sensor - https://esphome.io/components/sensor/dallas.html?highlight=dallas
dallas:
  - pin: 32

sensor:
  - platform: dallas
    address: your address goes here
    name: "Enter your name here, like - ZONE 1 - Supply Temp"

Thanks, @Blacky !

The Dallas sensor tied to the pipe is intriguing. I’m trying to get the temp sensor as close to the manifold as possible to be as accurate as possible. I’ll have 5-ish feet of pex from my copper secondary loop to the Manifold, and I assume I’d want to mount the sensor to copper. Maybe not a big deal. I will also have an isolation valve at the manifold and close to where the pex starts. So, if I had to replace an NPT style sensor, I could isolate the area pretty well.

I am going to look into those Dallas sensors to bring my slab temp into HA.

Hi Brad, Yea its hard to see what suits you best without seeing your system and really knowing what you would like and or trying to achieve. Tied to pipe is okay a bit messy but if your like me and like everything neat, accurate and perfect a pocket is the way I would go… just cost more but its only money.

Can’t see your system but air in the system can be a issue that’s why we use pockets. Maybe ask your installer to see if they have something that can fit to your manifold. But if you go with the one you selected then yea it work too.

You can’t mount it to pex pipe as your readings will be inaccurate. Copper is a good heat transfer but you need to use the thermo paste (can get messy that stuff, best used in a pocket)

Just a thought, do you need 4 supply temps or can you use just one and have 4 return temps as your supply temps should be the same.

I like the pocket idea, my manifolds (Watts) use pockets for the temp gauges on the inlet and outlet. But I am having a hard time finding where to buy a pocket fitting. It seems like they are used a lot in the UK, but I can’t find a retailer in the US that has them.

I hadn’t thought about that, but I like it! I suppose I could measure the temp right before the water gets to my zone circulator pumps and use that for the supply temp. The water would still have about 10 feet to go before getting to the manifolds, but I doubt it would lose much, if any, temperature in that short period.

Thanks for all the help and ideas!

No problem Brad, I done a lot of this stuff but all big commercial systems.

The pocket is the best way and your right UK as the best hydronic gear. I am thinking of importing some parts. Hydronic is really nice for heating and in my opinion if you live in a cold climate its the way to go, hence why UK has good stuff. Making one is easy though if you use copper. You just expand your pipe one or 2 sizes up (so your sensor fits inside pipe), then get another pipe that fits your sensor, cap it one end, drill a hole in your upsize pipe, slip the sensor pipe in on 45 deg angle, weld it and then have some fitting the allow you to remove the customs pocket fitting (compression fittings or washer type) and your done.

if you see something you like in UK just order it and have it delivered, don’t just limit yourself to just US.

You will not lose much temperature over 10 feet so one supply temperature sensor will be fine. You will also find that you will have slightly different reading with each sensor. A lot of them are + or -, 5 -10%.

Anyway all the best, if you have any questions just ask. It may take me longer to get back to you as I probably on check in once a month now.

Thanks for the help!

I ended up going with a variable speed Taco pump that bases flow on the Delta T. With that pump, I’m less concerned about monitoring the return and supply temp in HA. The pump uses what looks like a dallas temp sensor zip-tied to the return and supply pipe, so I may just strap two more dallas temp sensors on the same spot so I can see it in HA, just for the fun of it.

Nice, and they use zip-tied (cable ties) :wink: maybe just link into the same sensors.

Anyway looks like your all good :+1:

I found some time to tinker and test my initial question. Just posting in case anyone else wonders, yes you can hook the miso_pin, mosi_pin, and clk_pin from multiple Max31865 boards to the same GPIO pins on the ESP32. Here is my config.

# Example configuration entry
spi:
  miso_pin: GPIO21
  mosi_pin: GPIO22
  clk_pin: GPIO19

sensor:
  - platform: max31865
    name: "Max31865 Test1"
    cs_pin: GPIO23
    reference_resistance: 430 Ω
    rtd_nominal_resistance: 100 Ω
    update_interval: 5s
    unit_of_measurement: "°F"
    filters:
    - lambda: return x * (9.0/5.0) + 32.0;
  - platform: max31865
    name: "Max31865 Test2"
    cs_pin: GPIO25
    reference_resistance: 430 Ω
    rtd_nominal_resistance: 100 Ω
    update_interval: 5s
    unit_of_measurement: "°F"
    filters:
    - lambda: return x * (9.0/5.0) + 32.0;

A picture of my test set up.

And the log output (I still need to calibrate)

[10:41:32][D][sensor:113]: 'Max31865 Test2': Sending state 76.02386 °F with 2 decimals of accuracy
[10:41:36][D][sensor:113]: 'Max31865 Test1': Sending state 74.38014 °F with 2 decimals of accuracy
[10:41:37][D][sensor:113]: 'Max31865 Test2': Sending state 76.08446 °F with 2 decimals of accuracy
[10:41:41][D][sensor:113]: 'Max31865 Test1': Sending state 74.38014 °F with 2 decimals of accuracy
[10:41:42][D][sensor:113]: 'Max31865 Test2': Sending state 76.02386 °F with 2 decimals of accuracy
[10:41:46][D][sensor:113]: 'Max31865 Test1': Sending state 74.44110 °F with 2 decimals of accuracy
[10:41:47][D][sensor:113]: 'Max31865 Test2': Sending state 76.02386 °F with 2 decimals of accuracy

I’m likely still going with the Dallas temp sensors cable-tied to the pipe after the advice from @Blacky but I figured I’d still post the solution for anyone else. If I get time I might make a test rig to see what difference, if any, there is between a temp sensor in the pipe vs one strapped to the outside.

1 Like

Just adding an update in case anyone else is doing this in the future. I went with the zip-tied (cable-tied) dallas temp sensors on the pipes and it works out great. The reading in HA is within 1 degree of the reading the pumps are getting. I also put a dallas temp sensor in the pex tube buried in the floor along with my thermostat floor temp probe so I can see the temperature of the floor in HA. I’m using the custom mini-graph card in Lovelace.

I’m using this pressure sensor to monitor the system pressure. I set up automations to alert for high and low pressure and to shutoff the main power switch if the pressure gets to high/low. The system needs to be between 12-20psi so it’s important to monitor that.

I’m still waiting on a mains current sensor board. Once I have that I can monitor when the pumps turn on, how many watts they are using, and therefore how many gpm they are flowing. Using the gpm and temperature delta I can calculate my BTU/hr usage.

Thanks again for the help, @Blacky!

Hi Brad, thanks for the update and the kind words :smiley: its looking really good and I am glad its all working out for you.

If the readings at the pump are a constant difference throughout your readings and you would like to make it match (or calibrate it) to the temp at the pump you may be able yo use the filter offset

It will be nice to see how you go with your mains current sensor board.

If you start to go down the rabbit hole I use Xiaomi LYWSD03MMC room temp sensors. They are a Bluetooth sensor and I just used ESP32 to be the Bluetooth hub so to speak. Battery life is great to and very affordable, you can find them in Aliexpress . I just flashed it with PVVX MiThermometer custom firmware. Then you could have a temp sensor in each room/zone into HA. From there you could just see the room temps for each zone or start implementing automations turning pumps on off, opening valves, control to real weather conditions, push notifications of room conditions and the list goes on. Its all local no cloud :wink:

Thanks again :+1:

Thanks for the tip! I was actually looking for a good way to read the garage temp in HA since I’m not using a compatible thermostat. I’ll try some of those sensors.