Skip to content

Shunt voltage calculation for INA260 uses wrong value #95

@hiornso

Description

@hiornso

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)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions