MAX31865 with PT100

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
jasch028
 
Posts: 3
Joined: Tue Apr 05, 2022 7:40 am

MAX31865 with PT100

Post by jasch028 »

Foto
Foto
IMG_20220405_133738.jpg (1023.94 KiB) Viewed 660 times
Foto
Foto
IMG_20220405_133738.jpg (1023.94 KiB) Viewed 660 times
Hello,

For my project at university i use your product. Now I have a technical problem.

I want to use a PT100 temperature sensor (2 wires) with Arduino Uno. To get the signal I have checked out, that I need an amplifier and I found the matching one in the internet. I use the MAX31865. The inernet told me how to associate the Arduino with it. I also found the finished programmcode for the Arduino. I installed the Adafruit_Max31865 Library and included it to my programm as the following:

#include <Adafruit_MAX31865.h>.

But the right temperatures aren´t given ou in the Serial Monitor. The RTD value is always 0, the Resistance also and as temperature it aways give 998 or 272 out.

Where is the problem or mistake? Can you help me, please? I also have controlled the REF resistance on the board, there is a 430 Ohm resistance what I also have specified in my programm, as well as the 2 wire Sensor system.

It would be very nice if you can help me! Thank you. The picture shows my construction.

VIN 5V Arduino
GND GND Arduino
3V3 -
CLK Pin10
SDO Pin11
SDI Pin12
CS Pin13
ROY -

My programmcode is the following:

Code: Select all

#include <Adafruit_MAX31865.h>

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


#define RREF      430.0                                               // The value of the Rref resistor. Use 430.0 for PT100 and 4300.0 for PT1000


#define RNOMINAL  100.0                                               // 100.0 for PT100, 1000.0 for PT1000

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

  max.begin(MAX31865_2WIRE);  // set to 2WIRE or 4WIRE as necessary
}


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

  Serial.print("RTD value: "); Serial.println(rtd);
  float ratio = rtd;
  ratio /= 32768;                                                     // Wert durch verhältniss von Rreal und Rref
  Serial.print("Ratio = "); 
  Serial.println(ratio,8);
  Serial.print("Resistance = "); 
  Serial.println(RREF*ratio,8);
  Serial.print("Temperature = "); 
  Serial.println(max.temperature(RNOMINAL, RREF));

  // Check and print any faults
  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"); 
    }
    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"); 
    }
    max.clearFault();
  }
  Serial.println();
  delay(1000);
}
Last edited by adafruit_support_carter on Tue Apr 05, 2022 12:12 pm, edited 1 time in total.
Reason: added [code] tags

User avatar
adafruit_support_carter
 
Posts: 29168
Joined: Tue Nov 29, 2016 2:45 pm

Re: MAX31865 with PT100

Post by adafruit_support_carter »

That MAX31865 breakout does not appear to be one sold by Adafruit. It looks like a clone. Where did you purchase the breakout?

User avatar
jasch028
 
Posts: 3
Joined: Tue Apr 05, 2022 7:40 am

Re: MAX31865 with PT100

Post by jasch028 »

Yes maybe you are right. It does not have the adafruit label printed on its surface. I have checked it. I will try to buy a original one by adafruit and I hope, then I will able to become the right temperatures.

Thank you for your support!!

User avatar
jasch028
 
Posts: 3
Joined: Tue Apr 05, 2022 7:40 am

Re: MAX31865 with PT100

Post by jasch028 »

Hi,

now I have bought the original board MAX31865 from Adafruit and it works. But now I have another problem.

I want to connect three pt100 sensors with 3 max31865 to one Arduino Uno to get temperatures from the sensors at the same time. Therefore I have connected all CLK pins together and have connected it to Pin13 Arduino. All SDO pins are connected together to Pin12 Arduino and all SDI Pins are connected to Pin 11 Arduino.

They have one power supply, 5V from the Arduino.

From each board/sensor the CS pin are connected to different arduino pins. The CS Pin of board one is connected to Pin 10 (arduino) and from board two it is connected to Pin 9 of the Arduino. The CS pin of Board 3 is connected to pin8 Arduino. But it does not work in this constellation.

Surprisingly, the sensors work individually in this connection but not all together at the same time. the serial monitor shows no temperatures

I uses the following code:

Code: Select all

#include <Adafruit_MAX31865.h>
#include <SPI.h>



