2 AMPLIFIERS max31865 and 1 Arduino UNO

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
FRENCHY1000
 
Posts: 1
Joined: Sun Nov 11, 2018 9:41 am

2 AMPLIFIERS max31865 and 1 Arduino UNO

Post by FRENCHY1000 »

Hello Everyone,

I succeeded in reading temperature of 1 PT100 sensor with 1 amplifier MAX31865 connecting to 1 arduino UNO.

Now I want to read temperature of two PT100 sensors with 2 amplifiers MAX31865 connecting to 1 arduino UNO.

Is it possible ?

Where is it possible to get the arduino sketch corresponding ?

Best regards
Michael

User avatar
adafruit_support_bill
 
Posts: 88038
Joined: Sat Feb 07, 2009 10:11 am

Re: 2 AMPLIFIERS max31865 and 1 Arduino UNO

Post by adafruit_support_bill »

That device has an SPI interface, so multiple boards can share the DI, DO and CLK pins. You will need a separate CS pin for each board. This is specified in your code when you declare an instance of the board:

Code: Select all

// use hardware SPI, just pass in the CS pin
Adafruit_MAX31865 max_A = Adafruit_MAX31865(9);  // board A using pin 9 for CS
Adafruit_MAX31865 max_B = Adafruit_MAX31865(10); // board B using pin 10 for CS

User avatar
acay46
 
Posts: 3
Joined: Fri Dec 14, 2018 9:21 am

Re: 2 AMPLIFIERS max31865 and 1 Arduino UNO

Post by acay46 »

Hi,

I want to use 3 MAX31865, and I have identified 3 MAX31865.
But how do I distinguish fault codes?

Example:

Code: Select all

uint8_t fault = max.readFault();
if (fault)
{
    Serial.print("Fault 0x"); Serial.println(fault, HEX);
    if (fault & MAX31865_FAULT_HIGHTHRESH) {
      Serial.println("RTD High Threshold");
    }
}
What is this MAX31865_FAULT_HIGHTHRESH ??

User avatar
adafruit_support_bill
 
Posts: 88038
Joined: Sat Feb 07, 2009 10:11 am

Re: 2 AMPLIFIERS max31865 and 1 Arduino UNO

Post by adafruit_support_bill »

That is the high-temperature threshold fault for temperature readings. See page 13 of the datasheet for a detailed explanation:
https://datasheets.maximintegrated.com/ ... X31856.pdf

User avatar
acay46
 
Posts: 3
Joined: Fri Dec 14, 2018 9:21 am

Re: 2 AMPLIFIERS max31865 and 1 Arduino UNO

Post by acay46 »

that's not what i mean

Adafruit_MAX31865 max_1 = Adafruit_MAX31865(10, 11, 12, 13);
Adafruit_MAX31865 max_2 = Adafruit_MAX31865(10, 11, 12, 13);


uint8_t fault_1 = max_1.readFault();
uint8_t fault_2 = max_2.readFault();

if (fault_1)
{
Serial.print("Fault 0x"); Serial.println(fault, HEX);
if (fault_1 & MAX31865_FAULT_HIGHTHRESH)
{
Serial.println("RTD High Threshold");
}
}

how do i distinguish it: AX31865_FAULT_HIGHTHRESH

User avatar
adafruit_support_bill
 
Posts: 88038
Joined: Sat Feb 07, 2009 10:11 am

Re: 2 AMPLIFIERS max31865 and 1 Arduino UNO

Post by adafruit_support_bill »

You can't with the code above for 2 reasons:

1) You have defined both instances of the sensor to use exactly the same pins. So you will always be reading the one with the CS pin connected to 10.

Code: Select all

Adafruit_MAX31865 max_1 = Adafruit_MAX31865(10, 11, 12, 13);
Adafruit_MAX31865 max_2 = Adafruit_MAX31865(10, 11, 12, 13);
2) Your code is only looking at fault_1. If you want to check the fault on max_2, you need to replicate that code for fault_2.

Code: Select all

if (fault_1) 
{
Serial.print("Fault 0x"); Serial.println(fault, HEX);
if (fault_1 & MAX31865_FAULT_HIGHTHRESH) 
{
Serial.println("RTD High Threshold"); 
}
}

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”