In the datasheet of LTC4151, there is no trace of how current and voltage computation can be done. There is only temperature measure calculation but not current or voltage.
Could you please provide the current and voltage computation formula for the same?
To find the voltage, multiply the voltage lsb step size (25mV) by the ADC reading in the voltage registers (0x02, 0x03).
To find the current, multiply the current lsb step size (20uV) by the ADC reading in the sense registers (0x00, 0x01) , then take the result and divide by the value of your sense resistor. I =V/R
Thank you and best regards,
Thank you for the solution.
Could you please explain a bit in detail taking an example so that it can be understood and also I can have a reference for my implementation?
Sure thing! Lets assume that the Vin registers contain the following:
reg 0x02 - 0x7F
reg 0x03 - 0xF0
We can do a read word of register 0x02 and get 0x7FF0. Right shift the result (>>4) to get 0x7FF.
Multiply the result with the voltage LSB step size:
0x7FF (2047) * 0.025V = 51.175V
As a sanity check you can compare this to the full-scale voltage value (0xFFF or 102.4V) .
0x7FF is about half of 0xFFF and our result of 51.175V is about half of 102.4V, so the answer makes sense.
To measure current, do the same thing using the sense registers and LSB step size of 0.000020V. When you get the result just divide by your sense resistor value, usually 0.020 Ohms, to get the current.
I hope this helped. Let me know if you have any questions.