HAPPY LABOR DAY - ADAFRUIT IS OPEN - ALL ORDERS PLACED AFTER 11AM ET 9/4/2015 WILL NOT SHIP UNTIL TUESDAY 9/8/2015 - READ MORE!

I downloaded the Adafruit-Raspberry-Pi-Python-Code library from your github repository with the intention of using it on my newly arrived ADS1115 breakout board. I have the board connected to my Raspberry Pi Model B using the Pi T-Cobbler breakout board. I notice that python module ads1015_example.py defaults to initializing for the ADS1015 breakout board so I copied this to a new module I call ads1115_example.py. I want to initialize the ADS1115 board properly. Is this code:

Code: Select all | TOGGLE FULL SIZE
`# Initialise the ADC using the default mode (IC = ADS1115)adc = ADS1x15(ic=0x01)`

the correct way to set up an ADS1115 chip and run the example?

Thanks

Bob

bcochran1

Posts: 193
Joined: Mon Jan 21, 2013 10:46 pm

Greetings,

I have some of these modules also. And I started with the Adafruit example Python code. You will need to make several modifications to the example script and the backend script. You will need to read the TI literature on the ADS1115 that Adafruit has linked in the tutorial. Another thing that took me a while to catch is that the conversion from integer to volts is not 3 mV / bit. It is 0.1875 mV / bit when the full scale is 6.144V (16 bit converter vs 12 bit converter). It also clips at negative voltages, although the chip will read correctly small negative voltages. Just wrap the integer by subtracting 0xFFF.

Code: Select all | TOGGLE FULL SIZE
`    tempval = (result[0] << 8) | (result[1])    if tempval > 0x7FFF:      return tempval - 0xFFFF    else:      return (result[0] << 8) | (result[1])`

ashurbr

Posts: 16
Joined: Fri Jun 29, 2012 3:14 pm

Thanks for the heads up. I just pushed a quick update that should support either the 1015 or 1115 for single-ended readings now.

Kevin

ktownsend

Posts: 557
Joined: Thu Nov 05, 2009 2:18 am

Hey,

Will the erronous multiplier be corrected in the example code for Arduino as well? Cost me a while to find this post (so not *3, but * 0.1875) in the differential example.
MichelV

Posts: 9
Joined: Thu Oct 17, 2013 5:13 am

MichelV wrote:Hey,

Will the erronous multiplier be corrected in the example code for Arduino as well? Cost me a while to find this post (so not *3, but * 0.1875) in the differential example.

This should be a bit clearer in the latest code, where a bit more information was added into the example sketches.

You'll always have to set the multiplier yourself, though, since only you know what board you're using and what your gain settings are, but we've added the 16-bit multipliers into the example code as well as a reference.

ktownsend

Posts: 557
Joined: Thu Nov 05, 2009 2:18 am