Ina226 level setting

I use the ina226 but it only shows 0.0025 V instead of 12 V … What am I doing wrong ?

Do I have to add any multiplier to the file ?

Or should the part show the applied voltage (and current) directly and correctly ?

Where do you use it?

In ESPHome?

We are not very good mind readers.

If it is ESPHome I suspect you are looking at the shunt voltage instead of the bus voltage.

Share your config.

Hello Tom,

Thanks for the reply … yes, I actually use the shunt voltage with the ina226 …bus voltage with the ins219.

But the problem has changed with the last ESP Home update, because now I get the error with both the 226 and the 219 that the modules are no longer recognized at all. Only the 3221 is still working.

[14:32:28][C][i2c.arduino:071]: I2C Bus:
[14:32:28][C][i2c.arduino:072]: SDA Pin: GPIO4
[14:32:28][C][i2c.arduino:073]: SCL Pin: GPIO5
[14:32:28][C][i2c.arduino:074]: Frequency: 50000 Hz
[14:32:28][C][i2c.arduino:086]: Recovery: bus successfully recovered
[14:32:28][I][i2c.arduino:096]: Results from i2c bus scan:
[14:32:28][I][i2c.arduino:098]: Found no i2c devices!
[14:32:28][C][ina226:087]: INA226:
[14:32:28][C][ina226:088]: Address: 0x40
[14:32:28][E][ina226:091]: Communication with INA226 failed!
[14:32:28][E][component:082]: Component ina226.sensor is marked FAILED


[14:39:39][C][i2c.arduino:071]: I2C Bus:
[14:39:39][C][i2c.arduino:072]: SDA Pin: GPIO4
[14:39:39][C][i2c.arduino:073]: SCL Pin: GPIO5
[14:39:39][C][i2c.arduino:074]: Frequency: 50000 Hz
[14:39:39][C][i2c.arduino:086]: Recovery: bus successfully recovered
[14:39:39][I][i2c.arduino:096]: Results from i2c bus scan:
[14:39:39][I][i2c.arduino:102]: Found i2c device at address 0x40
[14:39:39][C][ina219:133]: INA219:
[14:39:39][C][ina219:134]: Address: 0x40
[14:39:39][E][ina219:137]: Communication with INA219 failed!
[14:39:39][E][component:082]: Component ina219.sensor is marked FAILED

I have now replaced the modules several times with new ones … but I can no longer get them to work.

The 226 is not even recognized on the i2c, but the 219 is.

My captive portal looks like this:

captive_portal:

i2c:
  sda: 4 #D2
  scl: 5 #D1
  scan: true
  id: bus_a

sensor:
  - platform: ina226
    address: 0x40
    shunt_resistance: 0.1 ohm
    max_current: 3.2A

    adc_time: 140us
    adc_averaging: 128
    update_interval: 60s
    current:
      name: "INA226 Current"
    power:
      name: "INA226 Power"
    bus_voltage:
      name: "INA226 Bus Voltage"
    shunt_voltage:
      name: "INA226 Shunt Voltage"



captive_portal:

i2c:
  sda: 4 #D2
  scl: 5 #D1
  scan: true
  id: bus_a

sensor:
  - platform: ina219
    address: 0x40
    shunt_resistance: 0.1 ohm
    current:
      name: "INA219 Current"
    power:
      name: "INA219 Power"
    bus_voltage:
      name: "INA219 Bus Voltage"
    shunt_voltage:
      name: "INA219 Shunt Voltage"
    max_voltage: 32.0V
    max_current: 3.2A
    update_interval: 6s
    

I really don’t know, what it all about cause the ESP units are consuming day after day and don’t work really reliable … every up-date brings surprises … and the ESPHome documentation doesn’t cover much regarding these little TI devices.

Moved to the correct category. Please do this yourself in future so we don’t have to guess what you are talking about.

HI! I implemented esp32 with ina226. I would like to add a mAh counter. do you know how to do it? Thank you.

Example configuration entry

sensor:

  • platform: ina226
    address: 0x40
    shunt_resistance: 0.079 ohm
    current:
    name: “INA226 Current”
    power:
    name: “INA226 Power”
    bus_voltage:
    name: “INA226 Bus Voltage”
    shunt_voltage:
    name: “INA226 Shunt Voltage”
    max_current: 3.2A
    update_interval: 0.3s