This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

INA226 - Some questions about averaging, conversions, and time

Other Parts Discussed in Thread: INA226

Hi all,

   New to the forum so please excuse me if I am not posting within the bounds of accepted practice.   Corrections appreciated.

    So, I am using he INA226 to monitor batteries in an RV using I2C to an Arduino.  I have a breadboarded version that I have successfully connected to, setup the calibration, and read the bus voltages.  After reading the documentation (High-or Low-Side Measurement, Bi-Directional CURRENT/POWER MONITOR with I 2C™ Interface) to try and determine what I should use for conversion times and average counts I stumbled a bit trying to follow the two examples given in "Averaging and Conversion Time Considerations".

    The first example reads "For example, if a system requires that data be read every 5ms, the INA226 could be configured with the conversion times set to 588μs and the averaging mode set to 4. This configuration results in the data updating approximately every 4.7ms". Questions are:

  1. Averaging mode set to 4 - Does this mean the mode bits settings are a value of b'100' (4) which would give an averaging count of 128 or does it mean the averaging mode is set to select an averaging count of 4?
  2. If I use both alternatives of interpretation I do not see how the data results are updated every 4.7ms.  This of course under the assumption that the timing is approximately calculated by: (number_of_samples * conversion_time) + final_conversion_time.

   The second example reads "The shunt voltage conversion time could be set to 4.156ms with the bus voltage conversion time set to 588μs, with the averaging mode set to 1. This configuration also results in data updating approximately every 4.7ms.".   This I can see where a value of 4.7ms is derived by number_of_samples * conversion_time (i.e. 1 * 4.156ms) plus the voltage conversion time of 588μs = 4.744 ms.

 

    Is the "ConversionReady Flag" only useful for triggered mode?  The documentation seems to suggest that but then in the same breath it states "The Conversion bit is set after all conversions, averaging, and multiplications are complete." which seems it would be used when averaging (continuous mode) is set.  My guess is that it is applicable but the documentation emphasis is on triggered or one-shot use.

    That's it for now.  Any insights would certainly be appreciated.

Kent

  • Hello Kent,

    1. The averaging mode set to 4 in that example means number of averages is set to 4 which is mode bit set to "001".

    2. If using 588us conversion time for both bus and shunt voltage conversion with average of 4 = (588us + 588 us) * 4 =~4.7ms

    Conversion ready flag is set after every conversion regardless of the mode but is most useful in the triggered mode.