#include <Adafruit_MAX31865.h>
#include <SPI.h>

// use hardware SPI, just pass in the CS pin
Adafruit_MAX31865 max_1 = Adafruit_MAX31865(10);
Adafruit_MAX31865 max_2 = Adafruit_MAX31865(9);
// The value of the Rref resistor. Use 430.0!
#define RREF 430.0


void setup() {
  Serial.begin(115200);
SPI.begin();
  max_1.begin(MAX31865_2WIRE);  // set to 2WIRE or 4WIRE as necessary
   max_2.begin(MAX31865_2WIRE);
}

void loop() {
  
  //TERMOPAR 1
  
  uint16_t rtd1 = max_1.readRTD();
  
  Serial.print("RTD value1: "); 
  Serial.println(rtd1);
  float ratio1 = rtd1;
  ratio1 /= 32768;
  Serial.print("Resistance1 = "); 
  Serial.println(RREF*ratio1,8);
  Serial.print("Temperature1 = "); 
  Serial.println(max_1.temperature(100, RREF));

  //TERMOPAR 2
  
  uint16_t rtd2 = max_2.readRTD();
  Serial.print("RTD value2: "); 
  Serial.println(rtd2);
  float ratio2 = rtd2;
  ratio2 /= 32768;
  Serial.print("Resistance2 = "); 
  Serial.println(RREF*ratio2,8);
  Serial.print("Temperature2 = ");
  Serial.println(max_2.temperature(100, RREF));

  // Check and print any faults

  //TERMOPAR 1
  
  uint8_t fault1 = max_1.readFault();
  if (fault1) {
    Serial.print("Fault1 0x");
   Serial.println(fault1, HEX);
  
  if (fault1 & MAX31865_FAULT_HIGHTHRESH) {
    Serial.println("RTD High Threshold");
}
  if (fault1 & MAX31865_FAULT_LOWTHRESH) {
    Serial.println("RTD Low Threshold");
}
  if (fault1 & MAX31865_FAULT_REFINLOW) {
  Serial.println("REFIN- > 0.85 x Bias");
}
  if (fault1 & MAX31865_FAULT_REFINHIGH) {
    Serial.println("REFIN- < 0.85 x Bias - FORCE- open");
}
  if (fault1 & MAX31865_FAULT_RTDINLOW) {
    Serial.println("RTDIN- < 0.85 x Bias - FORCE- open");
}
  if (fault1 & MAX31865_FAULT_OVUV) {
   Serial.println("Under/Over voltage");
}
  max_1.clearFault();
}

  //TERMOPAR 2
  uint8_t fault2 = max_2.readFault();
   if (fault2) {
   Serial.print("Fault2 0x");
    Serial.println(fault2, HEX);
  
  if (fault2 & MAX31865_FAULT_HIGHTHRESH) {
   Serial.println("RTD High Threshold");
}
  if (fault2 & MAX31865_FAULT_LOWTHRESH) {
    Serial.println("RTD Low Threshold");
}
  if (fault2 & MAX31865_FAULT_REFINLOW) {
    Serial.println("REFIN- > 0.85 x Bias");
}
  if (fault2 & MAX31865_FAULT_REFINHIGH) {
   Serial.println("REFIN- < 0.85 x Bias - FORCE- open");
}
  if (fault2 & MAX31865_FAULT_RTDINLOW) {
   Serial.println("RTDIN- < 0.85 x Bias - FORCE- open");
}
  if (fault2 & MAX31865_FAULT_OVUV) {
    Serial.println("Under/Over voltage");
}
  max_2.clearFault();
}

  
  Serial.println();
}
Can you help me? Do you know what´s wrong?

Thank you for your support!!
Last edited by adafruit_support_carter on Wed Apr 20, 2022 12:37 pm, edited 1 time in total.
Reason: added [code] tags

User avatar
adafruit_support_carter
 
Posts: 29168
Joined: Tue Nov 29, 2016 2:45 pm

Re: MAX31865 with PT100

Post by adafruit_support_carter »

You have three MAX31865's connected, but your code is only initializing two of them. Try coding for all three. Without explicit code to initialize the 3rd board, it could be potentially interfering with the other two boards (its CS is not being asserted).

There's no need to call SPI.begin() in setup().

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

Return to “Other Arduino products from Adafruit”