jarzebski / Arduino-INA226

INA226 Bi-directional Current/Power Monitor Arduino Librar
MIT License
48 stars 46 forks source link

uA Accuracy #10

Open Rupesh-Jogani opened 3 years ago

Rupesh-Jogani commented 3 years ago

To get the maximum accuracy for Current and Power, the following equation should be used. Current_LSB = (float)((Maximum Expected Current)/(2^15))

I used it to measure 4 to 20mA current with this and I was able to achieve the accuracy of +/-2 uA which when compared to the readings on Fluke 787B.

N0ury commented 1 year ago

Do you mean replacing

    currentLSB = (uint16_t)(minimumLSB * 100000000);
    currentLSB /= 100000000;
    currentLSB /= 0.0001;
    currentLSB = ceil(currentLSB);
    currentLSB *= 0.0001;

with currentLSB = (float)(iMaxExpected / 2^15)

jarzebski commented 1 year ago

Hi, can you explain proposed change?