🐍 CircuitPython is the easiest way to program microcontrollers now celebrating over 200 boards!🐍
0

How to use more than one Adafruit I2C board
Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Please be positive and constructive with your questions and comments.

How to use more than one Adafruit I2C board

by tastybrains on Tue Apr 06, 2021 8:00 pm

Hello,

I purchased the Adafruit INA260 High or Low Side Voltage, Current, Power Sensor (prod) and the Adafruit 16-Channel 12-bit PWM/Servo Shield (prod) They both need the SCL and SDA pins. How should I go about connecting them both?

Thank you,
tb

tastybrains
 
Posts: 20
Joined: Sun Sep 03, 2017 11:39 am

Re: How to use more than one Adafruit I2C board

by dastels on Tue Apr 06, 2021 10:36 pm

I2C is a bus so just connect all the boards's SCL pins together, SDA pins together, power pins together, and ground pins together.

All you need to ensure is that each board you connect has a different I2C address. Some devices/boards will let you change its address to avoid collisions. See the associated product tutorial guides for details.

Dave

dastels
 
Posts: 5968
Joined: Tue Oct 20, 2015 3:22 pm

Re: How to use more than one Adafruit I2C board

by tastybrains on Tue Apr 06, 2021 11:07 pm

Hello Dave,

That easy huh? Thanks for the info - I'll give it a go! I had seen some tutorials on modifying the boot.txt file to make multiple devices work so it seemed harder.

thanks,
tb

tastybrains
 
Posts: 20
Joined: Sun Sep 03, 2017 11:39 am

Re: How to use more than one Adafruit I2C board

by tastybrains on Wed Apr 07, 2021 9:16 pm

After getting some strange behavior, I found that both Adafruit products (out of the hundreds listed of course) operate on the same address as listed here

Code: Select all | TOGGLE FULL SIZE
ubuntu@localhost:~$ sudo i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: 40 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: 70 -- -- -- -- -- -- --


I don't know what the 70 is, but 40 is the servo controller according to that list . I'm going to try and figure out how to change one of their addresses

tastybrains
 
Posts: 20
Joined: Sun Sep 03, 2017 11:39 am

Re: How to use more than one Adafruit I2C board

by dastels on Wed Apr 07, 2021 10:04 pm

Both of those devices have an adjustable address, so they won't present a problem.

See the guides: https://learn.adafruit.com/adafruit-ina260-current-voltage-power-sensor-breakout and https://learn.adafruit.com/adafruit-16-channel-pwm-slash-servo-shield/.

Dave

dastels
 
Posts: 5968
Joined: Tue Oct 20, 2015 3:22 pm

Re: How to use more than one Adafruit I2C board

by tastybrains on Thu Apr 08, 2021 10:38 am

thanks, dastels. I soldered the pads together and and the address updated

(env) ubuntu@rpi4v7:~/workspace/scanner$ sudo i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- 48 -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: 70 -- -- -- -- -- -- --

problems solved.

tastybrains
 
Posts: 20
Joined: Sun Sep 03, 2017 11:39 am

Please be positive and constructive with your questions and comments.