Datasheet
following this example exactly).
By default the MAX31865 class assumes a 2 wire sensor, however you can change this by setting the wires keyword
argument in the initializer. Set this to the number of wires in your sensor (2, 3, or 4). For example to create a 3 wire
sensor:
Be sure to set wires to the appropriate value for your sensor!
In addition you can specify the nominal resistance and reference resistance of the RTD with these optional keyword
arguments of the initializer:
rtd_nominal - This is the resistance value in Ohms of the RTD at a nominal value (typically 0 degrees Celsius).
This defaults to 100 for a PT100 sensor. For a PT1000 change it to 1000 Ohms.
ref_resistor - The reference resistor value in Ohms. The default is 430 Ohms which matches the PT100 version
of the breakout. For a PT1000 breakout change this to 4300 Ohms.
For example here's how to create a 2-wire PT1000 sensor instance with 1000 Ohm nominal resistance and 4300 Ohm
reference resistance:
Now you're ready to read values from the sensor using any of these properties:
temperature - The temperature measured by the sensor in degrees Celsius.
resistance - The resistance of the RTD in Ohms.
See the simpletest.py example (https://adafru.it/Cbr) for a complete demo of printing the range every second. Save
this as code.py on the board and examine the REPL output to see the temperature printed every second.
That's all there is to using the MAX31865 with CircuitPython!
import board
import busio
import digitalio
import adafruit_max31865
spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
cs = digitalio.DigitalInOut(board.D5) # Chip select of the MAX31865 board.
sensor = adafruit_max31865.MAX31865(spi, cs, wires=3)
import board
import busio
import digitalio
import adafruit_max31865
spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
cs = digitalio.DigitalInOut(board.D5) # Chip select of the MAX31865 board.
sensor = adafruit_max31865.MAX31865(spi, cs, rtd_nominal=1000.0, ref_resistor=4300.0)
print('Temperature: {0:0.3f}C'.format(sensor.temperature))
print('Resistance: {0:0.3f} Ohms'.format(sensor.resistance))
© Adafruit Industries https://learn.adafruit.com/adafruit-max31865-rtd-pt100-amplifier Page 27 of 31










