简体   繁体   English

覆盆子pi上的多个热电偶

[英]Multiple thermocouples on raspberry pi

I am pretty new to the GPIO part of the raspberry Pi. 我是覆盆子Pi的GPIO部分的新手。 When I need pins I normally just use Arduino. 当我需要引脚时,我通常只使用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. 但是如果可能的话,我真的希望将这个项目合并到一个平台上,我想在PI上完成所有这些工作。

So I have three (3) MAX31855 boards and type K Thermocouples. 所以我有三(3)个MAX31855板和K型热电偶。 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. 我不知道我是否可以使用任何其他引脚(电源和接地引脚除外)用于MISO,CSO和SCLK引脚。 This may sound like a rookie question but like I said I'm used to using arduino for this stuff. 这可能听起来像一个菜鸟问题,但就像我说我习惯使用arduino这个东西。 Any input is appreciated. 任何输入都表示赞赏。 Thanks in advance. 提前致谢。

I'm using code from https://github.com/Tuckie/max31855 我正在使用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()

You can share the MISO and SCLK lines among the devices, and then each device will need its own CS . 您可以在设备之间共享MISOSCLK线路,然后每个设备都需要自己的CS Something like: 就像是:

多点SPI

In this case Master is the Pi, and Slaves are the MAX31855's. 在这种情况下, Master是Pi,而Slaves是MAX31855。 SS (Slave Select) is the same as CS (Chip Select). SS(从选择)与CS(片选)相同。

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)

You could use a TH7 pi hat which allows up to seven thermocouple inputs. 您可以使用TH7 pi帽子,它允许多达7个热电偶输入。 This PCB uses the standard python SPI interface. 该PCB使用标准的python SPI接口。 Python Code plus documentation below. Python Code以及下面的文档。 https://github.com/robin48gx/TH7 https://github.com/robin48gx/TH7

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM