Using hardware sensors in Ubuntu

Using hardware sensors in Ubuntu

Modern PCs and laptops contain health monitoring chips and sensors.
These sensors can monitor temperature and voltages of motherboard, CPU and hard disk drives.
They can also report and control the rotation speed of cooling fans.

It displays some vital temperature values and speed of cooling fans on the toolbar.

This guide will show you how to utilize hardware sensors in Ubuntu Linux.

1) Install lm-sensors package

lm-sensors package detects the sensor chipsets and settles appropriate drivers for them.
lm-sensors has also ways to read and name the sensor values.

More details on http://www.lm-sensors.org

Update package index and upgrade your system. Run command

sudo apt-get update && sudo apt-get -y upgrade

Then install lm-sensors package. Run command

sudo apt-get install lm-sensors

2) Do configuration

Detect available sensor chipsets in your computer and create a configuration file, /etc/sensors3.conf.
Run command

sudo sensors-detect

I simply answer Y to all questions.
Press the [ENTER] key and answer Y (yes) to all questions.

It is quite important that you answer yes to the last question so the values are saved in /etc/sensors3.conf (the configuration file).
Do you want to add these lines automatically? (yes/NO): yes

This step will also write the drivers (module) names in the /etc/modules file.
The drivers will be then loaded at next startup.

Check your /etc/modules file. Run

cat /etc/modules

The output should be something like this

# /etc/modules: kernel modules to load at boot time.

# Generated by sensors-detect on Tue Jun 1 10:52:37 2011
# Chip drivers
w83627ehf
coretemp

In this case it added two modules; w83627ehf and coretemp. The modules and names are totally hardware (motherboard and CPU) dependent.

You can also check the /etc/sensors3.conf file. Just read it through.

3) Reboot your computer

Reboot your computer to load the sensor drivers (modules).

You could also load the modules manually without rebooting.
The configration step above reported the module names so you could load them manually with the modprobe command.
In this sample case, I would do

sudo modprobe w83627ehf
sudo modprobe coretemp

 

4) Test the sensors

Test the senors by running

sensors

The output should be something like this:
w83627dhg-isa-0290
Adapter: ISA adapter
VCore: +1.10 V (min = +0.00 V, max = +1.74 V)
in1: +12.09 V (min = +7.18 V, max = +3.59 V) ALARM
AVCC: +3.31 V (min = +0.00 V, max = +3.07 V) ALARM
3VCC: +3.31 V (min = +0.64 V, max = +2.16 V) ALARM
in4: +1.58 V (min = +1.15 V, max = +1.23 V) ALARM
in5: +1.55 V (min = +0.07 V, max = +1.41 V) ALARM
in6: +4.97 V (min = +1.64 V, max = +1.92 V) ALARM
VSB: +3.31 V (min = +2.75 V, max = +2.56 V) ALARM
VBAT: +3.25 V (min = +0.14 V, max = +1.79 V) ALARM
Case Fan: 727 RPM (min = 6026 RPM, div = 16) ALARM
CPU Fan: 1493 RPM (min = 7336 RPM, div = 8) ALARM
Aux Fan: 0 RPM (min = 50 RPM, div = 128) ALARM
fan4: 0 RPM (min = 81 RPM, div = 128) ALARM
fan5: 860 RPM (min = 474 RPM, div = 16)
Sys Temp: +43.0°C (high = +8.0°C, hyst = +74.0°C) sensor = thermistor
CPU Temp: +33.5°C (high = +80.0°C, hyst = +75.0°C) sensor = diode
AUX Temp: +127.0°C (high = +80.0°C, hyst = +75.0°C) ALARM sensor = thermistor
cpu0_vid: +1.125 V

coretemp-isa-0000
Adapter: ISA adapter
Core 0: +35.0°C (high = +78.0°C, crit = +100.0°C)

coretemp-isa-0001
Adapter: ISA adapter
Core 1: +40.0°C (high = +78.0°C, crit = +100.0°C)

 

5) Show some vital sensor values on the toolbar

I usually display some important temperature and fan speed values on the toolbar.
GNOME has a very good applet for that.

Install the GNOME’s sensor-applet. Run command

sudo apt-get install sensors-applet

Then update GNOME’s toolbar and applet list. Run

pkill gnome-panel

Add the sensor-applet to the toolbar.
Right-mouse click on the toolbar and choose “Add to panel…” from the menu.
See picture 3a…

Then locate and add the “Hardware sensor monitor” applet to the panel.
See picture 3b…

6) Configure the sensor applet

Right-mouse click on the sensor-applet and choose Preferences from the popup-menu.
See picture 6a…

Select the [Sensors] page and checkmark/enable the values to be shown on the toolbar.

© All Right Reserved 2019-2020 futuredesktop.org