This article explains how to add another 5 I2C buses, using spare GPIO pins, in addition to the default IC2-1 bus.
I was able to add i2c-4 bus in the /boot/config.txt file with:
Reboot and then “sudo i2cdetect -y 4” correctly show the attached ADS1115 at address 0x.48
By reading the ADS1115 datasheet at https://www.ti.com/product/ADS1115 I found on page 34, figure 42 shows how to wire the Address line to get 4 different address. In simple English, these are the required connections:
- for addr 0X48, ADDR --> GND
- for addr 0X49, ADDR --> VDD
- for addr 0x4A, ADDR --> SDA
- for addr 0x4B, ADDR --> SCL
There are more notes on page 23, section 188.8.131.52 on address selection.
So by putting 4 ADS1115 on each of 6 I2C bus, you could control 24 ADS1115 and monitor 96 single-ended analog inputs.
I have successfully tested 2 ADS1115 on I2C-1 at the same time as 1 ADS1115 on I2C-4. For my project, 4 ADS1115 on IC2-1 bus will be sufficient.
It doesn’t look like you hardware multiplexor/expanders for lots of ADS1115 fan-out.
For python control of higher numbered I2C buses, the Adafruit support folks told me to use adafruit-extended-bus package.
type: pip3 install adafruit-extended-bus
Code from my test script is:
# demo script showing use of 2 different I2C bus
# I2C-1 has devices 0X48 & 0X4b, I2C-4 has device 0X48
import board, busio, time, traceback
import adafruit_ads1x15.ads1115 as ADS
from adafruit_ads1x15.analog_in import AnalogIn
from adafruit_extended_bus import ExtendedI2C as I2C
# Create two I2C bus, default & custom #4 per /boot/config.txt
i2c_1 = busio.I2C(board.SCL, board.SDA)
i2c_4 = I2C(4) # custom #4 per /boot/config.txt
# Create the ADC objects using two I2C bus
ads10 = ADS.ADS1115(i2c_1, address=0x48)
ads13 = ADS.ADS1115(i2c_1, address=0x4b)
ads40 = ADS.ADS1115(i2c_4, address=0x48)
# Create single-ended inputs on i2c-1 bus
ch1_48_0 = AnalogIn(ads10, ADS.P0)
ch1_48_1 = AnalogIn(ads10, ADS.P1)
ch1_48_2 = AnalogIn(ads10, ADS.P2)
ch1_48_3 = AnalogIn(ads10, ADS.P3)
ch1_4b_0 = AnalogIn(ads13, ADS.P0)
ch1_4b_1 = AnalogIn(ads13, ADS.P1)
ch1_4b_2 = AnalogIn(ads13, ADS.P2)
ch1_4b_3 = AnalogIn(ads13, ADS.P3)
# Create single-ended inputs on i2c-4 bus
ch4_48_0 = AnalogIn(ads40, ADS.P0)
ch4_48_1 = AnalogIn(ads40, ADS.P1)
ch4_48_2 = AnalogIn(ads40, ADS.P2)
ch4_48_3 = AnalogIn(ads40, ADS.P3)
And it works, I can now read data from I2C-1 & I2C-4 devices