Problem with 0x4A running 4 ADS1115s

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
rbardsley
 
Posts: 62
Joined: Fri Jan 06, 2012 11:09 am

Problem with 0x4A running 4 ADS1115s

Post by rbardsley »

I am trying to run four ADS1115 boards on my Arduino Due. As I am debugging at this point, I have them wired according to the tutorial:
  • 0x48 = ADDR ⇨ GND
    0x49 = ADDR ⇨ VDD
    0x4A = ADDR ⇨ SDA
    0x4B = ADDR ⇨ SCL
I have a 4.7k pull-up resistor going from SDA to VDD and one from SCL to VDD.

When I run my code, I can get 0x48, 0x49, and 0x4B to initialize and capture data. However, 0x4A does not initialize.

Also, if I physically remove the ADS1115 board in the 0x4A location, and comment out the code for it, I can also get data to stream from the 0x4B board even if I change its address to 0x4A. I have tried swapping countless new ADS1115 boards in place. No luck.

It's as if there is something wrong with the 0x4A address in the library? Is that possible?

Many thanks.

Ryan

Code: Select all

#include <Adafruit_ADS1X15.h>

Adafruit_ADS1115 ADC48;  /* Use this for the 16-bit version */
Adafruit_ADS1115 ADC49;  /* Use this for the 16-bit version */
Adafruit_ADS1115 ADC4A;  /* Use this for the 16-bit version */
Adafruit_ADS1115 ADC4B;  /* Use this for the 16-bit version */


void setup(void)
{
  Serial.begin(115200);

  if (!ADC48.begin(0x48)) {
    Serial.println("Failed to initialize ADS48.");
    //while (1);
  }

  if (!ADC49.begin(0x49)) {
    Serial.println("Failed to initialize ADS49.");
    //while (1);
  }

//  if (!ADC4A.begin(0x4A)) {
//    Serial.println("Failed to initialize ADS4A.");
//    //while (1);
//  }

  if (!ADC4B.begin(0x4B)) {
    Serial.println("Failed to initialize ADS4B.");
    //while (1);
  }
  
}

void loop(void)
{
  int16_t ADC48_A0, ADC48_A1, ADC48_A2, ADC48_A3;
  int16_t ADC49_A0, ADC49_A1, ADC49_A2, ADC49_A3;
//  int16_t ADC4A_A0, ADC4A_A1, ADC4A_A2, ADC4A_A3;
  int16_t ADC4B_A0, ADC4B_A1, ADC4B_A2, ADC4B_A3;
  
  ADC48_A0 = ADC48.readADC_SingleEnded(0);
  ADC48_A1 = ADC48.readADC_SingleEnded(1);
  ADC48_A2 = ADC48.readADC_SingleEnded(2);
  ADC48_A3 = ADC48.readADC_SingleEnded(3);

  ADC49_A0 = ADC49.readADC_SingleEnded(0);
  ADC49_A1 = ADC49.readADC_SingleEnded(1);
  ADC49_A2 = ADC49.readADC_SingleEnded(2);
  ADC49_A3 = ADC49.readADC_SingleEnded(3);

//  ADC4A_A0 = ADC4A.readADC_SingleEnded(0);
//  ADC4A_A1 = ADC4A.readADC_SingleEnded(1);
//  ADC4A_A2 = ADC4A.readADC_SingleEnded(2);
//  ADC4A_A3 = ADC4A.readADC_SingleEnded(3);

  ADC4B_A0 = ADC4B.readADC_SingleEnded(0);
  ADC4B_A1 = ADC4B.readADC_SingleEnded(1);
  ADC4B_A2 = ADC4B.readADC_SingleEnded(2);
  ADC4B_A3 = ADC4B.readADC_SingleEnded(3);
  
Serial.print(ADC48_A0); Serial.print(", ");
Serial.print(ADC48_A1); Serial.print(", "); 
Serial.print(ADC48_A2); Serial.print(", "); 
Serial.print(ADC48_A3); Serial.print(", "); 

Serial.print(ADC49_A0); Serial.print(", ");
Serial.print(ADC49_A1); Serial.print(", "); 
Serial.print(ADC49_A2); Serial.print(", "); 
Serial.print(ADC49_A3); Serial.print(", "); 

//Serial.print(ADC4A_A0); Serial.print(", ");
//Serial.print(ADC4A_A1); Serial.print(", "); 
//Serial.print(ADC4A_A2); Serial.print(", "); 
//Serial.print(ADC4A_A3); Serial.print(", "); 

Serial.print(ADC4B_A0); Serial.print(", ");
Serial.print(ADC4B_A1); Serial.print(", "); 
Serial.print(ADC4B_A2); Serial.print(", "); 
Serial.print(ADC4B_A3); Serial.println(); 

}

User avatar
adafruit_support_bill
 
Posts: 88037
Joined: Sat Feb 07, 2009 10:11 am

Re: Problem with 0x4A running 4 ADS1115s

Post by adafruit_support_bill »

I have a 4.7k pull-up resistor going from SDA to VDD and one from SCL to VDD.
Those are unnecessary, since the boards already have pullups on them.
Also, if I physically remove the ADS1115 board in the 0x4A location, and comment out the code for it, I can also get data to stream from the 0x4B board even if I change its address to 0x4A.
You may just have too many pullups on the bus. Try removing your 4.7K pullups.

User avatar
rbardsley
 
Posts: 62
Joined: Fri Jan 06, 2012 11:09 am

Re: Problem with 0x4A running 4 ADS1115s

Post by rbardsley »

Thanks for that pull-up suggestion. I removed them, and have the same issue.

Update:

I can get my system to output data from all 4 channels on 3 of the 4 ADS1115s when I physically remove the 0x4A breakout board from my breadboard. I then have the following boards connected:
  • 0x48 = ADDR ⇨ GND
    0x49 = ADDR ⇨ VDD
    0x4A = physically removed from breadboard
    0x4B = ADDR ⇨ SCL
Now, if I take the wire from SCL on the 0x4B board (happily streaming data) and remove it, the data stream stops. There are then two boards at the 0x48 address.

If I connect that wire from the 4th board's ADDR pin to SDA (now moving it to the 0x4A address) the data stream starts again. However, NOTHING is pointing to the 0x4A address in my code. It's as if the breakout board internals don't allow me to set 0x4A as an address. I have swapped breakout boards into the same slot and they all exhibit the same behavior.

I am using an Arduino Due. That's the only difference I can think of at this point.

User avatar
adafruit_support_bill
 
Posts: 88037
Joined: Sat Feb 07, 2009 10:11 am

Re: Problem with 0x4A running 4 ADS1115s

Post by adafruit_support_bill »

Please post some photos showing your soldering and connections. Also please post the code that you are using.

User avatar
rbardsley
 
Posts: 62
Joined: Fri Jan 06, 2012 11:09 am

Re: Problem with 0x4A running 4 ADS1115s

Post by rbardsley »

IMG_7846 (2).jpeg
IMG_7846 (2).jpeg (232.78 KiB) Viewed 88 times
Overall circuit layout with the Due and 4 x ADS1115 breakout boards.

IMG_7847 (2).jpeg
IMG_7847 (2).jpeg (201.23 KiB) Viewed 88 times
Close-up of I2C output.

IMG_7848 (2).jpeg
IMG_7848 (2).jpeg (222.51 KiB) Viewed 88 times
Close-up of I2C connections to breadboard.

User avatar
rbardsley
 
Posts: 62
Joined: Fri Jan 06, 2012 11:09 am

Re: Problem with 0x4A running 4 ADS1115s

Post by rbardsley »

IMG_7850 (2).jpeg
IMG_7850 (2).jpeg (202.55 KiB) Viewed 86 times
Overall layout of 4 x ADS1115 boards.
IMG_7851 (2).jpeg
IMG_7851 (2).jpeg (219.06 KiB) Viewed 86 times
Close-up of 0x48 wiring

User avatar
rbardsley
 
Posts: 62
Joined: Fri Jan 06, 2012 11:09 am

Re: Problem with 0x4A running 4 ADS1115s

Post by rbardsley »

IMG_7852 (2).jpeg
IMG_7852 (2).jpeg (152.58 KiB) Viewed 85 times
Close-up of 0x49

IMG_7853 (2).jpeg
IMG_7853 (2).jpeg (151.94 KiB) Viewed 85 times
Close-up of 0x4A

IMG_7855 (2).jpeg
IMG_7855 (2).jpeg (131.21 KiB) Viewed 85 times
Close-up of 0x4B

User avatar
adafruit_support_bill
 
Posts: 88037
Joined: Sat Feb 07, 2009 10:11 am

Re: Problem with 0x4A running 4 ADS1115s

Post by adafruit_support_bill »

Looks like you are powering the ADS1115s with 5v. The Due is a 3.3v board and the pullups to 5v are potentially damaging to the Due.

You can either power the ADS1115s from 3.3v (which will limit the maximum measurable voltage to 3.3v also). Or you can use an i2c level shifter. https://www.adafruit.com/product/757

User avatar
rbardsley
 
Posts: 62
Joined: Fri Jan 06, 2012 11:09 am

Re: Problem with 0x4A running 4 ADS1115s

Post by rbardsley »

Update:
  • When I run my code on the Arduino Due, the ADS1115 board can't tell the difference between 0x4A and 0x4B when physically changing the ADDR pin from SDA to SCL.

    When I run the same code on the Arduino Mega, it works perfectly. Changing the ADDR pin between SCL and SDA allows me to select 0x4A or 0x4B as expected.
Conclusion:

When using and Arduino Due and a single ADS1115 board, ADDR ⇨ SDA = 0x4B and ADR ⇨ SCL = 0x4B. I can reproduce this bug across ADS115 breakout boards. This seems to be a bug with the 0x4A address of the ADS1115 running on an Arduino Due.

User avatar
adafruit_support_bill
 
Posts: 88037
Joined: Sat Feb 07, 2009 10:11 am

Re: Problem with 0x4A running 4 ADS1115s

Post by adafruit_support_bill »

Have you tried running the ADS1115s at 3.3v as suggested above? I2C on the Due has always been a weak-point. But I've never seen an addressing problem with it.

User avatar
adafruit_support_bill
 
Posts: 88037
Joined: Sat Feb 07, 2009 10:11 am

Re: Problem with 0x4A running 4 ADS1115s

Post by adafruit_support_bill »

Well I take that back. Seems like someone has reported the identical issue on the Arduino forum. https://forum.arduino.cc/t/ads1115-with ... due/853689

As I said, i2c on the Due has historically had many issues. It was one of the main reasons that release 1.0 of the IDE was delayed for many months.

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”