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

Shunt voltage calculation for INA260 uses wrong value #95

Open
hiornso opened this issue Nov 29, 2022 · 0 comments
Open

Shunt voltage calculation for INA260 uses wrong value #95

hiornso opened this issue Nov 29, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@hiornso
Copy link

hiornso commented Nov 29, 2022

In INA.cpp (line 623):

int32_t shuntVoltage = getShuntRaw(deviceNumber);
  if (ina.type == INA260)  // INA260 has a built-in shunt
  {
    int32_t busMicroAmps = getBusMicroAmps(deviceNumber);  // Get the amps on the bus from device
    shuntVoltage         = busMicroAmps / 200;             // 2mOhm resistor, convert with Ohm's law
  } 

If it's a 2mOhm resistor, by Ohm's Law (V=IR) should this not be

shuntVoltage = busMicroAmps / 500;

rather than / 200 as it is right now?

(V = IR, so microVolts = microAmps * Ohms, so V = I * 0.002 = I / 500)

@hiornso hiornso added the bug Something isn't working label Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants