Configure an INA219 power sensor

Configure an INA219 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 ina219 model. Name your sensor, and click Create.

ina219 power sensor configuration tab

Edit and fill in the attributes as applicable.

{
  "components": [
    {
      "name": "ina1",
      "type": "power_sensor",
      "model": "ina19",
      "attributes": {
        "i2c_bus": "integer",
        "i2c-addr": "integer"
      },
      "depends_on": []
    }
  ]
}

The following attributes are available for INA219 sensors:

AttributeTypeInclusionDescription
i2c_busintegerRequiredThe number of the I2C bus that the sensor is connected to.
i2c_addressintegerOptionalThe sensor’s unique I2C address.
Default: 0x40
max_current_ampsnumberOptionalDefault: 3.2A. 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.