Tuesday, May 28, 2013

CPU Fan Control For Dell 3521


Dell Inspiron 3521 has latest ivy bridge CPU and switchable graphics.
Unfortunately when I installed Ubuntu 13.04, Ati Graphics Card was always On as a result, temperatures were high and fan was spinning like crazy.

I had to do something. First I turned off VGA. Temperatures were lower then but fan speed was still high. So i created a script in Ruby ( The latest Language I added to my knowledge ) that moderates CPU fan based on CPU temperature. Maybe someone may need this so I'll provide instructions and the script bellow.





Download: Dropbox Folder
Source: Repository

Instructions:
1) You must have installed ruby : sudo apt-get install ruby
2) Then you have to load i8k module which is required to get and set fan values. Run in terminal: sudo modprobe -v i8k
3) Install i8kctl with apt get: sudo apt-get install i8kctl
4) Edit the file /etc/default/i8kbuttons & /etc/default/i8kmon and set ENABLED to 1 or run this: sudo sed -i.bak 's/ENABLED=0/ENABLED=1/' /etc/default/{i8kmon,i8kbuttons}
5) And then you are ready to run my ruby script by going to script folder and writing ./fanControl.rb

*Notes*
N1) run ./fanControl.rb -h to check switches that you can use.
N2) This script is still beta. I just created and I'm testing it. You may find new versions in the dropbox folder.
N3) This script created for DELL 3521 and uses only the "right" fan (which is the only one in 3521), you can try this script in other Dell computers but be careful (check temperatures , fan speed , etc)

Usage Examples:
1) Set CPU Fan To High (ConstHight,NoOutput): ./fanControl.rb -ch -no 
2) Set CPU Fan To Low (ConstLow): ./fanControl.rb -cl
3) Set Summer Mode: ./fanControl.rb -sm


6 comments:

  1. George, did you manage to switch to the on-board Ivy-Bridge? Mine ran a lot cooler this way on 12.04 (at least 10C cooler) but froze frequently. After upgrading to 12.10 only the ATI 7600M works and way to hot (60C when idle).
    I was thinking about installing 13.04 to see if I can use the Ivy-Bridge there (and without freeze-ups). Does it work for you? (You must have the Catalyst Control Center installed to perform the switch).
    Thanks

    ReplyDelete
  2. On Ubuntu if you close the graphics card after login you will have freezes after some seconds . You have to run the commands at startup by entering the command in rc.local file. I'm gonna post the topic where I found the solution later :)

    ReplyDelete
  3. As instructed in this page : http://ubuntuforums.org/showthread.php?t=2043730

    "You should check if your ATI Driver is using after reboot the opensource driver radeon
    lspci -nnnv | grep ATI -A 5

    2.- Add this lines to /etc/rc.local (before exit 0)

    chmod o+rx /sys/kernel/debug
    #Replace USERNAME with your user
    chown USERNAME /sys/kernel/debug/vgaswitcheroo/switch
    echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
    "

    ReplyDelete
  4. Thank you George, this worked! The system is much cooler now.
    Unfortunately I had to reinstall 12.04 in the meantime (the upgrade messed up the system beyond repair) and now your script doesn't work (it used to work in 12.10).
    The error: fancontrol.rb:295 in `main': undefined method argv for ARGF: Object (NoMethodError).
    Do you have any idea how to work around this? Thanks again.

    ReplyDelete
  5. Hi I want to know if this script will work on my dell inspiron 15 3521 with:
    i3-3217U cpu 1.8 Ghz
    and graphic card is intel hd graphic 4000
    please answer me because when I'm working on ubuntu my fan rans at max power like a hair dryer

    ReplyDelete
  6. Hi I just read your article and found it very helpful for those who are looking for a CPU cooler for Dell 3521. Well, if someone is looking to buy a cpu cooler then I'd love to recommend this list of best cpu coolers. I bet you will find the best one on this link.

    ReplyDelete