Adafruit Example Code For ADS1115

Breakout boards, sensors, Drawdio, Game of Life, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Adafruit Example Code For ADS1115

Postby bcochran1 » Mon Jan 21, 2013 10:08 pm

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
# 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: 1
Joined: Mon Jan 21, 2013 9:46 pm

Re: Adafruit Example Code For ADS1115

Postby ashurbr » Mon Jan 21, 2013 11:42 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
   
tempval = (result[0] << 8) | (result[1])
    if tempval > 0x7FFF:
      return tempval - 0xFFFF
    else:
      return (result[0] << 8) | (result[1])
ashurbr
 
Posts: 8
Joined: Fri Jun 29, 2012 2:14 pm

Re: Adafruit Example Code For ADS1115

Postby ktownsend » Tue Jan 22, 2013 12:08 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: 201
Joined: Thu Nov 05, 2009 1:18 am


Return to Other Adafruit products

Who is online

Users browsing this forum: No registered users and 5 guests

Stuff to buy from the Adafruit store and links to product documentation!


New Products [113]

Raspberry Pi[81]
 
FLORA[24]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[12]
Arduino[60]
 
NETduino[14]
 
BeagleBone[23]
 
Android[6]
 
XBee[10]
More Dev Boards[30]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[39]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[9]


 
Breakout Boards[35]
LCDs & Displays[49]
Components & Parts[70]
Batteries & Power[54]
EL Wire/Tape/Panel[52]
LEDs[112]
 
Wireless[16]
Cables[66]
 
Lasers[6]
Sensors/Parts[147]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[70]
 
iDevices[13]
Tools[71]
 
Wearables[41]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[25]


 
Stickers[41]
 
Skill badges[55]
 
Books[26]
 
Circuit Playground[7]
 
Gift Certificates[4]