TI’s INA226 is a 36V, 16-bit, ultra-precise i2c output current/voltage/power monitor w/alert. Find parameters, ordering and quality information
www.ti.com
The nominal voltage and the nominal current through the load is 4 A and 5 V. The maximum current through the load is 5 A.
I started calculating shunt resistance by defining the peak power dissipation across the shunt resistor which is 200 mW.
Let's calculate the shunt voltage given the power is 200 mA and the max current is 5 A.
P = V x I
V = P / I
V = 200 mW / 5 A
V = 40 mV
This shunt voltage 40 mV is well within the input shunt voltage range according to datasheet INA226.
Now calculate the value of the shunt resistance given the maximum current (5 A) and the shunt voltage (40 mV)
V = I x R
R = V / I
R = 40 mV / 5 A
R = 8 m Ohm
The value of the shunt resistance is calculated as 8 m Ohm.
Now we need to calculate the Current LSB according to equation (2) on page 15/39 of the datasheet.
Current LSB = Maximum Current / 2^15
Current LSB = 5 A / 2^15
Current LSB = 152 uA/bit
Assuming the last two bits are noisy and not very stable. Or we do not want very high precision. Let's ignore the last two LSBs. We multiply by 4 to get new Current LSB.
Current LSB = 610 uA/bit
Is my calculation are ok until now ?
Now we calculate the Calibration Register value using equation (1) of the datasheet. The values of Current LSB and the R_Shunt need to be converted to A/bit and Ohm before using in equation (1)
CAL = 0.00512 / (Current_LSB x R_Shunt)
CAL = 0.00512 / (610 /1000/1000 x 8 /1000)
CAL = 1049 decimal
Is that number also correct to be written in Calibration Register ?
Two more questions.
The resolution of Shunt Voltage Register is 15 bit ? The LSB is 2.5 uV ?
Does it means that full scale reading will be 2^15 x 25 uV = 81 mV approx ?
if the resistor is specified with 200mW max, then you go the the very limit. If the airflow is limited (like the PCB put in a box) or when the ambient temperature rises you are beyond the specification. Also mind that on fully specified power the part temperature may be becomes 150°C or more. You have to decide if you do like this.
For this you need to correctly set the calibration register first.
I didn´t read the whole datasheet, but according: Electrical Characteristics --> DC Accuracy --> 1 LSB step size = 2.5uV.
This is the physical (native) resolution limit of the ADC. So if you have an analog input range of +/-40mV (using 8mOhms at 5A) you get +/-16,000 LSB native range.
The "caibration" multiplies this value. No increase in resolution, no increase in quality of information.
So the native resolution is: I = V / R = 2.5uV/LSB / 8mOhms = 312,5uA/LSB
Does it means that full scale reading will be 2^15 x 25 uV = 81 mV approx ?
This is what Electrical Characteristics --> Input --> Shunt voltage input range says.
****
did you check TI INA226 website? Evaluation board and it´s documentation. Online calcuators for INA226, source code for INA226.
No need to reinvent the wheel. TI assists you.
Klasu
--- Updated ---
Tbh. the datasheet is not the best . especially for non experienced users.
I don´t like the "register naming" (several). Like "calibration". Calibration is another word for "correction". But what will be corrected: range (gain), offset, linearity...?
--> better call it "current_range" or "current_gain" ..
And I don´t like the formulas. To be easy to use I expect them to be arranged as one nedds them to do the necessary calculations.
--> on the left should be the unknown.
Maybe there are Application notes or Design notes for the INA226 that do a better job. I did not go through all the documents.