I am using 8 MCP23008 GPIO expanders to connect 64 total switches to a Raspberry Pi Zero W. Here is my circuit diagram:
I also designed and purchased a custom PCB for the sensors/gpio expanders
Here are a couple pictures of the real-life wiring
I essentially have a wire for SDA, SCL, 5V, and GND, and connect each of the respective pins on each of the 8 MCP23008 GPIO expanders to these wires, and these wires to the Pi. I then connect the address pins to power/ground to correspond to their location.
However, only some of the devices are detected:
pi@raspberrypi:~ $ i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: 20 21 -- 23 -- 25 -- 27 -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
This issue is not consistent! #2 disappears and reappears pretty frequently, #6 has worked once or twice but not often, and #7 disappeared once but works otherwise. This makes me fairly confident it's some kind of connection issue. That said, maybe it's correlated in that when one disappears another reappears at the exact same time sometimes?
What I've tried:
- Spent at least an hour with a multimeter measuring everything I can think of. I've tested the connection between every single IC pin and the main line it should be connected to, and the ones they shouldn't. I've turned the circuit on and measured the voltage between all the IC pins and ground (all seems correct. SCL and SDA read ~3V each). Admittedly I shorted the circuit in the process of measuring voltage a couple times here :( Doesn't seem to have affected anything, they still all work/stop working about as often as they ever did.
- Pulled #4 out of the board and completed rewired it on a breadboard with a pi - it worked fine.
- Set up i2cdetect in a loop and measured voltage of every pin while I watched it just in case me pushing on the pins was somehow reconnecting things.
I've done everything I can think of with the multimeter and probably tested every connection a dozen times now. I'm very new at soldering/electronics in general so it's not that surprising that some connection might be messed up, but I'm kind of at a loss on how to continue. How can I continue to debug this?