ADS_1115 sampling rate

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

ADS_1115 sampling rate

Postby ptc » Fri Jan 25, 2013 5:51 pm

Hi,

I am trying to use the ads1115 adc to collect data from three inputs. I am using the ads1x15 library for Arduino. Using the example code, I get ~38 SPS. How do I increase the sampling rate?

thanks,
ptc
 
Posts: 3
Joined: Sat Dec 15, 2012 5:03 pm

Re: ADS_1115 sampling rate

Postby adafruit_support_mike » Fri Jan 25, 2013 11:00 pm

You'll want to use the function ADS1115::setRate(). Send it one of the following values from the header file:

Code: Select all
#define ADS1115_RATE_8              0x00
#define ADS1115_RATE_16             0x01
#define ADS1115_RATE_32             0x02
#define ADS1115_RATE_64             0x03
#define ADS1115_RATE_128            0x04 // default
#define ADS1115_RATE_250            0x05
#define ADS1115_RATE_475            0x06
#define ADS1115_RATE_860            0x07
When you void a product warrany, you give up your right to sue the manufacturer if something goes wrong and accept full responsibility for whatever happens next. And then you truly own the product.
User avatar
adafruit_support_mike
 
Posts: 1697
Joined: Thu Feb 11, 2010 1:51 pm

Re: ADS_1115 sampling rate

Postby ptc » Sat Jan 26, 2013 2:50 am

Thank you for the quite reply.
However, I did not see this function in the ADS1X15 library that I downloaded from https://github.com/adafruit/Adafruit_ADS1X15. Is there a newer version?
ptc
 
Posts: 3
Joined: Sat Dec 15, 2012 5:03 pm


Re: ADS_1115 sampling rate

Postby ptc » Sat Jan 26, 2013 1:11 pm

Code: Select all
#include <Wire.h>
#include <Adafruit_ADS1015.h>

Adafruit_ADS1115 ads1115;

void setup(void)
{
  Serial.begin(115200);
  Serial.println("Hello!");
 
  Serial.println("Getting single-ended readings from AIN0..3");
  Serial.println("ADC Range: +/- 6.144V (1 bit = 3mV)");
  ads1115.begin();
}

void loop(void)
{
  int16_t adc0, adc1, adc2, adc3;
    adc0 = ads1115.readADC_SingleEnded(0);
    adc1 = ads1115.readADC_SingleEnded(1);
    adc2 = ads1115.readADC_SingleEnded(2);
    Serial.print(millis());
    Serial.print(",");
    Serial.print(adc0);
    Serial.print(",");
    Serial.print(adc1);
    Serial.print(",");
    Serial.print(adc2);
    Serial.println(",");
}
ptc
 
Posts: 3
Joined: Sat Dec 15, 2012 5:03 pm

Re: ADS_1115 sampling rate

Postby adafruit_support_bill » Sat Jan 26, 2013 4:39 pm

You have about 18mS worth of serial printing in your loop. That will slow things down a bit.
User avatar
adafruit_support_bill
 
Posts: 16617
Joined: Sat Feb 07, 2009 9:11 am

Re: ADS_1115 sampling rate

Postby retrolefty » Sat Feb 02, 2013 11:56 am

adafruit_support wrote:You have about 18mS worth of serial printing in your loop. That will slow things down a bit.


Even with the fully buffered interrupt driven serial transmission that the arduino hardware serial now has?

Lefty
retrolefty
 
Posts: 11
Joined: Tue Feb 17, 2009 9:28 pm


Return to Other Arduino products from Adafruit

Who is online

Users browsing this forum: No registered users and 2 guests

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


New Products [114]

Raspberry Pi[82]
 
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]