Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are the considerations for setCalibration_16V_400mA() correct? #57

Open
wollewald opened this issue Mar 24, 2024 · 0 comments
Open

Are the considerations for setCalibration_16V_400mA() correct? #57

wollewald opened this issue Mar 24, 2024 · 0 comments

Comments

@wollewald
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant