The Adafruit MAX31865 RTD Sensor Breakout is an electronic component designed to interface with an RTD sensor, providing precise temperature measurements. RTDs, or Resistance Temperature Detectors, are sensors used to measure temperature by correlating the resistance of the RTD element with temperature. The MAX31865 breakout board simplifies the process of reading temperatures from an RTD by handling the necessary amplification and analog-to-digital conversion.
Pin | Description |
---|---|
VIN | Supply voltage (3.3V to 5V) |
GND | Ground |
SCK | Serial Clock Input for SPI |
MISO | Master In Slave Out for SPI |
MOSI | Master Out Slave In for SPI |
CS | Chip Select for SPI |
RDY | Ready pin to indicate new data is available |
#include <SPI.h>
#include <Adafruit_MAX31865.h>
// Use software SPI: CS, DI, DO, CLK
Adafruit_MAX31865 max = Adafruit_MAX31865(10, 11, 12, 13);
// Use hardware SPI, just pass in the CS pin
//Adafruit_MAX31865 max = Adafruit_MAX31865(10);
void setup() {
Serial.begin(115200);
Serial.println("Adafruit MAX31865 PT100 Sensor Test!");
max.begin(MAX31865_3WIRE); // set to 2WIRE or 4WIRE as needed
}
void loop() {
uint16_t rtd = max.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(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();
}
delay(1000);
}
readFault()
function to check for specific errors and address them as indicated by the MAX31865 datasheet.Q: Can I use the MAX31865 with a PT1000 RTD? A: Yes, the MAX31865 can be configured to work with PT1000 RTDs by adjusting the reference resistor value in the code.
Q: How accurate is the MAX31865 breakout board? A: The MAX31865 offers a temperature resolution of 0.03125°C, but the overall accuracy depends on the RTD sensor and the system design.
Q: What is the maximum temperature the MAX31865 can measure? A: The maximum temperature is determined by the RTD sensor used. PT100 sensors typically measure up to 850°C, but always refer to the sensor's datasheet for its specific range.
Q: How do I calibrate the MAX31865 breakout board? A: Calibration involves comparing the readings from the MAX31865 with a known temperature reference and adjusting the reference resistor value or using software compensation to correct any discrepancies.