RobTillaart / INA3221_RT

Arduino library for the I2C INA3221 3 channel voltage and current sensor.
MIT License
12 stars 1 forks source link

Hardware versions #5

Closed TobiasPSP closed 4 months ago

TobiasPSP commented 5 months ago

Hi Rob, thanks a lot for your work! Which breakout board are you using? There seem to be new hardware revisions available that can measure different voltages now for different power supplies.

The new boards have two GND pins (old boards had GND, POW, VPV) but I can't seem to wrap my head around what they do or how to wire the board up to measure different voltages with different power supplies.

If you feel my question to be inappropriate, please disregard and close the issue. I was hoping you can provide some schematics. I'd love to work with your code.

Many thanks.

RobTillaart commented 5 months ago

Thanks for your question. I used a breakout ordered at tinytronics .nl to write the library. Think there might be a schematic on their website. Hope that helped.

RobTillaart commented 5 months ago

@TobiasPSP

This is the schema from

image

TobiasPSP commented 5 months ago

Thank you so much Rob. This helps a lot. I think I figured out the wiring now, so I am ready to play with your code. Is there anything specific to look at or try that would help you?

RobTillaart commented 5 months ago

Nothing specific, like to know if it works ir not, which board you use, as it is good to know if some board has special needs.

RobTillaart commented 5 months ago

A test I did in the beginning is to measure the current of the biard itself. Just put one "port" between its own power supply.

What might be an interesting measurement, is to put all three in series to see if they measure the same.

Another test is putting them in parallel to see if a larger current can be measured. Would extend the working range of the board.

Drawback is that one cannot measure all 3 ports exact simultaneously but probably close enough.

TobiasPSP commented 5 months ago

Great suggestions, will do.

RobTillaart commented 5 months ago

theoretical thoughts

What would be interesting in the parallel setup is how to do the math.

Scenario1: measure one and multiply by 3 (assumes the same shunt value). Would be no different than having a parallel shunt (array) of the right value. Probably fastest.

Scenario2: measure all and add them, this might allow to catch the tiny differences in shunts. So it might be just a bit more accurate assuming the current is stable (3 measurements take 3x as long in time)

Interesting would be to see if the calculated current differs from using only one port. NB the effective shunt is 3x as low so the overall Resistance is slightly less, which should result in a slightly higher current. Depending on the load R this might not be visible, however for small R's the parallel mode might improve the measurement.

Question Would it add value to have a function that given the current through the shunt would calculate the resistance of the load?

float calcLoadResistance(channel)
{
  return busVoltage(channel) / current(channel);
}
RobTillaart commented 5 months ago

image

NB the effective shunt is 3x as low so the overall Resistance is slightly less, which should result in a slightly higher current. Depending on the load R this might not be visible, however for small R's the parallel mode might improve the measurement.

2nd thought, the shuntVoltage and BusVoltage would change too.

RobTillaart commented 5 months ago

@TobiasPSP Did you find time to do the tests yet? Otherwise I will just close the issue.

RobTillaart commented 4 months ago

@TobiasPSP As there is no activity, I will close this issue, Feel free to reopen if needed.