how to extend keypad by using just 8 wire

Thread Starter


Joined Feb 27, 2017
im designing a keypad i tried with 4*4,
but the total combination of the above condition is.
for 4*4 the total and max combination is 16.Keypad-4x4-Matrix-Keypad-structure.jpg

and i want the total of 20 combinations by just using only 8 wires so which technique i can use.
so that i can do 20 fuctions

please suggest me something


Joined Jun 26, 2012
You can do it in firmware if you want.

Write your keypad code so that it returns 'scan codes' i.e. the number of the key that is pressed, 0-15 is a good choice.
Process the keys by using the scan code as an index into an array of key codes that associates the scan code with the key's value. As keys are pressed, convert their scan codes to key values by looking them up in the array.

To extend the keypad:
Dedicate one key as a SHIFT or ALTERNATE FUNCTION key. When it is pressed, set a flag that indicates the shift/alternate function is active.
When the flag is set, use a different array to look up the alternate key values.
Clear the shift flag after each entry or make it a toggle i.e. push once for alternate values, push again for normal values.

There are many variations on this scheme but it's about as simple as it gets. You can also make it so you hold the SHIFT button while pressing another key but that requires some logic changes to the lower level keyboard scanner. The shift/alternate function as I describe it uses standard scanning. I've used both methods over the years.

Good luck.