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.
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.
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?
#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);
}
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.
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!