Skip to content

Are the considerations for setCalibration_16V_400mA() correct? #57

@wollewald

Description

@wollewald

Hi, thanks for your library!

First a minor issue: In Adafruit_INA219.cpp, in function setCalibration_16V_400mA(), you say you are using the highest precision 0.1 mA.

void Adafruit_INA219::setCalibration_16V_400mA() {
// Calibration which uses the highest precision for
// current measurement (0.1mA), at the expense of
// only supporting 16V at 400mA max.

But according to line 416 the current LSB you are using is 0.00005:

// CurrentLSB = 0.00005 (50uA per bit)

My main question is about the voltage limitation. In these lines you calculate the maximum power:

// 8. Compute the Maximum Power
// MaximumPower = Max_Current_Before_Overflow * VBUS_MAX
// MaximumPower = 0.4 * 16V
// MaximumPower = 6.4W

Why is 16 V the limit? Here, some calculations using 400 mA / 32 V:

  • The LSB of the Bus Voltage Register is 4mV, so the Bus Voltage Register would be 8000 at 32 V.
  • Using an 0.1 ohm shunt the value in the shunt voltage register would be 4000 at 400 mA (= 40 mV shunt voltage)
  • The value in the Current Register would be : Shunt Voltage Register x Calibration Register / 4096 = 4000 * 8192 / 4096 = 8000.
  • With these values, the Bus Power Register would be: Current Register * Bus Voltage Register / 5000 = 8000 * 8000 / 5000 = 12800, which is 12.8 W.

So, I can't see any overflow or other issue and therefore I would say there is no limitation to 16 V in this mode. Or have I forgotten anything?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions