How to get sensor readings for recent hardware?

These are the primary alternatives:

Wait it out: If you don't consider sensor readings critical you may just wait for the next Ubuntu release, which may include support for the chip by default.

Standalone driver: If you don't want to wait, a standalone driver may be the best option, as it makes minimal changes to the rest of the system. See below for how to install it.

Upgrade the kernel: This is somewhat more risky, as you will be running an unsupported and untested combination of Ubuntu version and kernel version - upgrading the kernel may fix the sensor support while breaking something else. Upgrading the kernel may also work just fine, as long as you are prepared to roll back in case it doesn't.

The simplest way to upgrade the kernel is to use one of Ubuntu's prebuilt kernel packages, see ubuntu.com kernel builds for instructions.


Installing a standalone driver

Read the Ubuntu compiling HOWTO, install compiling tools:

sudo apt-get install build-essential

Download the source code for the driver

    wget [.h, .c and Makefile files]
  • Compile, install and load the new module. Here w83627ehf is the name of the recently compiled driver, it will differ between systems.

    make all
    sudo make install
    sudo modprobe w83627ehf
    

Check that it works

    $ sensors
    w83667hg-isa-0a10
    Adapter: ISA adapter
    in0:       +1.18 V  (min =  +0.62 V, max =  +1.47 V)   
    in1:       +1.11 V  (min =  +1.05 V, max =  +1.15 V)   
    [... snip ...]

Add configuration

It still needs chip-specific configuration, this is the hard part.

  • Lucky case: Find a ready-made config at lm-sensors.org configurations.
  • Google hunting: Search for the chip name and you may find someone with the same chip and a working config.
  • Last resort: Compare with values in BIOS and make an educated guess on which reading goes where.
  • Configuration goes in /etc/sensors3.conf
  • Reload (sudo sensors -s) or restart (sudo service lm-sensors restart) to use the new configuration.

Checking post-config

    $ sensors
    w83667hg-isa-0a10
    Adapter: ISA adapter
    VCore:       +1.18 V  (min =  +0.62 V, max =  +1.47 V)   
    Vtt:         +1.11 V  (min =  +1.05 V, max =  +1.15 V)   
    AVCC:        +3.34 V  (min =  +2.98 V, max =  +3.63 V)   
    +3.3V:       +3.34 V  (min =  +2.98 V, max =  +3.63 V)   
    IGD:         +1.56 V  (min =  +1.00 V, max =  +2.00 V)   
    3VSB:        +3.26 V  (min =  +2.98 V, max =  +3.63 V)   
    VBat:        +3.31 V  (min =  +2.54 V, max =  +3.46 V)   
    CPU Fan:    1834 RPM  (min =  301 RPM, div = 32)
    M/B Temp:    +30.0°C  (high = +55.0°C, hyst = +52.0°C)  sensor = thermistor
    CPU Temp:    +67.0°C  (high = +72.0°C, hyst = +70.0°C)  sensor = thermistor
    AUX Temp:    +27.0°C  (high = +80.0°C, hyst = +75.0°C)  sensor = thermistor

Make it work after restart

  • Edit /etc/rc.local
  • Add the line modprobe w83627ehf
  • (Replace w83627ehf with the sensor for your system. Make sure to put it before the exit 0 line, which terminates the script.)

Sanity check the output

  • Compare the sensors listing with the BIOS readings, verify that they are in the ballpark of each other.
  • If you dual boot with Windows you can compare CPU temperatures with Real Temp.

Calibrating display values

  • You can add lines like compute in1 (56/10+1)*@, @/(56/10+1) to sensors3.conf. @ is the sensor value. The first calculation converts a sensor value to display value, the second calculation converts it back.
  • See man sensors.conf
  • Getting accurate temperatures would require an infrared thermometer and a few hours of work (see takkat's reply here), but you can normally get "ballpark" values with less effort.

If you know of a way to improve this answer, please do.