Reading two PT100 sensors with Arduino Uno

Hi there,

I want to measure temperature data from two PT100 (2-wire) temperature sensors. I have looked around at different threads but still don't know how I should tackle this.

Until now, I used only one PT100 in conjunction with a MAX31865 amplifier and a Arduino Uno board. This worked well.

Now I want to use two PT100 sensors, and I am a bit lost on how to do so. At first, I thought I needed a second Arduino Uno board and a second MAX31865 amplifier and read the data from two different USB ports from my PC. But this isn't possible?

What is the easiest way to achieve this? Can I read the data from two PT100 sensors with only one Arduino Uno board? Because with one PT100 I am already using the Arduino Uno digital 10,11,12,13 pins (with CS, SDI, SDO, CLK)?

I am a beginner so am grateful for any help you could provide me.

Kindly,

Fernand

The second MAX31865 can share same SDI, SDO, CLK. It will need a different pin for CS.

Hi PaulRB, thanks so much for your message!

So if I understand correctly, I should buy another MAX31865 amplifier? Then I will have two CS, SDI, SDO, CLK pins on both MAX31865.

But if I have one Arduino Uno, how do I connect the two SDI, SDO, CLK, CS to the Arduino?

  • The first PT100 I connect to the MAX31865 and then to the 10,11,12,13 digital pins.
  • Where do I connect the MAX31865 SDI, SDO, CLK, CS pins of the second MAX31865 amplifier to the Arduino Uno?

Can I use the other digital pins, for example 4,5,6,7 digital pins?

Hi,
Can you please post your code that works for one PT100?

Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.

What library are you using?

Thanks.. Tom... :smiley: :+1: :coffee: :australia:

Here is how you connect two

1 Like

Awesome Jim, thank you so much. This was exactly what I was looking for!!
So now my last question, how do I modify the code of the unique PT100 reading to dual PT100 readings?

The code I used for one PT100 with MAX31865 is the following:

#include <Adafruit_MAX31865.h>

// Use software SPI: CS, DI, DO, CLK
Adafruit_MAX31865 thermo = Adafruit_MAX31865(10, 11, 12, 13);
// use hardware SPI, just pass in the CS pin
//Adafruit_MAX31865 thermo = Adafruit_MAX31865(10);

// The value of the Rref resistor. Use 430.0 for PT100 and 4300.0 for PT1000
#define RREF      430.0
// The 'nominal' 0-degrees-C resistance of the sensor
// 100.0 for PT100, 1000.0 for PT1000
#define RNOMINAL  100.0

void setup() {
  Serial.begin(9600);
  Serial.println("Adafruit MAX31865 PT100 Sensor Test!");

  thermo.begin(MAX31865_2WIRE);  // set to 3WIRE or 4WIRE as necessary, corresponding to the number of wires of the PT100 sensor
}


void loop() {
  uint16_t rtd = thermo.readRTD();

  Serial.print("RTD value: "); Serial.println(rtd);
  float ratio = rtd;
  ratio /= 32768;
  Serial.print("Ratio = "); Serial.println(ratio,8);
  Serial.print("Resistance = "); Serial.println(RREF*ratio,8);
  Serial.print("Temperature = "); Serial.println(thermo.temperature(RNOMINAL, RREF));

  // Check and print any faults
  uint8_t fault = thermo.readFault();
  if (fault) {
    Serial.print("Fault 0x"); Serial.println(fault, HEX);
    if (fault & MAX31865_FAULT_HIGHTHRESH) {
      Serial.println("RTD High Threshold"); 
    }
    if (fault & MAX31865_FAULT_LOWTHRESH) {
      Serial.println("RTD Low Threshold"); 
    }
    if (fault & MAX31865_FAULT_REFINLOW) {
      Serial.println("REFIN- > 0.85 x Bias"); 
    }
    if (fault & MAX31865_FAULT_REFINHIGH) {
      Serial.println("REFIN- < 0.85 x Bias - FORCE- open"); 
    }
    if (fault & MAX31865_FAULT_RTDINLOW) {
      Serial.println("RTDIN- < 0.85 x Bias - FORCE- open"); 
    }
    if (fault & MAX31865_FAULT_OVUV) {
      Serial.println("Under/Over voltage"); 
    }
    thermo.clearFault();
  }
  Serial.println();
  delay(1000);
}

Could you tell me how to modify it to incorporate a reading of another PT100? Can I find the code somewhere?

Kindly, Fernand

#include <Adafruit_MAX31865.h>

Adafruit_MAX31865 thermo1(10);
Adafruit_MAX31865 thermo2(9);

// The value of the Rref resistor. Use 430.0 for PT100 and 4300.0 for PT1000
#define RREF      430.0
// The 'nominal' 0-degrees-C resistance of the sensor
// 100.0 for PT100, 1000.0 for PT1000
#define RNOMINAL  100.0

void setup() {
  Serial.begin(115200);
  Serial.println("Adafruit MAX31865 PT100 Sensor Test!");

  thermo1.begin(MAX31865_2WIRE);  // set to 3WIRE or 4WIRE as necessary, corresponding to the number of wires of the PT100 sensor
  thermo2.begin(MAX31865_2WIRE);  // set to 3WIRE or 4WIRE as necessary, corresponding to the number of wires of the PT100 sensor
}

void loop() {
  uint16_t rtd = thermo1.readRTD();

  Serial.print("RTD1 value: "); Serial.println(rtd);
  float ratio = rtd;
  ratio /= 32768;
  Serial.print("Ratio = "); Serial.println(ratio, 8);
  Serial.print("Resistance = "); Serial.println(RREF * ratio, 8);
  Serial.print("Temperature = "); Serial.println(thermo.temperature(RNOMINAL, RREF));
  Serial.println();

  rtd = thermo2.readRTD();
  Serial.print("RTD2 value: "); Serial.println(rtd);
  float ratio = rtd;
  ratio /= 32768;
  Serial.print("Ratio = "); Serial.println(ratio, 8);
  Serial.print("Resistance = "); Serial.println(RREF * ratio, 8);
  Serial.print("Temperature = "); Serial.println(thermo.temperature(RNOMINAL, RREF));
  Serial.println();
  delay(1000);
}

I only made 3 changes as marked.
I think you can figure out what changes you need to do in the loop()
There are now two thermos, thermo1 and thermo2


#include <Adafruit_MAX31865.h>

// Use software SPI: CS, DI, DO, CLK
//Adafruit_MAX31865 thermo = Adafruit_MAX31865(10, 11, 12, 13);
// use hardware SPI, just pass in the CS pin
Adafruit_MAX31865 thermo1 = Adafruit_MAX31865(10); // ********** JIM
Adafruit_MAX31865 thermo2 = Adafruit_MAX31865(9); // ********** JIM

// The value of the Rref resistor. Use 430.0 for PT100 and 4300.0 for PT1000
#define RREF      430.0
// The 'nominal' 0-degrees-C resistance of the sensor
// 100.0 for PT100, 1000.0 for PT1000
#define RNOMINAL  100.0

void setup() {
  Serial.begin(9600);
  Serial.println("Adafruit MAX31865 PT100 Sensor Test!");

  // next to lines  ************ JIM
  thermo1.begin(MAX31865_2WIRE);  // set to 3WIRE or 4WIRE as necessary, corresponding to the number of wires of the PT100 sensor
  thermo2.begin(MAX31865_2WIRE);  // set to 3WIRE or 4WIRE as necessary, corresponding to the number of wires of the PT100 sensor
}


void loop() {
  uint16_t rtd = thermo.readRTD();

  Serial.print("RTD value: "); Serial.println(rtd);
  float ratio = rtd;
  ratio /= 32768;
  Serial.print("Ratio = "); Serial.println(ratio, 8);
  Serial.print("Resistance = "); Serial.println(RREF * ratio, 8);
  Serial.print("Temperature = "); Serial.println(thermo.temperature(RNOMINAL, RREF));

  // Check and print any faults
  uint8_t fault = thermo.readFault();
  if (fault) {
    Serial.print("Fault 0x"); Serial.println(fault, HEX);
    if (fault & MAX31865_FAULT_HIGHTHRESH) {
      Serial.println("RTD High Threshold");
    }
    if (fault & MAX31865_FAULT_LOWTHRESH) {
      Serial.println("RTD Low Threshold");
    }
    if (fault & MAX31865_FAULT_REFINLOW) {
      Serial.println("REFIN- > 0.85 x Bias");
    }
    if (fault & MAX31865_FAULT_REFINHIGH) {
      Serial.println("REFIN- < 0.85 x Bias - FORCE- open");
    }
    if (fault & MAX31865_FAULT_RTDINLOW) {
      Serial.println("RTDIN- < 0.85 x Bias - FORCE- open");
    }
    if (fault & MAX31865_FAULT_OVUV) {
      Serial.println("Under/Over voltage");
    }
    thermo.clearFault();
  }
  Serial.println();
  delay(1000);
}

On a breadboard

The easiest way to connect 2 RTDs to an UNO is to stay with software SPI. It's a bit slower and uses 4 more pins but the connection is easier without a breadboard. A bit slower doesn't matter if you are reading temps once a second.

Change kolaha's code to

Adafruit_MAX31865 thermo1 = Adafruit_MAX31865(10, 11, 12, 13);
Adafruit_MAX31865 thermo2 = Adafruit_MAX31865(6, 7, 8, 9);

and connect the second RTD to pins 6, 7, 8, 9

Thank you so much everyone for your quick answers and help, that is awesome. I will be trying it out next week, will give you some feedback if everything works correctly!

Kindly, Fernand

Thank you Jim for the wiring visualization, that really helps and is exactly what I was looking for!

No hurry

So everything worked OK?

Hi Jim! Thank you so much for getting back to me, really nice of you.

I tested it a few hours ago and it worked perfectly at the first try - thanks to you!

Have a great week :slight_smile:

Fernand

You too!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.