You can read voltages from your desktop's PMBus SMBus in Linux by using the lm-sensors suite, which provides a higher-level abstraction than raw I2C commands. This method automatically detects supported hardware and presents readable data through standard system interfaces, avoiding the need to manually calculate addresses or byte conversions.
Why Raw I2C Tools Often Fail
Many users attempt to usei2c-tools, specifically i2cget, to query specific registers on the SMBus. While this approach works for simple devices, it frequently fails for complex Power Management Bus (PMBus) controllers found in modern motherboards. The primary reason is that PMBus is not a single-register device; it requires a sequence of commands to initialize communication, select channels, and handle multi-byte responses. Furthermore, the kernel may map these devices differently depending on the BIOS version and motherboard manufacturer, making hardcoded addresses unreliable. Attempting to unload kernel modules like i2c-dev or i2c-isa to force access is dangerous and often breaks other system functions without providing any benefit to voltage reading tasks. Instead, leveraging established sensor drivers ensures stability and correct data interpretation.
Installing the lm-Sensors Suite
The most reliable way to access PMBus data is through thelm-sensors package. This toolset includes utilities that interact with the Linux kernel's hardware monitoring subsystem (hwmon). On Debian-based systems, you can install the necessary packages using the following command:
sudo apt-get update
sudo apt-get install lm-sensors sensors
For Red Hat-based distributions, use:
sudo yum install lm_sensors lm_sensors-utils
Once installed, you should run the detection script to ensure all available hardware monitoring chips are recognized by the system. This step probes the SMBus for known sensors and loads appropriate kernel modules if they are not already active.
sudo sensors-detect
During this process, you will be asked to confirm each probe. Pressing Enter to accept the default "Yes" for most questions is generally safe, as the script only reads information and does not modify system configurations permanently unless you explicitly choose to add modules to the boot configuration. After completion, restart the service or reboot to ensure all detected sensors are loaded.
Reading Voltage Values
With the tools installed and sensors detected, you can now view the voltage readings. The simplest command is:sensors
This command outputs a summary of all detected hardware sensors, including CPU temperatures, fan speeds, and voltages. Look for sections labeled with your motherboard model or chipset name. Voltages are typically listed under headings such as Vcore, +3.3V, +5V, or +12V. If the output is too verbose or you need programmatic access, you can query specific sensor files directly from the sysfs interface.
Each sensor appears as a directory under /sys/class/hwmon/. To find your PMBus controller, list the directories:
ls /sys/class/hwmon/
Identify the directory corresponding to your SMBus controller (often named something like hwmon0 or it8720). Inside, you will find files named in0_input, in1_input, etc., which contain the raw voltage values in millivolts. You can read them directly:
cat /sys/class/hwmon/hwmon0/in0_input
This method bypasses the complexity of PMBus protocol handling, as the kernel driver manages the communication internally. For more detailed information about your hardware specifications, including how these voltages relate to overall system power delivery, you might also want to check our guide on Displaying Hardware Specifications: Graphic Cards, which covers similar diagnostic techniques for other components.
Interpreting the Data
The values returned byin*_input files are in millivolts (mV). A value of 3300 corresponds to 3.3 Volts. It is important to note that these readings reflect the voltage supplied by the motherboard regulators, not necessarily the voltage received by every component, as there is always some drop across traces and connectors. Regularly monitoring these values helps identify unstable power delivery, which can lead to system crashes or hardware degradation over time.
Troubleshooting Missing Sensors
Ifsensors returns no data or shows zero values, several factors could be at play. First, verify that your motherboard actually supports PMBus monitoring via the OS. Some older or budget boards disable this feature in the BIOS. Check your motherboard manual for mentions of "Hardware Monitor," "PC Health Status," or "PMBus." Second, ensure that the correct kernel module is loaded. Use lsmod | grep i2c to see if relevant I2C adapters are present. If the adapter is missing, you may need to load it manually using sudo modprobe i2c_i801 (for Intel chipsets) or similar, depending on your platform. Finally, consider that some virtual machines do not expose physical SMBus devices to the guest OS, so this method is strictly for bare-metal Linux installations.
Frequently Asked Questions
Can I use i2cget to read PMBus voltages reliably?
No,i2cget is generally unsuitable for PMBus because it sends single-byte commands without the necessary initialization sequences. PMBus controllers require multi-step protocols that raw I2C tools cannot easily replicate. Using lm-sensors is the recommended alternative for stable and accurate readings.
What does it mean if a voltage reads 0 or very low?
A reading of 0 usually indicates that the sensor driver is not loaded or the hardware monitoring feature is disabled in the BIOS. Very low or fluctuating values may suggest a faulty sensor connection or a failing voltage regulator module on the motherboard. Always cross-reference with other diagnostic tools before assuming hardware failure.Does this method work on laptops?
It depends on the laptop manufacturer and model. Many laptops restrict access to hardware monitoring sensors for security reasons, or they use proprietary interfaces instead of standard PMBus. While some Lenovo ThinkPads and Dell Latitude models supportlm-sensors, many consumer laptops will return no data regardless of the software used.
Is it safe to modify the values in sysfs?
Absolutely not. The files in/sys/class/hwmon/ are read-only for user space applications. Any attempt to write to them will result in a permission denied error. These interfaces are designed solely for monitoring, not for controlling hardware parameters, which protects your system from accidental damage.
How often should I monitor these voltages?
For general desktop usage, occasional checks are sufficient to ensure stability. However, during overclocking, stress testing, or troubleshooting random shutdowns, continuous monitoring is advisable. You can set up cron jobs to logsensors output to a file for historical analysis if needed.