简体   繁体   English

如何从Arduino上的脚本读取树莓派温度来控制风扇

[英]How to read raspberry pi temperature from script on an Arduino to control fan

我正在做一个包括我的树莓派和 aruduino 的学校项目,我制作了一个温度脚本,允许我监控 pi 的当前温度,我想知道是否可以从我的 arduino 读取此输出以控制风扇的速度。

You can actually to it all with the Raspberry Pi.您实际上可以使用 Raspberry Pi 完成所有操作。 Control you fan with a PWM value that will then turn on and off a MOSFET.用 PWM 值控制风扇,然后打开和关闭 MOSFET。

If you really have to do it with the Arduino, the "simple noob" way of doing this is to send a PWM pulse output from the Pi and analog read it from the Arduino.如果你真的必须用 Arduino 来做,那么“简单的菜鸟”方法是从 Pi 发送一个 PWM 脉冲输出,然后从 Arduino 模拟读取它。 From there, do the same as you would do with the Pi.从那里开始,像使用 Pi 一样做同样的事情。

You could also use serial communication.您也可以使用串行通信。 If you have to use the Arduino, then Dat Ha is right, PWM is the easiest.如果你必须使用Arduino,那么Dat Ha是对的,PWM是最简单的。

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

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