Multiple PT-100 on a single MCU

Discuss development of drivers for external hardware and components, such as LCD screens, sensors, motor drivers, etc.
Target audience: Users and developers of drivers.
Post Reply
cleber
Posts: 2
Joined: Fri Oct 22, 2021 8:51 am

Multiple PT-100 on a single MCU

Post by cleber » Fri Oct 22, 2021 11:10 am

Hi,

I have been trying to get multiple 3-wire PT-100 sensors connected to max31865 on my ESP32 (dev board, I believe).

I made a few changes to the lopy driver mentioned here. Notably I changed it so I create the SPI outside and give it as an argument to the driver's constructor, since I noticed that if I instantiated multiple driver instances the SPI would conflict with each other so now I have only one SPI instance.

My code works and I'm able to read temperatures, however it is unstable.
I'm using software SPI since HW SPI seems to be limited to 3 CSs and I don't need speed.
I have separate CS pins for each sensor, however I don't seem to be able to get more than 3 to ever work reliably.

In my last test, 2 sensors seem to be reporting the temperature correctly (all are at room temperature, about 26C), one is way off (15.7C) and the last is showing -246.8787C, which seems to be an error reading. I noticed that when I boot the MCU the first reading seems to be always -246.8787 for all sensors, then some of then stabilise on correct readings.

temperature sensor 4 = 25.83775
temperature sensor 18 = 15.70206
temperature sensor 16 = -246.8787
temperature sensor 17 = 26.24394

I tested my hardware as well as I could, replaced the max31865s breakouts (I had lots of those around, Chinese made) and swapped the sensors around. The issue appears to be in software or then it is something on the HW I can't figure out.

All the max31865 are connected in series on breadboards (i.e. the MISO connection goes from the MCU to the first max31865, from there to the second, and so on). The CSs are connected to the PINs in the MCUs the sensors are named after (sensor 4 is on GPIO 4).

I also tried https://github.com/B3AU/micropython/blo ... AX31865.py but I couldn't get that driver to work. All I got back from the sensors was 1C, if I recall correctly...

I'm considering porting the Adafruit driver since they mention on their documentation it should work with multiple sensors but the way the CSs are handled in there confuses me and I'm stalled for now (didn't spend much time on that yet).

I'm on Micropython 1.14.

Have anyone managed to get multiple PT100s to work on the same MCU?

Post Reply