0
\$\begingroup\$

I managed to understand how to write/read data from the INA219 directly, using just linux/i2c-dev.

When I was planning my PCB and Bill of materials with my supervisor he suggested I should use a 0.002 Ohm - 1W shunt resistor for this module.

I tried to research on different forums on how to set this value in the registers. I also read the datasheet here: http://www.ti.com/lit/ds/symlink/ina219.pdf, but I am finding it very difficult to understand.

My battery can output at most 12.6V and I want to measure voltage/current every 20 seconds. Maximum current drawn will be 20A.

\$\endgroup\$
2
  • \$\begingroup\$ Choice is based on prudent temperature rise at max current such as 50% of rating at max current. \$\endgroup\$
    – D.A.S.
    Commented Mar 9, 2020 at 1:09
  • \$\begingroup\$ i.e. consider (i^2)*R power dissipation, at 20A a 50mOhm will dissipate 1W... \$\endgroup\$
    – vicatcu
    Commented Mar 9, 2020 at 2:56

1 Answer 1

1
\$\begingroup\$

Okay, so you have 20A and 2m\$\Omega\$ so the maximum voltage will be 40mV.

Current LSB according to Eq. 1 is 20A/2^15 = 0.0006103515625A.

Cal register is trunc(0.04096/(Current_LSB * Rshunt)) = 33554 = 0x8312

When you read the current register, you multiply that value times 0.0006103515625 to get the current in amperes.

Similarly, to get the power in watts multiply the value read from the Power register by 20 * 0.0006103515625 = 0.01220703125.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.