Fan Interface
The Radxa CM4 IO Board features an onboard fan interface for connecting an external fan to cool the board.
Hardware Connection
Connect the fan to the 2-Pin 1.25mm fan header on the Radxa CM4 IO Board.
Fan specifications:
- Interface type: 2-Pin 1.25mm
- Operating voltage: 5V
Refer to the Hardware Information guide to locate the corresponding hardware interface.
Checking Fan Devices
- Use the
ls
command to view registered fan devices in the system.
ls /sys/devices/platform/ | grep fan
Terminal output example:
pwm-fan
pwm-fan
: Control device for the onboard fan
- Locate PWM Control Files
The PWM control files for the fan are typically located in the /sys/class/hwmon/
directory. You need to find the hwmon
directory corresponding to pwm-fan
.
Use the ls
command to view the PWM control files for the pwm-fan
device:
ls /sys/class/hwmon/
Terminal output example:
hwmon0
- Identify Fan Control Node
Use the ls
command to view the PWM control files for the pwm-fan
device in the hwmon
directory:
ls -l /sys/class/hwmon/hwmon*/device
Terminal output example:
/sys/class/hwmon/hwmon0/device -> ../../../pwm-fan
Based on the terminal output, we can control the pwm-fan
through hwmon0
.
Controlling Fan Speed
Use the echo
command to set the fan speed. The PWM control range is typically 0~255 (0=stop, 255=full speed).
- Full Speed
echo 255 | sudo tee /sys/class/hwmon/hwmon0/pwm1
- Half Speed
echo 128 | sudo tee /sys/class/hwmon/hwmon0/pwm1
- Turn Off Fan
echo 0 | sudo tee /sys/class/hwmon/hwmon0/pwm1
Interface Pin Definitions
For detailed pin definitions, please refer to the hardware schematics available on the Resource Download page.