Measure Low DC Current with an INA169 and Arduino Uno R3

Created:  
Updated:   05Aug2024   04:15:30   UTC 2024-08-05T04:15:30Z
Rating:   (0 reviewsThis article has not been rated yet)

This tutorial shows how to use the INA169 current sensor module to measure low current in milliamps with the Arduino Uno R3. The output of the INA169 module is an analog voltage that can be read with the Analog-to-Digital Converter (ADC) of the Arduino.

SparkFun has a breakout board for the INA169 IC with external circuitry, onboard shunt and load resistors, and pin through holes to make it easy to interface to. Generic boards with the same board layout and components are also available. The SparkFun and generic boards come with a high shunt resistance of 10Ω and output load resistance of 10kΩ that provides a low current sense range of 2.5mA to 39mA, but these resistances can be easily modified to allow higher input current. The current resolution can also be modified by changing the Arduino ADC range or using an external ADC with a higher resolution.

INA169 Module

SparkFun has a breakout board (SEN-12040) for the INA169 current sensor shown in the figure below. For this board they've selected a shunt resistance (RS) of 10Ω, a load resistance (RL) of 10kΩ, with a current sense range of 2.5mA to 39mA. A hookup guide for this board is available on their website.

SparkFun Current Sensor Breakout - INA169
SparkFun INA169 Current Sensor Breakout Specs
Feature Description
IC Info INA169 High-Side Measurement Current Shunt Monitor by Burr-Brown (BB) from Texas Instruments (TI)
Interface
  • Input voltage range +2.7V to +60V DC
  • Output voltage is 0.1V per milliamp where the voltage range limited by the lesser of IC power supply voltage V+ and VIN+.
Shunt Resistor RS = 10Ω, 1% tolerance
Load Resistor RL = 10kΩ
Response Time
  • Bandwidth (typical): 440kHz with RL = 10kΩ
  • Settling Time (typical): 2.5μs with RL = 10kΩ
Operating Voltage +2.7V to +60V DC. Power supply can be common or independent of load supply.
Operating Temperature -40°C to +85°C
Docs

The SparkFun INA169 board layout is given below. PTHPin Through Holes are used for powering the board VCC and GND, the voltage across the shunt resistor VIN+ and VIN-, and the output VOUT. PTHs for RS and RL are also included to allow them to be replaced or modified (adding a resistor in parallel) with different values. A bypass capacitor of 0.1μF is included to reduce noise from the power supply to the IC.

SparkFun INA169 Current Sensor Board Layout
SparkFun INA169 Pin Functions
Pin Name Function
VIN+ & VIN- Positive and negative input voltage.
Range: +2.7V to +60V DC
VCC Voltage supply for the INA169 IC
+2.7V to +60V DC
VOUT Output analog voltage 0.1V per milliamp
Voltage range limited by the lesser of the IC power supply voltage VCC and VIN+.
GND Common Ground

The load current IS measured by the module is drawn from load power supply through shunt resistor RS. The output load resistor RL converts the output current to a voltage VO at the VOUT pin. This output voltage VO is given in the equation below, where the constant 1/1kΩ (1000μA/V) is the transconductance of the INA169 IC.

INA169 Output Voltage Equation

The shunt voltage VIN = (VIN+) - (VIN-) and power supply voltage VCC limits the maximum possible output voltage swing. The maximum output voltage compliance (VOUTMAX) from the INA169 Datasheet is given below as the minimum of VCC - 0.7V - VIN and (VIN-) - 0.5V, whichever is lower.

INA169 Max Output Voltage Equation

The shunt current IS can be computed from the output voltage by the equation below.

INA169 Shunt Current Equation

Arduino Hookup

To power the INA169 module, connect the Arduino 5V pin to the INA169 VCC and the Arduino GND pin to the INA169 GND. To read the output voltage level of the INA169 module, you need to connect the INA169 VOUT pin to one of the Arduino's analog inputs, such as A0.

