Configure an INA226 power sensor

Configure an INA226 power sensor to integrate into your robot:

Navigate to the Config tab of your robot’s page in the Viam app. Click on the Components subtab and click Create component in the lower-left corner. Select the type power_sensor, then select the ina226 model. Name your sensor, and click Create.

ina226 power sensor configuration tab

Edit and fill in the attributes as applicable.

{
  "components": [
    {
      "name": "ina2",
      "type": "power_sensor",
      "model": "ina226",
      "attributes": {
        "i2c_bus": "integer",
        "i2c_address": "integer"
      },
      "depends_on": []
    }
  ]
}

The following attributes are available for INA226 sensors:

AttributeTypeInclusionDescription
i2c_busintegerRequiredThe number of the I2C bus that the sensor is connected to.
i2c_addressintegerOptionalDefault: 0x40. The sensor’s unique I2C address.
max_current_ampsnumberOptionalDefault: 20A. The maximum current that the sensor can measure in amperes (A).
shunt_resistancenumberOptionalDefault: 0.1Ω. The shunt resistance value of the sensor in Ohms (Ω).


Have questions, or want to meet other people working on robots? Join our Community Discord.