I am getting desperate because i am self-learning arduino and electronics and at some point guidance is needed for that someone with experience can help a guy out in a blink of an eye and save some time.
Keep in mind that my knowledge is very limited and based on reading stuff from forums and tutorials and videos.
Here's my problem, i appreciate in advance your kindness to help out:
I am trying to do something that i thought that should be simple. Expanding input to the arduino mega via MCP23017. First i tried to do all by myself. Bought some chips and wired 4 of them serially using I2C. The idea is to have a panel with 40 input buttons, and for what i've read i left 2 inputs on each MCP23017 unused because i've read that they don't work correctly as inputs. The result of my home made board was that I2C hung up at some time and point in time, like when it "heated up" from working 2 minutes(without the chip getting hot) and had some misreadings when working, so i figured out to design a board with some free board cad software. At this time i kept in mind that the problem could also be about having flux laying all around making small shorts because it spread everywhere and i could not clean it better than using alcohol and a tooth brush, leaving the solder dark and some white residue.
Back to the boards i designed, since the panel is too long for cheap production i had to make 2 separate boards that i will unite later on. And to make it even more fail-proof i bought a centipede shield from macetech which works correctly if i test the input pins with some jumper wire.
I could not find some assembly service so i just tried to solder it by myself. I'm not the best solderer but normally i get things done correctly. I also buy some circuits in kit form that i solder by myself with the same flux and iron and they work correctly.
When i received my board i started soldering the buttons and board connectors right away and did not test for resistance before, just took an eye-check and everything seemed fine.
Arduino is running those basic standard I2C sketches just for input detection, which is all ok.
But then when i connect the board to the Centipede i have almost all inputs LOW, and since i'm using its internal pull-ups, i should have 5V before pressing the button for it to work correctly. I can read it on the Centipede pins but not when i connect to my board. I measured with a DMM and i have in some pins around 0,5V, really depends. But always far from the expected 5V. And some times i have one or two buttons that signal correctly but at some time they stop working right, and voltage is never 5V when open circuit.
Also used an external 5V source with 5A to power the centipede from aux source and the behaviour is the same.
So i also have the other half of the board, and i just pushed the buttons onto the board and connected it to the centipede just by contact for testing and it is working as expected. And this is what i don't understand. They obey the same design rules, i mean, i didn't do anything differently.
Here are the design rules:
Trace width: 0,5mm
Min trace width: 0,01mm
Max width: 100mm
Via Diameter: 1mm
Outer Diameter: 1,5mm
Here is the Layout for the board that does not work: Notice the red circle is in a design flaw that i have corrected by not connecting that button pin and since there is a copper pour that button is connected to ground and i spotted it right away when i was soldering the buttons. I just cut that pin. Even if it was connected i guess it should only read badly on that input.
And the real board with copper pour and soldered:
Now the one that works if i connect directly to the centipede without being soldered :
Centipede datasheet: centipede_shield [macetech documentation]
Why is this happening? Can it be the solder flux? i tried to clean with water, acetone and still i have gooey thing in my board. I looked for solder shorts and could not find any. At the time i took the photos i was already de-soldering, trying to look for problems and try to measure the resistance on one circuit without the switch. i guess its fairly low, i should expect high resistance, right?
You can also see some papel leftovers on pins from cleaning on the pics.
The board was made in eurocircuits, and its a proto board, that's why it has this not-pro look.
I know mcp23017 is picky with interference from another current sources, thats why i made the cooper pour. Can it be creating my problem?
I'm out of ideas, sorry for the long post.