nathancheek / INA220

Lightweight Arduino library for the INA220/INA220-Q1/INA219
GNU General Public License v3.0
5 stars 3 forks source link

25 uOhm Shunt resistor #4

Open pioioTwo opened 1 year ago

pioioTwo commented 1 year ago

its possible mensure using 25uohm shunt resistor

nathancheek commented 10 months ago

Hi, do you mean 25 microohms or 25 milliohms? It should work fine with 25 milliohms. The library wasn't particularly written with microohm-level shunt resistance in mind, although with a high enough maxBusAmps value, I think it might work.

For very extreme values, you should look at lines such as the following, to make sure a useful value is still calculated: https://github.com/nathancheek/INA220/blob/e6f83c121e9534f39f96d5bdbb641015c2c0888a/src/INA220.cpp#L26

For example, if you passed in values such as maxBusAmps=5 and microOhmR=25, that line will calculate a large value which can't fit in the 16-bit calibrationRegister. But passing in a more reasonable maxBusAmps=1000 would avoid that issue.