The external load in this example is a 150Ω resistor that is powered by the Arduino from the 3.3V pin. This will provide a current through the load resistor of 5V/(150Ω + 10Ω) ≈ 20.6mA. You can pick a different load resistor value if you want as long as the current is within the range of 2.5mA to 39mA (the Pico's 3.3V rail can provide up to 390mA of current). The load resistor can be in the range of
(3.3V/39mA) - 10Ω ≈ 75Ω
to
(3.3V/2.5mA) - 10Ω ≈ 1.31kΩ.
The current needs to be measured on the high-side, so the 3.3V Arduino pin is connected directly to the INA169 V+ pin and the V- pin is connected to the load resistor and then to ground.

Arduino INA169 Hookup

Arduino Code

The Arduino code sketch provided below reads the A0 pin at a sampling interval of a half a second (500 milliseconds). It assumes the ADC is using a 5V voltage reference (ref_voltage) and converts the ADC counts from 0 and 1023 to 0V and 5V. The voltage is converted to current in milliamps and printed to the serial monitor. The USB port on the Arduino Uno R3 board is connected to a computer to transfer the data serially and display the results on the Arduino IDE console.

read_ina169.ino
            

The output of measuring the current from a 3.3V source through a 10Ω shunt and 150Ω load resistor is provided below.

read_ina169.ino Console Output
            

Input Current Range

The INA169 output error increases once the voltage across RS dips below about 25mV as shown in the plot below from the INA169 datasheet. This sets a lower bound for the input current of 25mV/10Ω = 2.5mA.

INA169 Output Error Plot at 25°C

The upper bound of the input current is determined by the maximum output voltage (VOUTMAX) that depends on both the shunt voltage VIN = (VIN+) - (VIN-) and power supply voltage VCC.

INA169 Max Output Voltage Equation

There are two conditions here based on the relationship between VCC and VIN+:

  • If VIN+ ≥ VCC - 0.2V, then the max input current is IS(max) = (VCC - 0.7V)/(110Ω).
  • If VIN+ < VCC - 0.2V, then the max input current is even lower with IS(max) = ((VIN+) - 0.5V)/(110Ω).

For this tutorial setup, VCC = VIN+ = 5V, so the maximum input current is IS(max)= (5V - 0.7V)/(110Ω) = 39mA.

In addition to choosing VCC and VIN+, the max input current range depends the value of the shunt resistor (RS). The default shunt resistance on the SparkFun board is 10Ω, but can be modified to allow lower/higher input current. The table below shows how the current sense range changes with different RS values. The power rating of the resistor also needs to be considered to ensure it can handle the current range.

Modifying RS
RS Current Sense Range
10Ω 2.5mA - 39mA
25mA - 390mA
0.1Ω 250mA - 3.9A

There are pin through holes on the board to solder a parallel resistor across RS in order to reduce the overall shunt resistance. For example, a 1Ω parallel resistor gives an effective shunt resistance of 0.9Ω, which changes the input current range to 27.8mA - 472mA. In order to increase the shunt resistance to measure lower input current than 2.5mA, the 10Ω SMDSurface Mount Device resistor must be desoldered and replaced with a different resistor lower than 10Ω.

Decreasing INA169 Shunt Resistance

Another way of changing the input current range is to modify the 10kΩ load resistor (RL) to adjust the output voltage swing. There are pin through holes on the board to solder a parallel resistor across RL in order to reduce the overall load resistance. For example, if you inserted a parallel resistor of 1kΩ, then the effective load resistance lowers to RL = (10kΩ·1kΩ)/(10kΩ + 1kΩ) ≈ 0.91kΩ.

Decreasing INA169 Load Resistance

Modifying the load resistor RL changes the output voltage swing, but it must be below the maximum output voltage compliance (VOUTMAX) from the INA169 Datasheet.

INA169 Output Load Resistor Equation

Solving the inequality for the shunt current IS gives the maximum input current in terms of VCC and RL.

INA169 Max Input Current with Load Resistor Equation

For the default RL = 10kΩ using VCC = 5V, the maximum input current is IS ≤ 39mA. If RL is lowered to 1kΩ, then the maximum input current is increased to IS ≤ 215mA. However, lowering RL to 1kΩ also decreases the output voltage swing from 3.91V to 2.15V max, so you will lose some resolution (from 0.05mA to 0.5mA).

Modifying the load Resistor RL instead of shunt resistor RS is a more convenient way of changing the input current range because you can use resistors with higher values which are easier to find and less expensive.

Resolution

The resolution of the SparkFun INA169 Module is 100mV/mA. The Arduino Uno R3 10-Bit ADC has a resolution of 5V/210 ≈ 5mV, which corresponds to 0.05mA of current resolution. This is usually sufficient for most applications, but if the current range is increased by modifying RS, then the current resolution will decrease. For example, an RS = 0.1Ω with a current sense range of 250mA - 3.9A gives an INA169 resolution of 3.9V/3.9A = 1V/A that corresponds to about 5mA of current resolution using the Arduino ADC. If you need to improve this resolution, there are a couple of ways to do this.

  1. Reduce the Arduino ADC range closer to the INA169 3.9V max output using a reference voltage.
  2. Use an external ADC module with a higher resolution, such as the ADS1115 16-Bit ADC.
Adafruit ADS1115 16-Bit ADC

Using an ADS1115 ADC module has several advantages.

  • Higher bit resolution
  • Built-in voltage reference (no need for calibration)
  • Programmable gain to change the ADC input voltage range and increase resolution
  • Up to 4 single-channel inputs or two differential inputs
  • Can be used with other devices with I2C, such as a different microcontroller, SBC, or USB Serial Adapter.
  • Wider input range based on the ADC supply range from 2.0V to 5.5V (a bidirectional Logic Level Converter for I2C may be needed when using a 3.3V microcontroller with the ADC supplied by 5V),
  • Low power consumption of 150µA in continuous mode and can be put into sleep mode between measurements with low current consumption of 0.5μA.

Conclusion

This tutorial covered how to use the INA169 current sensor module to measure low current in milliamps with the Arduino Uno R3. The input current range and resolution of the INA169 can by changed with some modifications.

The input current is limited to the range of 2.5mA to 39mA with the default shunt resistor (RS) of 10Ω and load resistor (RL) of 10kΩ on the SparkFun INA169 module, but by adding a resistor in parallel to either the shunt or load resistors allows for higher input current.

The resolution can be improved by either reducing the Arduino ADC range closer to the INA169 3.9V max output using a reference voltage or you can use an external ADC module with a higher resolution.

The precision and accuracy of measurements can be improved by calibrating the Arduino ADC, using an external precision voltage reference (see Measuring DC Voltage with an Arduino Uno R3 for more details), or by using an external ADC such as the ADS1115 with higher resolution and a built-in voltage reference.

Related Content

Products

INA169 Current Sensor Products

Created:   12Apr2023   21:46:48   UTC 2023-04-12T21:46:48Z
Updated:   07May2024   23:46:11   UTC 2024-05-07T23:46:11Z

The INA169 High-Side DC Current Shunt Sensor modules output an analog voltage proportional to the input current that goes through a shunt resistor.

  • SparkFun and Generic Modules (3.5mA to 35mA)
  • Adafruit and Generic Modules (0.5A to 5A)

ATmega328P Uno R3 Board Products

Created:   27Jul2023   18:12:25   UTC 2023-07-27T18:12:25Z
Updated:   03Sep2024   22:05:38   UTC 2024-09-03T22:05:38Z

Processor:
8-bit 16MHz AVRAVR microcontrollers derives its name from its developers and stands for, Alf-Egil Bogen and Vegard Wollan RISC microcontroller, and is also known as Advanced Virtual RISC. ATmega328P (max speed 20MHz)
Memory:
32KB Flash, 1KB EEPROMElectrically Erasable Programmable Read-Only Memory, and 2048 bytes SRAMStatic Random Access Memory
Interface:
14x Digital I/OInput/Output with 6x PWMPulse-Width Modulation, 8 channel 10-bit ADCAnalog-to-Digital Converter (ADC, A/D, or A-to-D), and UARTUniversal Asynchronous Receiver-Transmitter/I2CInter-Integrated Circuit. Also referred to as IIC or I2C./SPISerial Peripheral Interface
Boards:
  • Arduino Uno R3
  • Compatible Boards: SparkFun Redboard, Adafruit Metro 328, Elegoo, SunFounder, DFRobot DFRduino

ATmega328P Microcontroller Products

Created:   11Dec2022   19:49:54   UTC 2022-12-11T19:49:54Z
Updated:   04Sep2024   02:03:04   UTC 2024-09-04T02:03:04Z

Processor:
8-bit 16MHz AVRAVR microcontrollers derives its name from its developers and stands for, Alf-Egil Bogen and Vegard Wollan RISC microcontroller, and is also known as Advanced Virtual RISC. ATmega
Memory:
32KB Flash, 1KB EEPROMElectrically Erasable Programmable Read-Only Memory, and 2048 bytes SRAMStatic Random Access Memory
Interface:
Up to 23x Digital I/OInput/Output with 6x PWMPulse-Width Modulation, 8 channel 10-bit ADCAnalog-to-Digital Converter (ADC, A/D, or A-to-D), and UARTUniversal Asynchronous Receiver-Transmitter/I2CInter-Integrated Circuit. Also referred to as IIC or I2C./SPISerial Peripheral Interface
Boards:
  • Arduino Uno R3, Nano, Pro Mini
  • SparkFun RedBoard, Pro Mini
  • Adafruit Pro Trinket, Metro, Metro Mini

Voltage Reference Products

Created:   26May2024   21:29:57   UTC 2024-05-26T21:29:57Z
Updated:   27May2024   03:59:16   UTC 2024-05-27T03:59:16Z

  • LM4040 Modules
  • AD584 Modules

Analog-to-Digital Converter (ADC) Products

Created:   14Aug2022   21:16:24   UTC 2022-08-14T21:16:24Z
Updated:   14May2024   05:51:53   UTC 2024-05-14T05:51:53Z

  • 10-Bit, 12-Bit, 16-Bit, and 24-Bit ADCs
  • ICs and Modules

Article Rating

Sign in to rate this article

Sign In


(0) Comments

Sign in to leave a comment

Sign In