SHOWALL FUN PRANKS HIGH VOLTAGE LAZARUS-64 PHOTOGRAPHY SPY GADGETS VIDEO GAME
Figure 2 - Most keypads are wired as a matrix of rows and columns
Figure 2 - Most keypads are wired as a matrix of rows and columns

Although it may look confusing at first glance, the wiring diagram shown in Figure 2 is commonly referred to as a "matrix", as the button switches are made of common row and column connections. It certainly takes a little more work to decode a single button press into a microcontroller on a matrix system, but if each key had its own wire, then this 12 button keypad would need 12 IO lines on the microcontroller. Using a matrix, the keypad now only requires 7 IO lines, a significant savings.

In a matrix connected keypad, there is no common ground to all button switches since they all share a row or column. To decode a matrix keypad, you have to turn on a single column at a time and then scan the rows for the current button press. By doing this, you basically turn the keypad into a commonly connected row of switches momentarily. This may seem like a lot of work, but it happens in a few microseconds in the microcontroller with just a few lines of program code as will be seen later.



Figure 3 - Measuring the dimensions of the keypad for mounting
Figure 3 - Measuring the dimensions of the keypad for mounting

The SparkFun keypad has a rounded rectangular shape, so mounting it into a box will require some fancy cutting to make a snug fit. There are several methods that can be used to mount this keypad in a box: cut the exact rounded rectangular shape as I am going to do, cut a smaller 90 degree rectangle so that only the keys are visible, or mount the key pad on the top of the box, leaving the PCB header exposed. The rounded rectangle opening will certainly look most professional if it can be made accurately, so that is how I decided to proceed. Take the basic length and width measurements from the key panel as shown in Figure 3. If you have the same keypad that I do, then the dimensions are 46mm wide and 57mm tall with 4mm radius corners.

Back Home Last Next
You are Viewing... Page 2 of 16
Lucid Science Electronics from the Fringe AtomicZombie Hack-a-day SparkFun