Home > Uncategorized > Howto: Reduce fan noise level on the eee pc 900 / 1000 / 1000H : Part II

Howto: Reduce fan noise level on the eee pc 900 / 1000 / 1000H : Part II

September 11th, 2008 Leave a comment Go to comments

This article is a continuation of a previous post on how to contol the fan on the eee pc. I have updated the fan control code to version 2 which uses a slightly more advanced mathematical function (a sigmoid function) when calculating the best fan speed for a given temperature.


Installation instructions
The first thing you need to do is to install Adams custom kernel for the eeepc. He has a nice guide on how to do that here. To automate the fan adjustment, I have written a small script (with the name eeefan) which can be seen below. You may copy-paste it, or download it here. I suggest that you put it in you ~/bin/ folder. Once you have done this, add the following line to the file /etc/crontab:

*/1 * 	* * * 	root 	sh /home/username/bin/eeefan2

Remember to replace username by your real user name. Also, add the line

asus_eee

to the file /etc/modules. Now, the fan speed will be automatically adjusted every 10 seconds.

eeefan Code:

# !/bin/sh
# K.H. Jensen 2008 // www.hartvig.de
# Released under the GPL
# eeefan version 2 - eee pc fan control utility

temperature_reading=/proc/eee/temperature
fan_control=/proc/eee/fan_speed
fan_manual_switch=/proc/eee/fan_manual

# Set critical temperature
TEMP_CRITICAL=57

# Set critical temperature interval size. See figure for details
TEMP_INTERVAL_SIZE=5

# Maximum fan speed
FAN_SPEED_MAX=55

eeefanupdate() {
    # Get temperature reading
    TEMP=$(cat $temperature_reading)
    # Calculate optimum fan speed
    X=$(echo "$FAN_SPEED_MAX*1/(1+e(-($TEMP-$TEMP_CRITICAL)/$TEMP_INTERVAL_SIZE))" | bc -q -l)
    # Workaround to convert it to nearest integer
    FAN_SPEED=$(echo "scale=0; $X/1.0" | bc -q -l)
    # Set fan speed
    echo $FAN_SPEED > $fan_control
}
# cron jobs can only be executed once every minute,
# so we have to use the sleep command
# Turn on manual fan control
echo 1 > $fan_manual_switch
# Run eeefanu, then wait 10 seconds.
eeefanupdate
sleep 10
eeefanupdate
sleep 10
eeefanupdate
sleep 10
eeefanupdate
sleep 10
eeefanupdate
Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google
Categories: Uncategorized Tags:
  1. September 16th, 2008 at 01:00 | #1

    That’s great work – I love the way you parse advanced math into bc :)

  2. mabe
    September 20th, 2008 at 10:06 | #2

    Thanks,

    Just when i was getting tired of the hum in my 901, i came across this page. At least in first try, it is working like charm.

    Now all that is needed is someone porting asus under and overclocking features in ubuntu. I would like to see my eee run in less than 800MHz in standard desktop use. What i found was that it is done in xandros and xp versions by adjusting bus speeds from 100 to standard 133 to overclock mode 150MHz.

    Now ubuntu is only adjusting multiplier to clock cpu from 800 to 1600MHz.
    With the mod it would be able to adjust from 600 to 1800MHz like in original distros. So more power when its needed and less heat when running powersave mode.

  3. Johannes
    November 2nd, 2008 at 12:56 | #3

    Thank you for the script. I’ve modified it so you can start it up from rc.local. Have fun!

    #!/bin/bash
    # based on eeefan2 by K.H. Jensen 2008 // http://www.hartvig.de
    # Released under the GPL
    # modified to run from rc.local

    #redirect all output to /dev/null
    exec &> /dev/null

    temperature_reading=/proc/eee/temperature
    fan_control=/proc/eee/fan_speed
    fan_manual_switch=/proc/eee/fan_manual

    # Set critical temperature
    TEMP_CRITICAL=55

    # Set critical temperature interval size. See figure for details
    TEMP_INTERVAL_SIZE=5

    # Maximum fan speed
    FAN_SPEED_MAX=55

    # Fill array fan_speed[Temperature]
    for ((TEMP=0; TEMP $fan_control
    }

    # Turn on manual fan control
    echo 1 > $fan_manual_switch

    # while manual fan control is active, control the fan, otherwise quit
    while [ $(cat $fan_manual_switch) -eq 1 ]; do
    eeefanupdate
    sleep 10
    done

  4. November 12th, 2008 at 02:47 | #4

    Hey. Cool Hack. But isn’t working correct:

    fan speed rises bud does not fall depending the cpu_temp.Means after cooling a while temp. decreases but fan speed stays the same (high) level..
    What’s the measure for that?

  5. admin
    November 21st, 2008 at 11:23 | #5

    @ Johannes: Nice hack. Maybe i will write something about using rc.local at some point

    @ Me(?): This is probably because you need to restart cron?

    /etc/init.d/cron restart

    Otherwise, try lowering TEMP_CRITICAL

  6. Me
    November 28th, 2008 at 03:29 | #6

    Perfect! Thx a lot. Restarting cron was the right thing to do.

  7. eraehn
    January 27th, 2009 at 07:21 | #7

    It worked, thanks alot =)

  8. CraigW
    February 27th, 2009 at 08:39 | #8

    Thank you, thank you! That noise was making me regret the purchase of this computer. Your script works like a charm!

  9. jan
    June 11th, 2009 at 12:31 | #9

    That sounds nice! Does it work with the eee 1008 HA?

  10. admin
    June 11th, 2009 at 15:28 | #10

    I believe, that it will also work with the eee 1008 HA.

  11. Mirco
    November 5th, 2009 at 16:19 | #11

    Hi I have a eee900 ubuntu 8.10 I am new with Ubuntu but I think I have performed correctly the procedure but it seems nothing change…the fan is still noisy and even more strange does not seem to stop even if I put the laptop for half an hour in the balcony with cold outside temperature. It’s very annoying. Thank for any advice.

  12. admin
    November 5th, 2009 at 16:26 | #12

    Mirco, have you installed Adams custom kernel? If not, get it here.

    Second thing you could try is to to restart cron. Execute (as root):

    /etc/init.d/cron restart

  13. Mirco
    November 5th, 2009 at 17:07 | #13

    I think, I have solved the problem. It did not work because eeefan2 was in a different path than indicated below

    */1 * * * * root sh /home/username/bin/eeefan2

    mine was

    */1 * * * * root sh /file system/bin/eeefan2

    I tried and it seems working properly.

    Hope it can be useful for other beginners who like me simply copy and paste.

    Thanks for your very effective solution. I was about to sell the laptop.

    Only one question…..does this solution collapse with “eee control”? I had to remove it, because it did not work anymore after having made you suggested changes.

    Thanks

  14. DavidZ
    November 6th, 2009 at 00:22 | #14

    Thanks so much. It works great. I’ve been looking for something like this for a very long time.

  15. August 17th, 2011 at 09:46 | #15

    Hmm it looks like your website ate my first comment (it was extremely long) so I guess I’ll just sum it up what I wrote and say, I’m thoroughly enjoying your blog. I too am an aspiring blog writer but I’m still new to everything. Do you have any tips for inexperienced blog writers? I’d genuinely appreciate it.

  1. September 11th, 2008 at 15:51 | #1
  2. March 15th, 2009 at 16:17 | #2
  3. June 9th, 2009 at 21:52 | #3
  4. June 30th, 2009 at 21:36 | #4