Raspberry Pi CM5 Fan Curve

Proactive Cooling

To enable the fan on a Raspberry Pi and set a cooling fan curve, you can add the following parameters to your /boot/firmware/config.txt file.

Here is the breakdown of how to read these specific metrics, followed by a detailed look at each stage.

  • cooling_fan=on: Enables the kernel-level fan control driver.
  • fan_tempX: The temperature trigger point measured in millicelcius (e.g., 38000 = 38°C).
  • fan_tempX_speed: The fan speed, defined by a PWM (Pulse Width Modulation) value from 0 to 255 (where 0 is completely off and 255 is 100% full speed).
  • fan_tempX_hyst: The hysteresis value, also in millicelcius (e.g., 5000 = 5°C). This is a “buffer” that prevents the fan from rapidly flickering on and off if the CPU temperature wavers right at the threshold. The fan won’t drop back down to the previous lower speed until the temperature falls below the threshold minus the hysteresis.

The settings in the example maps to this table:

Stage Trigger Temp (Rising) Fan Speed (PWM / %) Release Temp (Falling)
Idle / Cool Below 38°C 0 (Off)
Stage 0 38°C 130 (~51% speed) Drops to Off at 33°C
Stage 1 46°C 190 (~75% speed) Drops to Stage 0 at 41°C
Stage 2 55°C 200 (~78% speed) Drops to Stage 1 at 50°C
Stage 3 65°C 255 (100% Max speed) Drops to Stage 2 at 60°C

Append the following lines to the end of the file /boot/firmware/config.txt:

# Proactive Cooling Fan Curve for Raspberry Pi
# turn on the fan and set temperature thresholds for different fan speeds
dtparam=cooling_fan=on
dtparam=fan_temp0=38000  
dtparam=fan_temp0_hyst=5000
dtparam=fan_temp0_speed=130

dtparam=fan_temp1=46000
dtparam=fan_temp1_hyst=5000
dtparam=fan_temp1_speed=190

dtparam=fan_temp2=55000
dtparam=fan_temp2_hyst=5000
dtparam=fan_temp2_speed=200

dtparam=fan_temp3=65000
dtparam=fan_temp3_hyst=5000
dtparam=fan_temp3_speed=255

Passive Cooling

If you prefer a more passive cooling at the early stages, reduce the temp_speed0 and temp_speed1 to 0. Avoid any values at or below ~100 (~50% speed) as it could cause fan to alternative between on/off constantly.

Please tune these values based on your individual preferences.

Updated: