Soldering and wiring a button matrix

Are there any good instructional or video tutorials on soldering and wiring up a button matrix?

I did a 5x4 matrix for 6 encoders and an on-off-on spdt. Each encoder acts as a push button as well, so it was 20 buttons in all. They also had power and ground for LEDS. So 6 encoders times 6 wires.

This is the first project I’ve soldered and while I succeeded easily enough I was not impressed with the neatness of the wiring despite my best efforts.

I also had 6 pots with wires for ground, power, and output. I was less concerned with the neatness of those. They just added to the fun.


Switch matrices are usually a grid with rows and columns. To read the switches, you apply 5v to each column in turn then read the rows in turn. If a button is pressed, you know which colum and row.

You can of course have 5v via R to each column and use the Arduino to pull each column low.


What are these “6 encoders”?

It sounds like you have the soldering done (first soldering jobs rarely (if ever) look neat and tidy).

Are you looking for programming help?

As Weedpharma pointed out, button arrays are often read as columns and rows.

What are you using as a controller (which Arduino)?

I'm not sure exactly what you're asking, since it sounds like you've got the wiring done already?

Wiring is done and software works. Just looking for anything that shows clean examples of soldered matrices. Or if someone is willing to post a picture of a matrix they soldered that would work as well.

Part of my problem is probably that I used a solderable bread board which kinda necessitated spreading things out. I just don't know what the proper boards and methods are. I can understand the wiring diagrams and how to make the physical connections.

Making a matrix like this with ~40 wires not look like a rats nest is what I don't really follow too well at this point.

Unfortunately user interfaces are always more complex than you think. Both the code and the physical buttons are basically impossible to do “neatly.”

A custom PCB is the best way I know to organize buttons, if you can’t use an off-the-shelf keypad. $2-$5 per square inch is absolutely worth it to save hours of soldering and troubleshooting.

Ah, see. I had no idea this was possible. So, using the power of google based on your response I see things like OSH Park for printing custom pcb's and EAGLE for designing. Are there cheaper options for designing? It looks like EAGLE is pretty expensive.

Still this is all pretty awesome. Thank you!

OSHPark make very nice PCBs but they're more expensive than some of the other fab houses. If you can get your board to fit within a 2cm x 2cm square, you can get 10 boards for about $20. 4cm x 4cm is another common size.

Here's a link to a LED project I did. You can see from the video how the original prototype has a rat's nest of wires. I was able to fit the PCB on a 2cm x 2cm board and you can see how the much tidier the PCB version of the array looked compared with the breadboard version.

I'm a fan of DipTrace myself. Both DipTrace and Eagle offer free versions. There was a recent thread where people discussed PCB software. If I can find the link, I'll add it here.

Here's a link to the recent thread about PCB design software.

Perfect, thank you guys. This, I think, is exactly what I was looking for. I'll take some time to read and digest now!