Skip to content

PWM Regulated Fan Based on CPU Temperature for Raspberry Pi

Notifications You must be signed in to change notification settings

blenherr/pwmfan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PWM Regulated Fan Based on CPU Temperature for Raspberry Pi

Installation guide

Install packages:

sudo apt install -y git

Clone git repository:

git clone https://github.com/blenherr/pwmfan.git

Configuration

Change FAN_PIN to your used pwm pin in this files: calibration.py and fanctrl.py

nano ~/pwmfan/calibration.py
nano ~/pwmfan/fanctrl.py

Calibration

Use the calibration.py program to find the FAN_MIN value by running in the terminal:

python ~/pwmfan/calibration.py

Add service

Create fanctrl.service file

sudo nano /lib/systemd/system/fanctrl.service

Add following lines and change <your_user_goes_here> with your own user

[Unit]
Description=Raspberry Pi - PWM Fan Control
After=multi-user.target

[Service]
WorkingDirectory=/home/<your_user_goes_here>/pwmfan
Type=simple
Restart=always
ExecStart=/usr/bin/python /home/<your_user_goes_here>/pwmfan/fanctrl.py

[Install]
WantedBy=multi-user.target

Save and close

Enable service

sudo systemctl enable fanctrl

Start service

sudo systemctl start fanctrl

Acknowledgment

About

PWM Regulated Fan Based on CPU Temperature for Raspberry Pi

Resources

Stars

Watchers

Forks

Languages