Your company here ā€” click to reach over 10,000 unique daily visitors

hwmon_ina219 - Man Page

driver for UPS based on INA219


hwmon_ina219 -h

hwmon_ina219 -a UPS_NAME [OPTIONS]


This man page only documents the specific features of the hwmon_ina219 driver. For information about the core driver, see nutupsdrv(8).

The driver implements reading of current and voltage from INA219 by using hwmon sysfs API of the Linux Kernel. There is no other UPS-like logic in there. Based on the measurements of the battery voltage and charging current, the driver makes assumptions of the current state of the system.

Supported Hardware

The hwmon_ina219 driver is based on setup with Raspberry PI Compute Module 4 and its baseboard Waveshare CM4-POE-UPS-BASE.

Extra Arguments

The required parameter for this driver:


Path to appropriate /sys/hwmon/hwmonX or auto to detect automatically.

Optional parameters:


Threshold for low battery state (in percent).


Nominal voltage (V) value of utilised batteries, used to derive their low and high watermark settings (see below). Default: 3.6.

Known pre-sets include: 3.6, 3.7, 3.8, 3.85.


Low voltage (V) value of used batteries. Practically, it denotes depleted batteries. If not given, it is derived from the battery.voltage.nominal.


High voltage (V) value of used batteries. Practically, it denotes fully charged batteries. If not given, it is derived from the battery.voltage.nominal.


This driver is specific to the Linux hwmon API.

When using with the Waveshare CM4-POE-UPS-BASE baseboard, there are few steps to be done to enable access to the INA219 circuit:

  1. edit boot/config.txt:

  2. create a new device tree overlay file i2c-ina219.dts:

    / {
        compatible = "brcm,bcm2835";
        fragment@0 {
            target = <&i2c_csi_dsi>;
            __overlay__ {
                #address-cells = (1);
                #size-cells = (2);
                ina219@43 {
                    status = "okay";
                    compatible = "ti,ina219";
                    reg = <0x43>;
                    shunt-resistor = (3);  // R100
  3. convert i2c-ina219.dts to dtbo and place it into /boot/overlays:

    $ dtc -@ -I dts -O dtb -o /boot/overlays/i2c-ina219.dtbo i2c-ina219.dts
  4. configure hwmon_ina219 UPS driver for NUT (ups.conf):

    driver = hwmon_ina219
    port = auto

Known Issues and Bugs

The driver shutdown function is not implemented.


Andrew Anderson <aander07@gmail.com>

See Also

The core driver


Internet resources

Referenced By


07/03/2024 Network UPS Tools 2.8.2. NUT Manual