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.

INA181: INA181A1 current sense amplifier output formula

Part Number: INA181
Other Parts Discussed in Thread: INA180

I have read everything I can find online about the INA181A1 current sense amplifier.  I have a 5mOhm current sense resistor, an ATtiny1634, a 5v power supply and would like to track the current in my circuit. 

My problem is that I can not find any reference about applying the voltage I would read from the output pin to a formula that would give me the amps drawn across the resistor at read time. 

I find tons of formula's for calculating error amounts, sensor resistance and so on.  Can anybody point me in the right direction for the formula to convert the output voltage to amps? 

Thnx much in advance.   Bill

  • Hello Bill,

    It is straightforward to convert output voltage of a current sense amplifier to amps of current at your load. Please see section 8.3.2 of the INA181 datasheet, copied below. In order to calculate Iload, simply solve for Iload in the given equation. This results in the formula below:

    Iload = (Vout - Vref) / (Rsense * Gain)

    Please keep in mind this is for an ideal condition. In a real system, various error sources will impact your measurement result as described in our video series Getting Started with Current Sense Amplifiers.

    If this answered your question, please click the button "This resolved my issue." Thanks!

    Best regards,

    Ian Williams
    Applications Manager
    Current & Magnetic Sensing

  • Thanks so much Ian. I did read the paragraph in the datasheet but was unable to apply it to my unidirectional application. I thought it could work but am so new to this topic I couldn't be sure. You did supply me with the formula that will work and thanks again so very much.

    Sincerely,
    Bill Harper
    Junction City, Oregon
  • Hi Bill,

    If you only desire unidirectional current measurement, you can ground the Vref pin which makes the Vref term in the equation go to 0. This gives you twice the output swing (and therefore dynamic range) compared to setting Vref = Vs/2 as is common for bidirectional applications.

    You can also consider the INA180, which is the unidirectional version of INA181 with Vref grounded internally.

    Best regards,

    Ian Williams
  • Sorry to bother you again Ian...

    I am struggling with this and have a some questions about the formula...

    Formula: Iload = (Vout - Vref) / (Rsense * Gain)

    Vout ?   my value read is 817.  For the purpose of the formula which of the following is Vout? 1014 value read or 1024-1014 net value read or (1024-1014)/(1024/vss[5.0]) actual voltage drop.  Should the correct choice from this list be divided by 20(gain)? 

    Rsense ?  my resistor is .5mOhm  for the purpose of the formula which of the following is Rsense?  .5 or .0005

    Gain ? my INA181A1 is documented as a 20 v/v.  I have the value set at 20 for gain in the formula.

    Iload  ?  result is in Amps or MilliAmps 

    Thanks for all your help and advice thus far.

    Bill Harper

    Junction City, Oregon

  • Thanks, OBTW, I did and do have vRef connected to ground on my testbed and planned for my application.
  • Hi Bill,

    I've made a quick calculator for you in Excel: INA181 Iload Calculator.xlsx

    I'm not sure what you mean by "value read." To calculate the load current you need to measure the INA181 output in volts with some type of multimeter (for DC) or oscilloscope (for AC or transients). If you are sampling with an analog-to-digital converter (ADC) of some sort, you'll need to convert your reading back to volts based on the properties of your ADC.

    In general for equations like this you should consider the base units, meaning volts for voltage, amps for current, and ohms for resistance.

    Best regards,

    Ian Williams

  • I posted two pics and a Excel sheet. Didn't see the excel sheet come through, hope it made it. The sheet shows the calculations not matching the circuit.
  • The entire test bed, not all in pic, is a Arduino ATMega using pin A0 to read Vout. The chip used is an INA181A1 in the pic. An external power supply at 5.02v is powering the test and sharing ground with the arduino. Once I have a sucessful test the code used will be transferred to my project which is running on an ATtiny1634U.
  • Hi Bill,

    Your PCB layout and wiring is very problematic. Please see Figure 57 from the INA181 datasheet copied below. The shunt should be located very close to the INA, with short, symmetrical PCB traces connecting from the shunt pads to the INA inputs. This makes sure that parasitic impedance from the traces is minimized and kept common. In your system you have long PCB traces and wires connecting from the shunt to the INA inputs.

    With such a tiny shunt resistance of 0.5m, all the trace and wire resistances add up and dominate the measurement. I would recommend re-doing your PCB layout to meet these requirements before doing any further debug.

    I also suggest rethinking your Rsense value. Section 9.1.2 of the datasheet has a good explanation of how to select your Rsense value and INA gain based on your range of load current and other system factors.

    Best regards,

    Ian Williams

  • Hi Ian,

    Once again, thanks so very much for your help and vast experience.

    As evidenced by my examples I sent to you I am having trouble understanding the context of the info in the datasheet.  I was unable to measure any losses on my traces and or in the wires.  I thought I had followed the info in the datasheet although not as close in distance as pictured.  I can now envision things happening that I don't have the equipment to measure.  I understand what you are saying and it is obvious you are correct.

    As I redo my test circuit I will probably have some more questions trying to understand the formulas.

    Thanks again.

    Bill

  • Hi Bill,

    Measuring fractions of milliohms is difficult without specialized circuitry, and interference from the bias currents in the circuit can further cause problems. 

    I'd be happy to review your layout if you spin the PCB.

    Best regards,

    Ian Williams