Running Raspberry Pi 5 Active Fan at Max Speed
Like most of the folks, I too was excited when the launch of Raspberry Pi 5 with the newer processor. I didn’t intend to use it for any power tasks, but mostly for casual browsing and IoT experiments. For the most part it handles these things OK until it doesn’t.
The overheating/hanging problem
I have it setup with the official Active Cooler but one problem I have constantly faced with the unit is, sometimes the Fan Ramps down and when the system load increases, its not fast enough to ramp up, leading the system hang.
Tried multiple settings, operating systems and even changed the thermal pads to better ones but this is something that constantly keeps on bugging. Its quite annoying and the only option you are left with is to terminate the power, wait for it to cool down and restart. Also if it overheats and is in the hanged state, it remains on with I am afraid at some point with damage the electronics.
Solution: Run the fan at max speed
The device is not overclocked or anything so I expect it to behave it consistently. It running stability for long period is far more important to me than performance. So my solution to this is was to always turn on the fan at max speed.
I am using Ubuntu 24.04 LTS as my OS, but the steps should work pretty much on all operating systems
Build and Install Raspberry Pi Utils
Clone the raspberrypi/utils repo using the following command
git clone https://github.com/raspberrypi/utils.git
Setup the build tools using
sudo apt install cmake device-tree-compiler libfdt-dev
now just cd in the the utils directory and run the following commands to build and install the utilities
cd utils cmake . make sudo make install
Setting Fan Speed to Max using pinctrl
If every thing went well above, there would be couple of utilities installed on the machine now. You can check the official githib readme to explore them more. The one which we are interested in pinctrl.
Its replacement for raspi-gpio, a tool for displaying and modifying the GPIO and pin muxing state of a system, bypassing the kernel.
Running the following command should set the fan speed to max
sudo pinctrl FAN_PWM op dl
Creating a auto start service
One of the problems that you might observe is that after restart the setting gets reset. As the command needs to be run with sudo privileges, the easiest solution is to create a service and enable it to autorun. involves only 3 steps listed below
Create a service file in /etc/systemd/system
sudo vim /etc/systemd/system/run_fan_at_max.service
Copy the following content in the file
[Unit] Description=Script to run fan at max [Service] ExecStart=pinctrl FAN_PWM op dl [Install] WantedBy=multi-user.target
Reload and enable the service using the following commands
systemctl daemon-reload sudo systemctl enable run_fan_at_max.service sudo systemctl start run_fan_at_max.service
If everything went well the service should be active and running with the following log
This site uses Akismet to reduce spam. Learn how your comment data is processed.
Leave a Reply