I'm using 3 ADS1115 to read 10 LDR sensor on an UNO, but i'm having a problem. I currently tried using 2 module first to test my code. I've followed the wiring correctly, the ADDR pin each connected to GND & VDD.
*the 3rd ADS1115 module is on shipping as the writting of this post.
The first photo is the wiring, what gets weird is photo 2&3. The UNO only reads the first module but knows there's a second module. When pin A3 from 1st Modul ewas put to GND, the serial monitor shows ADC3 & ADC7 the same value even thoughs ADC7 was from pin A3 of 2nd module .
Below is my code.
#include <Wire.h>
#include <Adafruit_ADS1X15.h>
Adafruit_ADS1115 ads1;
Adafruit_ADS1115 ads2;
//LiquidCrystal_I2C lcd(0x27, 20, 4);
void setup()
{
ads1.begin(0x48);
ads2.begin(0x49);
Serial.begin(9600);
if (!ads1.begin()){
Serial.println("Failde to initialize ADS1");
//lcd.print("Failde to initialize ADS1");
while(1);
}
if (!ads2.begin()){
Serial.println("Failde to initialize ADS2");
//lcd.print("Failde to initialize ADS2");
while(1);
}
}
void loop()
{
int16_t adc1_0, adc1_1, adc1_2, adc1_3;
int16_t adc2_0, adc2_1, adc2_2, adc2_3;
int a = 20000;
adc1_0 = ads1.readADC_SingleEnded(0);
adc1_1 = ads1.readADC_SingleEnded(1);
adc1_2 = ads1.readADC_SingleEnded(2);
adc1_3 = ads1.readADC_SingleEnded(3);
adc2_0 = ads2.readADC_SingleEnded(0);
adc2_1 = ads2.readADC_SingleEnded(1);
adc2_2 = ads2.readADC_SingleEnded(2);
adc2_3 = ads2.readADC_SingleEnded(3);
Serial.println("-----------------------------------------------------------");
Serial.print("ADC0: "); Serial.println(adc1_0);
Serial.print("ADC1: "); Serial.println(adc1_1);
Serial.print("ADC2: "); Serial.println(adc1_2);
Serial.print("ADC3: "); Serial.println(adc1_3);
Serial.print("ADC4: "); Serial.println(adc2_0);
Serial.print("ADC5: "); Serial.println(adc2_1);
Serial.print("ADC6: "); Serial.println(adc2_2);
Serial.print("ADC7: "); Serial.println(adc2_3);
if(adc1_0 > a && adc1_1 > a && adc1_2 > a && adc1_3 > a && adc2_0 > a){
Serial.print("Hal 8");
}
else if(adc1_0 > a && adc1_1 > a && adc1_2 > a && adc1_3 > a && adc2_0 < a){
Serial.print("Hal 7");
}
else if(adc1_0 > a && adc1_1 > a && adc1_2 > a && adc1_3 < a && adc2_0 < a){
Serial.print("Hal 6");
}
delay(1000);
}
I've read a topic about the same problem from different forum, they said that it was the ADS1115 module since there are a lots of fake stuff, so idk if this is my code problem or the modules problem.



