With this python script the speed of a 4-pin PWM fan is rising with the temperature of your raspi-CPU.
!!!YOU HAVE TO CONNECT THE GROUND OF THE FAN TO A GROUND PIN OF YOUR PI TO GET THIS TO WORK!!!
-
Connect the PWM pin of your fan to GPIO 12
-
Connect the ground pin of your fan to a ground pin of your Pi
-
python3 -m pip -r requirements.txt
-
python3 pi_fan_control.py
-
Optional: Change
mintemp
andmaxtemp
in the python script to your needs. Belowmintemp
it will set the speed to slowest and abovemaxtemp
it will set it to fastest.