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

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
Be Sociable, Share!

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

  1. Pingback: Howto: Reduce fan noise level on the eee pc 901 / 1000 / 1000H at hartvig.de :: suprnova.dk

  2. mabe

    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.

    Reply
  3. Johannes

    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

    Reply
  4. Me

    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?

    Reply
  5. admin Post author

    @ 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

    Reply
  6. Pingback: Temperature and fan speed control on the Asus Eee PC | handyfloss

  7. Pingback: Controlling fanspeeds in Linux on PWM motherboards, Thinkpads and ASUS Eee PC | tjansson.dk

  8. Pingback: Ubuntu on Asus EEE PC 900 | tbaumi's tech blog

  9. Mirco

    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.

    Reply
  10. admin Post author

    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

    Reply
  11. Mirco

    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

    Reply
  12. Ladies Watches Esq

    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.

    Reply
  13. n0ukf

    Can this be adapted to work under Puppy Linux (Lucid 528)? Looking at the first part, Puppy doesn’t appear to have all the commands or modules you’re using.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>