1

Hello i am creating a shield for raspberry Pi 3/4 and in need of a lot of analog pins to read 30 sensors. and since the shield can only fit 5 sockets of the connector i am using i need to use 2 ADS1115 on a single shield. This brings me to a total of 12 ADS1115 to read 30 sensors. I chose this chip instead of the others because adafruit already made a library for it which makes coding a bit easier.

Can i connect 12 i2c devices on the default i2c raspberry pins? Is it possible to make the other GPIO pins as i2C?

  • basing on your response and joan, i would assume it not possible to change the pins of i2c. – Jack Oct 12 at 22:06
  • I appologize i ment add another i2c bus, i am actually aware there thara 2 i2c buses but, unfortunately i would still be lacking – Jack Oct 12 at 22:17
  • yes, i am currently looking for a 4channel alternative to the one joan gave, i already found one but it does not contain a reset function, is this feature necessary even ? – Jack Oct 12 at 22:33
  • did you ever experience your i2c slave device freezes ? – Jack Oct 12 at 22:49
3

You can connect as many devices as you want to an I2C bus as long as you can give each a unique address.

If you can't change the device address you can use an I2C multiplexor to connect up to 8 of the devices to a single I2C bus. You enable the device you want to talk to by sending a control byte to the multiplexor.

The TCA9548A is an example of a multiplexor. You can connect up to 8 TCA9548A to a single bus so can connect up to 64 ADS1115 to the Pi via the standard I2C bus.

I would not design a system based on the opinion that the software for one part may be simpler. You should consider the overall system compexity.

  • With 4 possible addresses 256 should be possible, I guess. – Tomas By Oct 12 at 22:12
  • you are actually right on your last statement. How would you approach the board design, because i was planning on a stackable shield,with the difference is just a jumper resistor connecting to the appropriate address. I was thinking on a single board 1 TCA9548A and 2 ADS1115. and since you can use 8 TCA i can have a total of 1 ADS which meets my needs, but is this setup the most efficient? – Jack Oct 12 at 22:13
1

Answer

A year ago, I spent 200+ hours messing around with Rpi3B+ stretch 100kHz I2C bus and devices. My humble dream was to connect 64+ devices, mcp23017, ads1115 etc, on a bus.

To add as many devices as possible, I struggled with I2C mux/demux, extender/expander, and also multiple I2C buses per Rpi3B+. Sadly, there are too many things that I didn't know that I didn't know, and my long, sad story short is a broken dream.

One bottleneck I always remember is that I2C has a capacitance limit of 400pF, a block I was not knowledgeable to jump over.

My conclusion is that putting more than 6 devices on a 30+ cm long, low speed I2C bus, even using CAT5/UTP wiring, is practically unstable/unreliable.

(Yes, I know, many "experts" claim that it is "doable".)

Recently I happily updated myself to Rpi4B and I have successfully tested 3 stable low speed I2C buses. So my humble dream now is 24+ mcp23017/ads1115 etc each Rpi4B.

/ to continue, ...

References

(1) how to communicate with navio2, raspberry pi 3 to ard-ltc1867 using i2c protocol to read analog data

(2) Seeed ADC (ADS1115) with Raspberry Pi 3 B+to read voltage values using python3

(3) How to connect two BME280 sensors via I2C to a Raspberry Pi 3B+ (Read my comments)

(4) P82B715 I2C-bus extender datasheet - NXP

(5) P82B715 I2C-bus Extender Learning Notes - tlfong01 2008

www.raspberrypi.org/forums search "P82B715" + "tlfong01" = 19 matches

(5.1) https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=77158&p=1352373&hilit=P82B715#p1351758

(5.2) https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=77158&p=1352373&hilit=P82B715#p1351929

(5.3) https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=77158&p=1352373&hilit=P82B715#p1352201

(5.4) https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=77158&p=1352373&hilit=P82B715#p1352292

(5.5) https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=77158&p=1352373&hilit=P82B715#p1352373

(6) Purple PCB Fabrication etc

(6.1) Oshpark and Elecrow PCB Fabrication Service

(6.2) https://oshpark.com/

(6.3) https://oshpark.com/#aboutus

(6.4) https://pcbshopper.com/osh-park-reviews/

(6.5) https://www.wellpcb.com/purple-pcb.html

(6.6) https://www.youtube.com/watch?v=HH3hoeFjS8w

(6.7) https://www.elecrow.com/pcb-manufacturing.html

(7) GY/CJMCU Purple/Blue ADS1115 I2C ADC Module - US$1.6

(7.1) https://www.aliexpress.com/w/wholesale-ads1115.html?switch_new_app=y

(7.2) https://fr.aliexpress.com/item/32590193920.html

(7.3) https://fr.aliexpress.com/item/32637401475.html

(7.4) https://fr.aliexpress.com/item/32462143150.html

Appendices

Appendix A - PCBs stacked on to proto boards

pcb stack

Appendix B - Proto boards stacked on to towers

proto board stack example

/ to continue, ...

  • There will be no problem about cable length since i am planning on stacking shields, using my custom pcb. But i am now where at your stage yet that needs 64 devices. I have read somewhere there are i2c extenders, if you have not checked that out yet – Jack Oct 14 at 15:21
  • @Jack, Ah, stacking shields is a vary complex task. My first impression is that you are over ambitious. Of course you can convenience me to change my mind, perhaps telling me a bit of your stacking shields experience. Yes, I have tried the I2C extenders, perhaps I can show you tomorrow. Cheers. – tlfong01 Oct 14 at 15:29
  • I dont know about in your place, but where i am currently living there is a place where i can let them make my pcb for about a dollar a piece. and since i design my schematics on cads anyway designing the pcb is just a little bit more effort. Though this my first time doing Raspberry pi shields, i had good results with my shield making on arduinos. I will of course start with one shield, and move on from there – Jack Oct 15 at 16:41
  • @Jack, I updated my answer with references (Ref 5) on I2C bus extender (P82B715). My experience is that even if you use short wiring, bus extenders (on top of TSX01n level shifter/buffer) are still useful (to overcome the 400pF capacitance limit). More references to come. Comments welcome. – tlfong01 Oct 16 at 7:03
  • @Jack, I don't design PCBs myself. I am sort of "system integrator", gluing PCBs together on a proto board, and then stack up protoboards to make a "tower". Perhaps I can show you my towers of proto board stack later. Using ADS1115 for example, I usually shop around AliExpress, and order from TaoBao which is much cheaper, because they directly ship from my neighbouring city ShanZhen. I usually buy from a couple of TaoBao's reputable shops selling CJMCU/GY brand "purple" PCBs. See my references 6, 7. – tlfong01 Oct 16 at 7:45
1

The ADS1115 can be configured to 4 different addresses. For this you need to connect the ADDR pin to GND, VDD, SDA or SCL, respectivelly (the Adafruit PCB has it wired to GND via a Pull-Down, so this should work as well - I only tried wiring it to VDD, which did work).

The Pi4 has up to 4 I2C busses, at least according to the specificiation. I haven't seen any software supporting busses 2-4 yet, though.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.