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.

ADS1015 Convert bytes to voltage

Other Parts Discussed in Thread: ADS1015

Hey there,

I want to meassure the voltage of a battery (from 3.2 to 4.2 Volts).

So I have written a Programm in Python and use a Raspberry Pi. Im using the SMBus library.

So first I write to the register:

bus.write_word_data(0x48, 0x1, 0x03c0)
I am in the +- 6.144V gain Mode single ended and in continious mode (right??).
and the I read the conversion register (2 Bytes)

bus.read_i2c_block_data(0x48, 0, 2)

So when my Battery is plugged to channel A0 with exactly 4.2V and to GND I am getting back an array with [87, 112].
us.write_word_data(add, 0x1, 0x03c0)
 How can I convert this 2 Bytes to my Voltage ( 4,2Volts)??
I tried the following:


the 2 readed bytes together 696 + 896 (in Bits) Im getting  are1592 right?

the ADS1015 is connected to %v (from raspberry Pi) so I can calculate the maximum range as followed....
5V/6.144V * 4096/2 = 1666,66
when I now calculate my Bits (1592) into a Voltage Im getting 4.776 Volts.
What am I calculating wrong?
Im looking forward receiving some support.
Kind regards Felix