Skip to content

tibor8472/raspberry_fan_controller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Raspberry fan controller

Simple python script for control speed of a pwm cooling fan.

Tested with a KDB0605HB laptop cooler on a Raspbery Pi 4, Ubuntu server 19.10 64bit, 20.04 64bit; Raspberry Pi OS

Dependencies:

  • python3 (installed and made default by update-alternatives)
  • package RPi.GPIO
  • package gpiozero

How to use:

I assume you connected to Pi via SSH before (Ubuntu server has it and started it by default). ReferenceLink

  1. Download packages with pip or apt
    • pip: $ pip install RPi.GPIO gpiozero
    • or apt: $ sudo apt-get install python3-rpi.gpio python3-gpiozero
  2. Copy fancontroller.py to user directory (in my case /home/ubuntu)
  3. Create cron job:
    • open crontab: $ sudo crontab -e
    • insert a new line and paste @reboot /path/to/python3 /path/to/fancontroller.py
      • e.g.: "@reboot /usr/bin/python3 /home/ubuntu/fancontroller.py" in my case
    • save and exit
  4. Reboot Pi and script should work after system startup

Note:

I am using Raspberry Pi 4 with KDB0605HB blower fan - whitch is a part of an Asus laptop - as my own DIY project. 300Hz was quite appropriate as PWM output frequency for this cooler, but if you have another type (for example this one), this can be different.

References:

Test result:

Temperature in idle mode fluctuated between 41-43 Celsius under Ubuntu 19.10, therefore PWM.ChangeDutyCycle() got 20% in those loops. Note that Ubuntu server for RPi consumes much resource and heating CPU compared to Raspbery OS.

P. S.

This is my first uploaded project, so execuse me if experience any deficiency on my commit...

About

Simple python script for control speed of a pwm cooling fan

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages