I am building something with raspberry pi. I am using the 16x32 led matrix as well as the port expander (MCP23017). Both use the SDA and SCL pins. I am having trouble hooking it up. I realize this may be a rookie question - but is this possible?

I have my MCP23017 on a breadboard. Anytime I put in the SDA/SCL pin for the matrix into the appropriate row it makes it so the MCP is no longer detected. Any help would be appreciated. Thanks!

  • I don't understand what you are doing. Could you add one or more clear photos of the connections. I2C is a bus. You connect all the SDA pins to the Pi SDA pin, and all the SCL pins to the Pi SCL pins.
    – joan
    Mar 25, 2019 at 8:16
  • Hello. Can you clarify what aspect you're having trouble with? Is it the physical wiring or getting the two devices to work together? As you probably know I2C uses an address for each device that must be unique on the bus. Do you know what the addresses of the two devices you're trying to connect are? If they are the same then usually one or more of the devices will have a method of choosing a different one to avoid clashes. For example the MCP23017 uses pins A0-2 to let you select one of eight different addresses. Mar 25, 2019 at 12:36
  • Abandoned post by Unregistered user.
    – Milliways
    May 27, 2023 at 6:09

1 Answer 1


You wire SDA (pin#3 on your RPi) to SDA on the first device, you wire from that device to SDA on the second device. Same for SCL (pin#5 on the RPi). Same for 5V (pin#2) and GND (pin#6). So it ends up like a string of Xmas tree lights.

You can do it on a solderless breadboard with SDA connected to one row and SCL connected to another. The important thing is all devices connect SDA & SCL in parallel.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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