Hardware

The MAX31855 board uses SPI to communicate with a Raspberry Pi or BeagleBone Black.  You can use either software SPI on any 3 digital GPIO pins, or you can use hardware SPI on your board's dedicated SPI pins.  If you aren't sure which option to choose, try software SPI since it's more flexible and speed isn't critical when reading the MAX31855 sensor.

Raspberry Pi

Software SPI

To use software SPI on a Raspberry Pi connect the MAX31855 to the Raspberry Pi as follows.  Note that you can use any 3 digital IO pins for the CLK, CS, and DO pins.

  • Connect Pi 3.3V to MAX31855 Vin.
  • Connect Pi GND to MAX31855 GND.
  • Connect Pi GPIO 18 to MAX31855 DO.
  • Connect Pi GPIO 24 to MAX31855 CS.
  • Connect Pi GPIO 25 to MAX31855 CLK.

Hardware SPI

To use hardware SPI on a Raspberry Pi connect to the MAX31855 as follows.

  • Connect Pi 3.3V to MAX31855 Vin.
  • Connect Pi GND to MAX31855 GND.
  • Connect Pi MISO to MAX31855 DO.
  • Connect Pi CS0 to MAX31855 CS.
  • Connect Pi SCLK to MAX31855 CLK.

The wiring above will use the Raspberry Pi's hardware SPI bus to communicate with the MAX31855.  If you haven't done so already with your Pi, make sure to edit the blacklist.conf file to comment the line which disables SPI. Reboot your Pi and you should see the files /dev/spidev0.0and /dev/spidev0.1 are now available.

BeagleBone Black

Software SPI

To use software SPI on a BeagleBone Black connect to the MAX31855 as follows.  Note that you can use any 3 digital GPIO pins for the CLK, CS, and DO pins.

If you aren't familiar with how GPIO pins are numbered, check out this guide on BeagleBone Black GPIO.

  • Connect BeagleBone Black P9_1 DGND to MAX31855 GND.
  • Connect BeagleBone Black P9_3 3.3V to MAX31855 Vin.
  • Connect BeagleBone Black P9_12 to MAX31855 CLK.
  • Connect BeagleBone Black P9_15 to MAX31855 CS.
  • Connect BeagleBone Black P9_23 to MAX31855 DO.

Hardware SPI

To use hardware SPI with the BeagleBone Black connect the MAX31855 as follows.

If you aren't familiar with how GPIO pins are numbered, check out this guide on BeagleBone Black GPIO.

  • Connect BeagleBone Black P9_1 DGND to MAX31855 GND.
  • Connect BeagleBone Black P9_3 3.3V to MAX31855 Vin.
  • Connect BeagleBone Black P9_22 SPI0 CLK to MAX31855 CLK.
  • Connect BeagleBone Black P9_17 SPI0 CS to MAX31855 CS.
  • Connect BeagleBone Black P9_21 SPI0 MISO to MAX31855 DO.

The wiring above assumes using a hardware SPI interface on the BeagleBone Black, specifically /dev/spidev1.0. Before you can use this SPI interface you must enable a device tree overlay to turn on the SPI pin functionality. The easiest way to enable this device tree overlay is to configure the BeagleBone Black to load the overlay automatically on boot.

With the BeagleBone Black connected to your computer over USB, open the USB mass storage drive named 'boot' and edit the file uEnv.txt on the drive. Add the following line to the file:

optargs=capemgr.enable_partno=BB-SPIDEV0

NOTE: Be careful editing the uEnv.txt file on Windows, as changing the line endings can cause your BeagleBone Black not to boot and require an OS reinstall! The safest option is to connect to the BeagleBone Black in a command window and follow the steps at the end of this page to mount and edit uEnv.txt on the BeagleBone Black.

Reboot your device and you should see the files /dev/spidev1.0 and /dev/spidev1.1 now exist.

Last updated on 2015-05-04 at 04.27.56 PM Published on 2014-09-19 at 06.06.10 PM