So I want to control multiple (12) RGB LEDs using the raspberry pi. I have 6 connected to the GPIO ports on the pi itself and want 6 connected to 2 MCP23017. I cannot seem to get them both to show up when I run i2cdetect -y 0.

Only the MCP23017 connected to the pi first, the lower one in the picture, shows up at address 0x20. Running 5v through it seemed to make that one show up but I think I may need a resistor of some kind to not fry the pi.

Can someone help me figure out either

A: Which resistor I need to safely run 5V to the pi.


B: How can I get both to show up using the 3.3V pin instead of the 5V.

This is the current wiring I have from the MCP23017s to the Pi.

enter image description here

  • Controlling a 5V MCP23017 with 3V3 GPIO is out of spec for the MCP23017. It works for me but is not guaranteed. Try powering from 3V3. A clear photo of your connections is essential to diagnose the fault.
    – joan
    Feb 2, 2018 at 8:59
  • For future reference: feel free to post multiple times, each relative to a single question.
    – MaxDZ8
    May 15, 2020 at 9:31

2 Answers 2


-If you want to convert your voltage level, you can use bidirectional logic level shifter to shift your voltage level.

-Clear photo or circuit diagram of your circuit will easy to troubleshoot your problem.

  • I will take a picture of it after work tonight and upload it onto my original post. There is a lot of jumper cables coming off of it though, would it be better to leave these on or to remove them for the picture? Feb 2, 2018 at 14:25

MCP23017 is an I2C I/O expander. According to datasheet VDD, supply voltage goes from 1.8 to 5.5V while VSS is ground.

So it would be possible to run those chips at both 3.3V and 5V both have pros and cons.

Running at 5V

  • PRO: feeds directly from the (powerful) +5V rail
  • CON: you will need to level-shift your I2C (for I2C open drain it's just a matter of two mosfets)

Running at 3.3

  • PRO: native signal compatibility, "clear" data lines
  • CON: this chip can churn up to 150mA; I would advise against just feeding it using the internal Pi regulator (a cheap linear regulator from 5V might be viable)

If you run at 3.3 there will be no need to add resistors or anything to the data lines. The chips will have the same voltage levels. You'll need to run your leds at 3.3v as well which is viable.

I'm honestly surprised running at +5 made your second device appear; it seems to me it would be less likely to correctly communicate!

Your Answer

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

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