Datasheet
More Accuracy
Our library is efficient and small and uses an algorithm to calculate temperature. While this works very well, it isn't as
accurate as it could be. Check out this ITS-90 conforming library from DrHaney that uses a lookup table for better
accuracy! (https://adafru.it/Cbo)
Library Reference
You can start out by creating a MAX31865 object with either software SPI (where all four pins can be any I/O) using
Or you can use hardware SPI. With hardware SPI you
must
use the hardware SPI pins for your Arduino - and each
arduino type has different pins! Check the SPI reference to see what pins to use. (https://adafru.it/d5h)
In this case, you can use any CS pin, but the other three pins are fixed
Once started, you can initialize the sensor with one of the following, depending on what kind of RTD you've got
connected!
Reading Resistance
If you want to know the actual
resistance
(not temperature) you can do that fairly easily. You can read
ratio
from the
MAX31865 with
This will give you the raw 16-bit unsigned value where 0xFFFF is '1.0 ratio'. Chances are you want to convert it to the
resistance. We recommend this code:
You'll need to define RREF - in this case its 430.0 for PT100 and 4300.0 for PT1000
Calculating Temperature
Once you have the resistance you can look up in an RTD table or use a calculation to do a best-fit approximation. We
use the example from this app note: http://www.analog.com/media/en/technical-documentation/application-
// 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);
max.begin(MAX31865_2WIRE)
max.begin(MAX31865_3WIRE)
max.begin(MAX31865_4WIRE)
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);
© Adafruit Industries https://learn.adafruit.com/adafruit-max31865-rtd-pt100-amplifier Page 23 of 31










