Which input terminal is which on an MCP23008

OK folks, I just screwed up (AGAIN!). I have two versions of a specific firmware file, one of which has been running for a long time on a Particle Electron that is plugged into an NCD MCP23008 relay board. The only difference between the two versions is the input terminal that my code checks, i.e. “status = controller.readInputStatus(2)” and “status = controller.readInputStatus(3)”.

I just replaced the Electron with a Boron and had to upload one of the two versions of code to it, but I can’t remember which input I’ve been monitoring! Note that one terminal is wired to a float switch which, right now, is “open”. If it was closed, I’d see status equal to 1 if I had picked the correct terminal, but I’m just seeing zeros at the moment. I looked at the PCB and the terminal that is wired to the float switch (white wire in the attached photo) is labeled “GP4” (or is it “GB4”?), so that doesn’t help me figure out whether that is terminal 2 or 3. Can anyone help?

BTW, the black wire is connected to “GND”, not “GP3”; hard to tell from the photo.

It looks like this is a 1 relay board.

The GP2 terminal on the board will be input 1 in firmware.
The GP3 terminal on the board will be input 2 in firmware.
so on and so forth.

So It looks like you have the White wire connected to controller.readInputStatus(3).

However I see no connections to GND in your wiring. These inputs read 1 when the input is pulled low to Ground and 0 when they are open to ground. If you use a short jumper wire and connect GP4 to GND you will see that controller.readInputStatus(3) will return 1 and if you remove the wire it will return 0.

Thanks again (twice in one day!), Travis. The black wire is connected to the second terminal from the bottom, labeled “GND”. The jumper idea is great; I’ll do that so that I don’t have to wait hours or days for the float switch to close again! But input 3 was my guess and that’s the one I installed on the Boron. Yay!

Ah… sorry, couldn’t tell which terminal that black wire was connected to in the photo. I’d say as long as that’s a dry contact from the float switch it should work. Let us know if you have any other questions.