I have a setup with 12 buttons. 10 of them connected to the arduino pins 0, 1, 6, 7, 8, 9 and analog 0, 1, 2, and 3 (these are all configured with pinMode as inputs in the setup-part of the sketch). button 11 and 12 are connected to an I/O expander (mcp23016) which I read from through the i2c bus on analog pin 4 and 5.
Each button is connected as this: side 1: directly to 5v side 2: to GND through a 10k resistor AND also to an input-pin (one pin for each button)
The first issue I had was with pin 0 (the RX pin). It was acting as though it wasn't connected, although it was indeed connected. So I ended up replacing its 10kohm resistor (to GND) with a 220ohm, and then it worked fine.
I don't know why this specific pin would need a smaller resistor in order to get connection, but everything seemed to work fine now.
When I had put all my components inside my casing, suddenly the same issue started happening with other buttons as well.
So my question to you is: what possible reasons could there be for this issue? Is it my 10k resistors that are too much resistance, thus leaving the input pins as not-connected? And if so; how can I measure impedance of my buttons, wires etc, and how would I find out which resistor would work? Is this a plausible reason or is it more likely that it's a soldering somewhere? I'm using screw connectors which are screw very tide together - but could this have anything to say?
I must admit I'm quite stranded on this one.
When I measure with my multimeter on the input pin that stays high, it gives me just below 5v reading. I tried momentarily connecting the faulty input pin directly to GND (without any effect) and also tried connecting it to GND through a 1k and a 220ohm.. no luck. So my best guess would be that there's a broke connection somewhere, but I really have a hard time finding it. All looks fine.
Any advise is very much appreciated.