A A
RSS

Enabling Hardware Sensors in Linux

Mon, Mar 2, 2009

Tweet this!

Introduction

Most computers these days come with a myriad of sensors to monitor the temperature of your computer. These sensors are generally located on the processor and the motherboard, and you might also have sensors on your video card. On top of that, all S.M.A.R.T-enabled hard drives have built-in temperature monitoring.

The temperature of your computer is a vital thing to keep track of – heat and computers don’t mix very well. Unfortunately, Ubuntu doesn’t setup your computer’s sensors automatically; but you can follow these steps to enable the temperature sensors in your computer in Ubuntu, or any other version of Linux. While sensor-monitoring is somewhat hardware dependant, this guide will work for most users. It involves heavy use of the command-line, but don’t worry – I will walk you through it step-by-step.

1. Installing the sensor libraries

First thing’s first – you need to install the libraries that allow Linux to read your sensors. To do this, install the lm-sensors library, by running the command:

sudo apt-get install lm-sensors

This will install the libraries for your motherboard’s sensors. For your hard-disk sensors, you’ll want to install hddtemp:

sudo apt-get install hddtemp

In Ubuntu, the install will ask you several questions. First it will ask if it should run SUID root, select “yes.” It will then ask you for an interval for logging the temperature to a file; since we are going to have an applet display our system temperatures for us, this isn’t necessary, so most users will be fine leaving the default of ’0′ and pressing enter; if you wish to log this data, however, I’d recommend a value between 2 and 10 seconds. Next, it will ask if it should run as a deamon; select yes, and leave the default values for hostname and port. Finally, it will ask if you wish for it to run on startup – select “yes.”

2. Running sensors-detect

Now that your sensor libraries are installed, you need to detect your sensors! Run the command:

sudo sensors-detect

Which will probe your system for sensors. Answer “YES” to all questions! Don’t just hit enter, type “YES”, because at the end there will be a question for which the default answer is “no”, and we’ll want to answer in the affirmative.

The sensors-detect program will scan yur system, and then give you a summary, stating which sensors it has found. It will then say: I will now generate the commands needed to load the required modules. After you hit ENTER to continue, it will ask, Do you want to add these lines to /etc/modules automatically? (yes/NO) This is the question we want to make sure we answer YES to.

3. Loading the modules

Since we answered YES to the previous question, our sensor modules will be loaded by default the next time we start up. But since we don’t want to have to reboot, we’re going to use the information we got from the sensors-detect script to load the modules ourselves, this time only. Right above the last question will appear a list of modules that you should load, in the form of:

#----cut here----
# Chip drivers
smsc47m1
#----cut here----

You may have more, or different, items listed – that’s fine! What we want to do now, to load these modules, is use the modprobe command, as follows:

sudo modprobe [module name]

So, in my case, I would type:

sudo modprobe smsc47m1

If all goes well, you should be returned to the command-line, without any output.

4. Monitoring the sensors!

Wow, that was a lot of work! Now, let’s see the rewards. On the command line, you can simply run the

sensors

command; this will output the information from your motherboard’s sensors.

However, we’d rather have a graphical interface for checking up on our hardware, so let’s install an applet for our Gnome desktop to keep an eye on our system’s temperature. Run the command:

sudo apt-get install sensors-applet

to install the applet. Now, add the applet by right-clicking on your desktop panel, selecting “Add to Panel,” and you will now see a “Hardware Sensors Monitor” applet in the System & Hardware section. Click and drag this to your panel to add it.

The applet will now say that you haven’t enabled any sensors; right click on the applet and open its preferences. The first screen is for general settings:

General Sensor Settings Image

The options here are self-explanatory; for update interval, choose a value between two and ten seconds. The second screen is where you can enable your sensors to be displayed in the applet:

Sensor Selection Image

Here we have my hard drive, /dev/sda, enabled. Simply check off the sensors you want to enable, and they will appear in your panel!

Conclusion

Hopefully by now, you’ll see icons in your panel, with thermometers and temperature readouts, keeping you apprised of the status of your system’s hardware. You’ll notice that when doing intensive operations, various parts of your system will increase in temperature; this is normal, and this applet will help you keep an eye on things so nothing overheats.

Like this post?

30 Responses to “Enabling Hardware Sensors in Linux”

  1. GAMT says:

    Hi; I use the sensor module smsc47m1
    but I followed your directions and I guess smsc47m1 module couldn’t find any sensors.. but hddtemp works fine :)

    Overall good guide *thumbsup*

  2. Jani says:

    Thanks, excellent and easy instruction.

  3. Jim Porter says:

    I’ve just followed your instructions and everything worked straight away – thanks.

  4. Varun says:

    thanks a lot! I was trying to get something visual for my 64-bit Ubuntu 9.04

  5. Martin says:

    Great, it worked first time around in Linux Mint 6, Felicia – x64 Edition. Lm-sensors and hddtemp were already installed. After ‘Do you want to add these lines to /etc/modules automatically? (yes/NO)’ The answer should of course be ‘yes’ and not ‘YES’.
    Thanks from Nederland.

  6. Pat says:

    After doing the sensors-detect questions, I put in ‘sensors’ in the terminal, and this is what it returns:

    No sensors found!
    Make sure you loaded all the kernel drivers you need.
    Try sensors-detect to find out which these are.

    Any idea why and what I have to do to get it to work?

  7. Scott says:

    Hey – just wanted to say thanks for a clear and concise how-to. I now have everything I need at a glance at the top. I just wish more how-to’s out there were like yours. Keep up the good work!

  8. Warren says:

    Your instructions worked correctly and everything is working. Cheers!

  9. Warren says:

    Thanks for your instructions, everything is working great. Cheers!

  10. Jay says:

    Hi all,

    perhaps someone can help me:

    Using this great instruction on Jaunty / Thinkpad X300, I get not one, but 15 temperatures from 33 to 43 Celsius displayed in my panel, all from the cpu, in a row and taking all the space…
    Do you know where this could come from / what it means / how I could possibly fix it to show only one temperature?

    Thanks a lot in advance,

    J.

    • Steven Brick says:

      To load everything that is needed, add this to /etc/modules:

      #—-cut here—-
      # Chip drivers
      # no driver for SMSC LPC47M172 Super IO Fan Sensors yet
      #—-cut here—-

      This is the response I got from the terminal. What do I need to do now?

      Thank you.

  11. Duke says:

    Worked great first time in Ubuntu 9.04!
    Thanks for your detail.

    D.

  12. Cliff says:

    Hey,

    Great job! Thanks for your very intuitive instruction. Everything works great

    CD

  13. juan says:

    Easy to follow, thanks.
    The module in my case was smsc47b397

  14. Josh says:

    Really good walk through. I have messed with x-sensors in the past but this is exactly what I wanted, sensors on my panel. The hardest part is figuring out which sensor goes to what hardware.

    Good Job, Thank you.

  15. Ala Micu says:

    Thank you from Romania

    Cliff said:

    Great job! Thanks for your very intuitive instruction. Everything works great.

    I agree 200%

  16. piyawan says:

    It works~~ thank you very much ^__^
    But don’t forget t restart computer one time before ‘add to panel’

  17. Pollux says:

    At last! A simple, clear set of instructions for setting something up in Ubuntu!
    Everything worked perfectly.

    Thanks.

  18. ozone says:

    Thank You! I’ve been using linux for 1 day and was able to follow your directions. This should be used as a model for others in how to write directions.

  19. veracruz says:

    Very easy and concise instructions thanks!!

  20. Humberto Ibanez says:

    Very good! After to run ‘sensors-detect’ the it87 driver was probed and the ‘hwmon0(3)’ can be added to Computer Temperature Monitor from Gnome panel.

  21. sniper7137 says:

    Thanks. By far the easiest tutorial to setup temperature sensors in ubuntu i could found.

  22. Tim Chaubet says:

    Thank you very much.
    working for gigabyte motherboard GA-MA790FXT-UD5P

  23. Tim Chaubet says:

    Is there an easy way to see this data on a webpage ?

  24. golinux says:

    Thank you for the very clear ‘how-to’. I had downloaded the applet via Synaptic on Squeeze but couldn’t figure out how to get past ‘no sensors found’. It’s up and running now. When I get the nVidia driver installed will I have to rerun sensors-detect?

  25. risdiyanto says:

    i’ve run sensors-detect script but it doesn’t find any sensors module on my laptop,..
    any solution?

    • Jonathan DePrizio says:

      HI,

      What model laptop do you have? It’s possible that its sensors are not supported, or that you may need certain additional drivers.

  26. Valery says:

    everything is fine! thanks a lot!
    I’ve got intel atom + nvidia ion m-board.
    Drvers: “coretemp” and “lm90″

  27. Ri says:

    Excellente!

    This tutorial got my default ubuntu applet to work, but also installed a much better one which fits well in a drawer.:)

    Thank you much. =D

  28. Mihai says:

    Works on a ASROCK_Z68_PRO3_GEN3 motherboard with i3 2100 CPU.

    Good Job. Thanks !

Leave a Reply

Weekly Poll

What's the best Linux distribution for desktops?

View Results

Loading ... Loading ...

Search TechThrob

Advertisement