PWM Fan Control on the Jetson

I have used the Jetson AGX Xavier Devkit for a few weeks and noticed that when the clock on the jetson is at MAX 0, the PWM fan will run at its maximum speed, and it might produce some annoying noise. To decrease the RPM (Rotations per minutes) of the PWM fan embedded on the Jetson Xavier in the meanwhile keeping its clock at MAX 0, we need to manually overwrite the parameters in the pwm fan config file. For convenience, to control the pwm fan with the instant change of the CPU temperature on the Jetson AGX Xavier DevKit, I wrote an auto-control script for it.

You may find more info in the Repo.

This fan control script has three modes 0 , 1 , 2 and its set to different value of pwm. The default pwm values associated with mode 0 , 1 , 2 are 80, 150 , 255 accordingly. You may modify the pwm value associated with the mode in the script on your own need.

Check out the demo below:

The script is written in python as shown below:

import time

while True:
    fo = open("/sys/class/thermal/thermal_zone0/temp","r")
    thermal = int(
    pwm=50 #default

#    print thermal

    thermal = thermal / 1000
    if (thermal < 40):
        mode = 0
        pwm = 80
    elif (thermal >= 40 and thermal < 60):
        mode = 1
        pwm = 150
        mode = 2
        pwm = 255
    pwm = str(pwm)
    print ("current temp: " + str(thermal))
    print ("current fan mode: " + str(mode))
    print ("current pwm: " + str(pwm))


    time.sleep(10) #print the result for every 10s


Download the repository from my github repo

$ git clone

Modify Parameters

open the .sh or .py file and modify the pwm value based on your own need, save & exit

$ cd fan-control
$ gedit

Run it automatically when the device is booted at startup

$ sudo chmod +x
$ sudo scp /etc/init.d
$ sudo crontab -e
# add @reboot /etc/init.d/ at the very top lane
$ sudo reboot

Test it out, and enjoy !

More Posts

Leave a Reply