LTC4151 is a high voltage I2C current and voltage monitor. It is capable of monitoring input voltage ranging from 7V to 80V with the onboard 12-bit ADC. It can also measure the high side current and an additional external voltage with the same 12-bit ADC resolution. Besides LTC4151, LTC4151-1 and LTC4151-2 have split SDA (SDAO and SDAI) for interfacing with Opto-Isolators.

The library provided here (you can download it towards the end of the post) can be used to interface LTC4151 with an Arduino easily. Here is a quick example on how to use the library to measure the input voltage, load current and an auxiliary voltage:

#include <Wire.h>
#include <LTC4151.h>

LTC4151 sensor;

void setup()
    sensor.init(LTC4151::L, LTC4151::L);

void loop()
    Serial.print(" ");
    Serial.print(" ");
    Serial.print(" ");

The corresponding circuit setup is shown below. Note that I used an LTC4151-2 here and because I was not using its opto-isolation feature, both SDAI and SDAO pins (pin 11, 12) are tied together and serve as a single SDA pin. The current sensing resistor used is 0.1 Ohm and the auxiliary ADCIn measures the forward voltage drop of a diode. Both address pins are grounded. The SDA/SCL pull up resistors are connected on the Arduino board which is not shown here.


The available functions in this library are listed in details below:

init(byte A0, byte A1)

Initialize LTC4151 with the given I2C address.
A0 and A1 can be H (HIGH, can be tied to input voltage up to 90V directly), L (LOW) and F (FLOAT or unconnected)
and 9 different addresses are possible.

getLoadCurrent(double r), getSnapshotLoadCurrent(double r)

Get the measurement of the load current across the current sensing resistor. The snapshot version of the function makes a one-time measurement.
The input parameter r is the current sensing resistor value (in Ohms) and the returned value is in milliamps.
The full scale voltage drop is 81.92 mV across the current sensing resistor.

getInputVoltage(), getSnapshotInputVoltage()

Get the input voltage. The snapshot version of the function makes a one-time measurement.
The returned value is in Volts.

getADCInVoltage(), getSnapshotADCInVoltage()

Get the ADCIn pin input voltage. The snapshot version of the function makes a one-time measurement.
The returned value is in Volts. Note that input voltage into this pin should not exceed 5V. The full scale voltage is 2.048V.


Get the content of the control register.

setControlRegister(byte ctrlReg)

Set the content of the control register. Typically the control register does not need to be modified by user code as most functionalities have been exposed via the functions provided above.

Detailed application circuits can be found in the datasheet.


LT4151 library for Arduino: LTC4151.tar.gz
LT4151 library on GitHub

Be Sociable, Share!

18 Thoughts on “Arduino Library For LTC4151”

  • Hi. I am looking at your breadboard pic and trying to wire up my LTC4151S-2 just as you have done. Is the 0.1 Ohm resistor the one going from breadboard row 16 to the + power rail of the breadboard? Or is your 0.1 Ohm resistor the one on the LTC4151 chip from pin 1 to pin 16 (sense+ to sense-)? I look forward to trying this sesnsor on my 48V power project!

    • It’s the one between +sense and -sense (pin 1 and pin 16). The one connected to Vcc is a 1.2K resistor to create a load current.

  • Thanks for making this available! Planning to use it as part of a custom alternator controller / battery charge controller where I need to limit current as well as regulate voltage.

    Thanks much,

  • Hi kwong,

    Did you purchase the LTC4151 online? if so could you please share the link. been trying to order this from every possible place so far.


  • Hey!

    Awesome work with this IC! Got it working on Arduino. I am currently trying to integrate LTC4151 with recent versions of MSP430 especially the value line series, MSP430G2553. Can you guide me on how this can be achieved?

    • In addition to this, I had slight problems in getting the current measurements.. Can I know the rating of the below components you have used in the above circuit diagram?
      1. Between pin 9 i.e SENSE-(is that a resistor ???) and GND.
      2. the components connected to pin 16 i.e ADIN.. I see a diode there but what is the other component?

  • Thanks for this Kerry. I have the ADI(LT) Linduino One, and the LTC4151 demo board. I was looking for a way to run the demo board without using the ADI software. Your library appears to do the job :-). As a noob to Arduino programming, working with the TWI is quite a bear. Your library really helped me pick through some of the fine details.

  • Anyone else getting the same values read no matter what?

    If I bring down the input voltage below 7V or so the example code returns -1. If I then increase the input voltage to 9V I get a reading…but this reading never changes with the output current.

Leave a Reply

Your email address will not be published.