Author Topic: Breadboard keyboard matrix - need confirmation of design  (Read 7925 times)

0 Members and 1 Guest are viewing this topic.

Offline trauring

  • Thread Starter
  • Posts: 94
    • off on a tangent
Breadboard keyboard matrix - need confirmation of design
« on: Fri, 01 May 2015, 02:25:28 »
I'm experimenting with building a matrix, and wanted to create a matrix I could easily swap with a pre-made 4x4 matrix keypad I have, except that this one would have diodes. I've designed it as such:



It's using 4-pin pushbuttons because that's what I have. The diodes alternate sides of the buttons because there's no other way to do it on a breadboard with only 5 holes in a row. I think electrically, however, it shouldn't matter if the connections alternate sides.

I would greatly appreciate comments on this, if I made any mistakes, and suggestions for improving it. Thanks.

Offline Oobly

  • * Esteemed Elder
  • Posts: 3929
  • Location: Finland
Re: Breadboard keyboard matrix - need confirmation of design
« Reply #1 on: Fri, 01 May 2015, 02:33:24 »
Your diodes are connected incorrectly. They should go from the switch contact to a shared rail instead of being all in series like that.

Buying more keycaps,
it really hacks my wallet,
but I must have them.

Offline trauring

  • Thread Starter
  • Posts: 94
    • off on a tangent
Re: Breadboard keyboard matrix - need confirmation of design
« Reply #2 on: Fri, 01 May 2015, 02:45:55 »
It's hard to do that on a a breadboard, although I suppose I could direct the four the diodes of a column to a single row, and use the fifth slot to exit the column. It might not be possible to do that using the leads of the diodes which is what I was planning on doing for this prototype, however. I actually just checked and I can make them reach, but I need to keep the leads full length and it's hard to keep them from touching.

I though that electrically it was pretty much the same since either way they're all connected. Are you sure my original design wouldn't work? I guess I can test both designs when I put it all together.

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: Breadboard keyboard matrix - need confirmation of design
« Reply #3 on: Fri, 01 May 2015, 02:48:24 »
That looks really strange on breadboard, but it's close :)

The problem is that when you press one of the switches at the top of your circuit it only lets the signal flow to the next switch, so it won't register at the controller.  Instead you need to connect the switches after the diodes something like this:


Note that the orange "wire" also connects in the bottom row which isn't clear :))
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline trauring

  • Thread Starter
  • Posts: 94
    • off on a tangent
Re: Breadboard keyboard matrix - need confirmation of design
« Reply #4 on: Fri, 01 May 2015, 06:34:46 »
Thank you. That makes a lot of sense. And the way you keep the wiring basically the same is helpful. Just need to move the diode down one row and add a second wire.

Offline tjweir

  • * Exquisite Elder
  • Posts: 1039
  • Location: Toronto
Re: Breadboard keyboard matrix - need confirmation of design
« Reply #5 on: Fri, 01 May 2015, 07:57:28 »
Interesting idea for testing things out.

@orange, you win the MS Paint award! :)

Offline trauring

  • Thread Starter
  • Posts: 94
    • off on a tangent
Re: Breadboard keyboard matrix - need confirmation of design
« Reply #6 on: Fri, 01 May 2015, 10:53:11 »
This is almost there:

99088-0

I dropped the alternating diodes since I no longer connect the bottom of the diode to the bottom row of the next diode.

The only problem I see is in Row 13, where I can two wires connected to the same hole in 4 places. I could easily fix this by moving the connections down to row 15, but then I have the diode leads overlapping. Since I'm hoping to use the diode leads directly to connect to the breadboard, and since they're not insulated, I want to avoid overlap as much as possible.

If I move to row 15 on the right side only (i.e. bring the column connectors down to row 15 one hole to the left from the end), and connect to another wire to the last hole to continue, that would work but would not allow for a straight wire - I'd need to bend it around the button to be able to use it - something I was hoping to avoid.

In the case of the row connections (in rows 6, 11 and 16) they will be insulated, so hopefully there will not be a problem there (the overlap is close to the edge, so it could be a problem).

Offline trauring

  • Thread Starter
  • Posts: 94
    • off on a tangent
Re: Breadboard keyboard matrix - need confirmation of design
« Reply #7 on: Fri, 01 May 2015, 11:02:24 »
Actually I think I can connect on row 10 and that way the button won't be obstructed.

Offline trauring

  • Thread Starter
  • Posts: 94
    • off on a tangent
Re: Breadboard keyboard matrix - need confirmation of design
« Reply #8 on: Sat, 02 May 2015, 17:06:04 »
So I have two solutions now.

The version that continues the above attempt is here:



The only real downside of this design is that the wires from row 10 on the upper right side of the third row of buttons has to connect to row 14 underneath the buttons. I don't think this is problem since the bottom of the buttons are plastic, but it lacks a bit of elegance.

When I originally came up with the design, I removed the power/ground rails on the sides of the breadboards, so that the buttons would be equally spaced. When I was trying to figure out a solution to the wire overlap in the original design above, I came up with a different solution - putting one set of power/ground rails back in the middle, and using the power/ground rails as the rails that connect the diodes:



A more elegant solution, although the spacing between the second and third columns is now larger than the spacing between the other columns. Considering this is just to test the wiring of the matrix, that's really irrelevant, but I had hoped to get it working with the spacing correct.

Offline trauring

  • Thread Starter
  • Posts: 94
    • off on a tangent
