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()
{   
    Serial.begin(9600);
    Wire.begin();
    
    sensor.init(LTC4151::L, LTC4151::L);
}

void loop()
{
    Serial.print(sensor.getLoadCurrent(0.1));
    Serial.print(" ");
    Serial.print(sensor.getInputVoltage());    
    Serial.print(" ");
    Serial.print(sensor.getADCInVoltage());
    Serial.print(" ");
    Serial.println();
} 

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.

LTC4151TestCircuit

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.

getControlRegister()

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.

Download

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

Be Sociable, Share!