6

I am pretty new to the GPIO part of the raspberry Pi. When I need pins I normally just use Arduino. However I would really like this project to be consolidated to one platform if possible, I would like to do it all on the PI.

So I have three (3) MAX31855 boards and type K Thermocouples. I just don't know where to go with hooking up the other two. I don't know if I can just use any other pins (besides power and ground pins) for the MISO, CSO, and SCLK pins. This may sound like a rookie question but like I said I'm used to using arduino for this stuff. Any input is appreciated. Thanks in advance.

I'm using code from https://github.com/Tuckie/max31855

from max31855 import MAX31855, MAX31855Error

cs_pin=24
clock_pin=23
data_pin=22
unit="f"
thermocouple1=MAX31855(cs_pin, clock_pin, data_pin, units)
print(thermocouple.get())
thermocouple.cleanup()
Stephen Rauch
  • 47,830
  • 31
  • 106
  • 135
Craig Walker
  • 131
  • 2
  • 10
  • you could use a TH7 which has 7 thermo-couple inputs on one PCB for the raspberry pi https://github.com/robin48gx/TH7 – user50619 Sep 25 '18 at 16:08

2 Answers2

12

You can share the MISO and SCLK lines among the devices, and then each device will need its own CS. Something like:

Multi Drop SPI

In this case Master is the Pi, and Slaves are the MAX31855's. SS (Slave Select) is the same as CS (Chip Select).

from max31855 import MAX31855, MAX31855Error

cs_pin_1=24
clock_pin=23
data_pin=22
cs_pin_2=21
cs_pin_3=20
units = "f"

thermocouple1=MAX31855(cs_pin_1, clock_pin, data_pin, units)
thermocouple2=MAX31855(cs_pin_2, clock_pin, data_pin, units)
thermocouple3=MAX31855(cs_pin_3, clock_pin, data_pin, units)
Stephen Rauch
  • 47,830
  • 31
  • 106
  • 135
0

You could use a TH7 pi hat which allows up to seven thermocouple inputs. This PCB uses the standard python SPI interface. Python Code plus documentation below. https://github.com/robin48gx/TH7

user50619
  • 325
  • 5
  • 14