[RPi] 为树莓派添加DIY智能散热风扇

普通散热风扇只有两个线,即VCC电源以及GND接地,而树莓派的GPIO最大只能输出几十毫安,所以根本无法直接通过GPIO来控制风扇。 所以,我们需要加装一个三极管使用小电流来控制大电流。 三极管在很多旧设备里面可以找到,这里以 1AM 示例(从USB支付钥匙拆的)。然后以以下示意图接上三极管。 GitHub: https://github.com/xswxm/Smart_Fan_for_Raspberry_Pi.git 这次一共写了两个版本,一个是普通版本,只能开关风扇,另一个PWM版本支持PWM调速。笔者的风扇使用PWM调速时,能够良好的工作,但有滋滋的噪声,这可能与风扇的质量有关,或许也可以后期改进电路解决。 sudo apt-get update sudo apt-get install python python-dev python-pip # 安装模块 sudo pip install rpi.gpio sudo apt-get install pigpio python-pigpio # 查看帮助文档 python fan.py -h # 以默认配置运行 python fan.py # 后台运行 nohup python fan.py & # 设置pin为24,每2秒检测一下CPU温度,若超过50度则开启风扇 python fan.py -t 50 -i 2 -p 24 # 启用...

[RPi] 树莓派添加samba文件共享服务

1. 安装Samba sudo apt-get install samba samba-common-bin 2. 为samba添加用户,可以使用现有账户,也可以创建专属账户 添加专属账户(如果你只想要添加已存在的账户,可以跳过这一步) # 添加账户,username即你想要添加的账户名 sudo useradd username # 建立共享文件夹即修改用户组 sudo mkdir -p /home/username sudo chown -R username:username /home/username/ 为samba添加账户 # 添加账户,username是你想要添加到samba的账户,该步骤会要求设置密码,需要注意的是如果你samba下的用户名的密码区别于树莓派系统下的用户名的密码 sudo smbpasswd -a username 3. 修改配置文件 # 对原配置文件做一备份 sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.bak # 创建一个新的配置文件 sudo nano /etc/samba/smb.conf 配置文件可以照如下修改,然后按 Ctrl+o 保存,Ctrl+x退出 [pi] comment= My Samba path =...

[12864/SSD1306] Play Snake on Raspberry Pi

System Monitor for Raspberry Pi with 12864/SSD1306, and you can download all the files from GitHub. Demo Setting Up Configure your 128464 by following this tutorial: https://learn.adafruit.com/ssd1306-oled-displays-with-raspberry-pi-and-beaglebone-black/usage?view=all # Ports used for the Display. You may have to change them to yours RST = 25 DC = 24 # Configurations of this game # You may...

[12864/SSD1306] System Monitor for Raspberry Pi

System Monitor for Raspberry Pi with 12864/SSD1306, and you can download all the files from GitHub. Demo Modules Adafruit_GPIO.SPI Adafruit_SSD1306 psutil Setting Up Configure your 128464 by following this tutorial: https://learn.adafruit.com/ssd1306-oled-displays-with-raspberry-pi-and-beaglebone-black/usage?view=all sudo apt-get install python-pip sudo pip install psutil # Ports used for fthe Display. You may have to change them to yours RST =...

[12864/SSD1306] Video Player

It is a python script for playing videos on 12864 over SPI sockets, and you can download all the files from GitHub. Demo Modules Adafruit_GPIO.SPI Adafruit_SSD1306 Setting Up Configure your 128464 by following this tutorial sudo apt-get install python-pip sudo apt-get install python-pygame sudo pip install opencv-python # Ports used for the Display. You may...

[MyIoT] A start with personal server for home automation

What is myIoT: 1. myIoT is a solution for home automation, it can be implemented on your Raspberry Pi. And it theoretically can enable you to control devices (include other embedded devices connected to the server) and acquire info of these devices. 2. It is currently based on python (sever part) and Android (Client) 3....

Translate »