Re: Breadboard keyboard matrix - need confirmation of design
« Reply #9 on: Sat, 02 May 2015, 17:18:56 »
Another solution that merges these two is to forget the center rails and just use the four rails on either side of the breadboard. Since there are two on each side, I could just have the diodes connected to the center columns reach across to the far ends of the board instead of the center. It doesn't look quite as elegant, and it would require the diodes to have different length leads for center and edge buttons, but it would keep the spacing of the buttons correct.

Offline Oobly

  • * Esteemed Elder
  • Posts: 3929
  • Location: Finland
Re: Breadboard keyboard matrix - need confirmation of design
« Reply #10 on: Mon, 04 May 2015, 02:58:34 »
Why not just keep it simple:

Buying more keycaps,
it really hacks my wallet,
but I must have them.

Offline trauring

  • Thread Starter
  • Posts: 94
    • off on a tangent
Re: Breadboard keyboard matrix - need confirmation of design
« Reply #11 on: Mon, 04 May 2015, 03:13:38 »
Why not just keep it simple:

I'm confuzzeled. Aren't you attaching all the buttons along the rows twice, and none of them in the columns? How does the matrix work if there is nothing to connect the buttons in the columns?

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: Breadboard keyboard matrix - need confirmation of design
« Reply #12 on: Mon, 04 May 2015, 04:00:08 »
Why not just keep it simple:

I'm confuzzeled. Aren't you attaching all the buttons along the rows twice, and none of them in the columns? How does the matrix work if there is nothing to connect the buttons in the columns?

Yup, that's four sets of four switches all the same.  Was it a good night last night Oobly? :))
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline Oobly

  • * Esteemed Elder
  • Posts: 3929
  • Location: Finland
Re: Breadboard keyboard matrix - need confirmation of design
« Reply #13 on: Mon, 04 May 2015, 08:23:10 »
Why not just keep it simple:

I'm confuzzeled. Aren't you attaching all the buttons along the rows twice, and none of them in the columns? How does the matrix work if there is nothing to connect the buttons in the columns?

Yup, that's four sets of four switches all the same.  Was it a good night last night Oobly? :))

Doh!

Well, didn't sleep very well last night. Sorry.

[ Specified attachment is not available ]
« Last Edit: Mon, 04 May 2015, 08:26:14 by Oobly »
Buying more keycaps,
it really hacks my wallet,
but I must have them.

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: Breadboard keyboard matrix - need confirmation of design
« Reply #14 on: Mon, 04 May 2015, 09:06:07 »
Why not just keep it simple:

I'm confuzzeled. Aren't you attaching all the buttons along the rows twice, and none of them in the columns? How does the matrix work if there is nothing to connect the buttons in the columns?

Yup, that's four sets of four switches all the same.  Was it a good night last night Oobly? :))

Doh!

Well, didn't sleep very well last night. Sorry.

(Attachment Link)

Perfect :)
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline trauring

  • Thread Starter
  • Posts: 94
    • off on a tangent
Re: Breadboard keyboard matrix - need confirmation of design
« Reply #15 on: Mon, 04 May 2015, 11:31:21 »
Oobly, I don't think the two middle buttons in the second column (from the left) are connected. Besides that, however, you have many wires overlapping and I think you use just as many wire connections as my original design. It's not that you can't do that, but I am trying to reduce overlap as I am using cut diode leads for all the small connections, and since those are not insulated, I can't have them overlap. I do see how your design is simpler in that it doesn't run underneath the button like mine though. You've done that by flipping the columns and rows from my design.

I think my second design using the center power/ground rails works the best for me, as it uses the smallest number of wires, all the wires are straight, and it has zero overlap. I might take one idea from your design, however, which is to carry to column ends to the right side of the board so all the wires end up exiting the same side of the board, which will make connecting to the micro controller easier. I just need to run a wire from each column end to the right side of the board, and connect to the right-most set of holes. Then I just connect a wire to the same set of five holes and run it off the side of the board.

Offline Oobly

  • * Esteemed Elder
  • Posts: 3929
  • Location: Finland
Re: Breadboard keyboard matrix - need confirmation of design
« Reply #16 on: Mon, 04 May 2015, 13:43:01 »
Oobly, I don't think the two middle buttons in the second column (from the left) are connected. Besides that, however, you have many wires overlapping and I think you use just as many wire connections as my original design. It's not that you can't do that, but I am trying to reduce overlap as I am using cut diode leads for all the small connections, and since those are not insulated, I can't have them overlap. I do see how your design is simpler in that it doesn't run underneath the button like mine though. You've done that by flipping the columns and rows from my design.

I think my second design using the center power/ground rails works the best for me, as it uses the smallest number of wires, all the wires are straight, and it has zero overlap. I might take one idea from your design, however, which is to carry to column ends to the right side of the board so all the wires end up exiting the same side of the board, which will make connecting to the micro controller easier. I just need to run a wire from each column end to the right side of the board, and connect to the right-most set of holes. Then I just connect a wire to the same set of five holes and run it off the side of the board.

You're right, I missed one wire. I was assuming insulated wire and it's just how I'd lay it out on breadboard myself. Doesn't really matter how you do the actual connections, just as long as it ends up like the schematic. I like how neat your layout looks with using the "power" rails, but it does increase the size somewhat.
Buying more keycaps,
it really hacks my wallet,
but I must have them.

Offline trauring

  • Thread Starter
  • Posts: 94
    • off on a tangent
Re: Breadboard keyboard matrix - need confirmation of design
« Reply #17 on: Mon, 04 May 2015, 16:06:29 »
This is what it looks like at the moment on a real breadboard. The only thing missing are the four wires connecting columns 2 and 3, as the length is longer than the diode leads can reach, and I don't have any wire at the moment.

99487-0