This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using ADS1115 in differential mode
#4
We haven't used the python library from adafruit.

If you change line 149 in file ads1115.py
config = 0x8103 + 32*self.samples[channel] + 512*self.gain[channel] + (channel+4)*4096
into
config = 0x8103 + 32*self.samples[channel] + 512*self.gain[channel] + (channel)*4096
then you are in differential mode.
Everytihng else should work the same.

At the moment we calculate the address and the channel
to simplify this we could use two arrays
ADS1115_address = [0x48,0x48,0x48,0x48,0x49,0x49,0x49,0x49,0x4A,0x4A,0x4A,0x4A,0x4B,0x4B,0x4B,0x4B]
channel = [0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3]

Value of Input 11 (of 0-15) is on third ads1115 with the address 0x4A and the channel 3

In differential mode the channel have the follwing meaning as you already wrote
# Note you can change the differential value to the following:
# 0 = Channel 0 minus channel 1
# 1 = Channel 0 minus channel 3
# 2 = Channel 1 minus channel 3
# 3 = Channel 2 minus channel 3

everything should be fine
Reply


Messages In This Thread
Using ADS1115 in differential mode - by olewsaa - 2017-04-30, 08:41 PM
RE: Using ADS1115 in differential mode - by e-sailing - 2017-05-07, 06:22 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)