I've built a switch key matrix (thus the diode, contextually useful schematics below) and me being me, I realised after that I misunderstood a few things about how button really works, to say the least... So anyway, I want to save it so I plan on a solution which, to my surprise, is half-working: When I remake the entier circuit on a breadboard (mistake & solution), it's working but when I do it with my PCB, it doesn't...

The 5V+ is from a digital pin set to HIGH and I've mesured w/ an oscilloscope the tension between the ground and a digital pin ("Arduino INPUT") on the breadboard and on the PCB, with the input pin connected and not connected:

Connected Not Connected
BreadBoard 2.5V+ 5V+
PCB 0V+ 5V+

So it's seems like the pin is becoming one with the ground but I can't find anything that could explain this. I've been testing and trying to understand what the hell was going on for multiple hours now and I runned out of ideas... Does anyone here have an idea of whats might happening ?

enter image description here


1 Answer 1


Are you supplying the breadboard from a 5v power source, other than the one that is supplying the Arduino?

Is there any reason why you are using a diode between the button and the arduino pin?

Arduino can sink and source current and with the 10k resistor that diode is just "dropping" some voltage, i would remove it if you really don't have any other use for it.

If you are supplying the PCB with a different power source than the arduino, you have to "join" the 2 grounds, connect the groud from the power source of the PCB to any ground pin of the arduino. if you could take a photo that could help.

Something like this :

enter image description here

  • 1
    There's a diode because it's a part of a key matrix. The 5V+ is from a digital pin set to HIGH so the breadboard is fed with that. Regarding the 10k resistor, I know it's a mistake and I'm trying to fix it. The thing is, the fix is acting strangely... What are you using for your schematics btw ?
    – O'Schell
    Sep 8, 2023 at 17:18
  • But can't you bypass the diode? can you post a picture of how you have the thing connected? I'm using an old software called Circuit Wizard Sep 8, 2023 at 17:22
  • It«s really important that you connect the ground of the pcb power supply (if there is a different one) to the arduino ground Sep 8, 2023 at 17:23
  • 1
    @O'Schell the info about the diode belongs in the question ... please edit your question and add the info
    – jsotola
    Sep 8, 2023 at 19:00
  • Diode info added and the ground on the PCB isn't used in the circuit: I only use the arduino one
    – O'Schell
    Sep 10, 2023 at 14:21

Your Answer

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

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