【问题标题】:Multiple thermocouples on raspberry pi树莓派上的多个热电偶
【发布时间】:2017-09-23 03:35:50
【问题描述】:

我对树莓派的 GPIO 部分还是很陌生。当我需要别针时,我通常只使用 Arduino。但是,如果可能的话,我真的希望将这个项目整合到一个平台上,我想在 PI 上完成这一切。

所以我有三 (3) 个MAX31855 板和 K 型热电偶。我只是不知道去哪里与其他两个挂钩。我不知道我是否可以将任何其他引脚(除了电源和接地引脚)用于 MISO、CSO 和 SCLK 引脚。这听起来像是一个菜鸟问题,但就像我说的那样,我习惯使用 arduino 来处理这些东西。任何输入表示赞赏。提前致谢。

我正在使用来自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()

【问题讨论】:

  • 您可以使用一个 TH7,它在一个 PCB 上具有 7 个热电偶输入,用于树莓派 github.com/robin48gx/TH7

标签: python python-3.x raspberry-pi gpio temperature


【解决方案1】:

您可以在设备之间共享MISOSCLK 行,然后每个设备都需要自己的CS。比如:

在这种情况下,Master 是 Pi,而 Slaves 是 MAX31855。 SS(Slave Select)和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)

【讨论】:

  • 检查并投票赞成。我显然没有足够的声望来投票。
【解决方案2】:

您可以使用最多允许 7 个热电偶输入的 TH7 pi hat。 该 PCB 使用标准的 python SPI 接口。 Python代码加 下面的文档。 https://github.com/robin48gx/TH7

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-10-17
    • 1970-01-01
    • 2012-12-04
    • 2014-01-18
    • 2015-06-19
    • 1970-01-01
    相关资源
    最近更新 更多