Introduction: 4X3 Keypad Using 4 IOs Only
A typical MxN matrix keypad usually takes M+N IOs for interfacing to a microcontroller. This novelty configuration uses diodes to loop from Rows to Columns to reduce the IOs down to M, suppose M >N. This instruction will demonstrate how to use it with Arduino in case numbers of IO are in your concern in your project.
Supplies
Arduino Platform: I'm using Arduino UNO R3.
LCD: Numerical or dot matrix one, or 7-segment LED if you are confident to use it. It is optional as you can use Arduino serial monitor to watch key press if you have none by hand.
4X3 keypad: You can build your own with 12 push buttons and strip board, or you can salvage from any unused electronics device such as landline phone, old mobile phone, fax, printer, microwave, remote and eftpos etc.
6 Diodes: I salvage them from junk PCBs, I am using 6 general purpose one, they are supposed to be 1N4148.
Electronics Workbench with basic tools.
Step 1: Prepare Your 4x3 Keypad
If you decide to build your own with push buttons, you can do your own layout against the schematics.
As the photo shown in the Supplies section above, I am using a control panel taken from a digital alarm system. Only 12 buttons are used for this demonstration, other three are reserved for Reset, Real Time Clock setting for the LCD used, which won't be discussed as they are irrelevant.
The keypad uses carbon on the rubber to make the contact as it is conductive. If there's no silk print on the PCB, you had to trace the copper track to identify the pinout. Use labels like me to mark the key net from R1 to R4 and C1 to C3 for rows and columns, respectively.
Drill 6 holes with mini drill bit for the diodes. The holes should be as close as possible to the related copper track because of soldering work and as far as possible away from keypad because the soldering point may affect the rubber performance. Use label to mark the hole by R2, R3, R4, C1, C2 and C3. No worry about R1 as no soldering to it as the schematics shows.
Remove the soldering mask using sharp tools until bright copper was visible. Apply your soldering skill, as well as soldering paste to bridge the rows and columns with the 6 1N4148 diodes.
Double check the connectivity with multimeter then soldering the wires for R1 to R4.
It is the best practice to secure the wires with hot glue.
Step 2: Connect to Display(optional) and Arduino
The display is optional because you can use the serial monitor from IDE unless you want to make this demo standalone.
You can use any display available by hand as long as you know how to make it work. This demo uses EM32110 as the photo shows. If you are interested in this LCD, refer to my last instruction about EM32117. EM32110 has 10-digit display rather than 16, no icon display just numerical only, no bult-in calendar but real time clock. It is enough for this demo for this numerical keypad. An AAA battery is used for the LCD module because it operates at 1.5 volt rather than 5V. 4 resistors are used for level shifting. Refer my last instruction for details. The real time clock should work upon the battery connected.
Then connect to Arduino against the schematics or in your preference if you are an experienced Arduino player.
Step 3: LCD Test With Arduino(Optional)
It is useful to troubleshot your keypad configuration and debug your code before making sure your LCD works properly with Arduino. Check my repository on Github if you are using EM32110 alike. The video attached herewith shows my test.
Attachments
Step 4: Simulation(Optional)
I am using Proteus for schematics and code. There's no library for my EM32110 with it, so I had to use I2C dot matrix LCD for simulation purpose. The simulation works very slow on my desktop along with wired display. You had to be patient to operate the keypad by press-hold-release and wait to see the right key response if your circumstance is the similar like mine.
From the schematics, you may also notice that I am using 12 push buttons to configure the keypad, rather than the built-in 4x3 keypad module from Proteus library. The second image is my initial schematics with keypad built-in Proteus library. Unfortunately, it doesn't work until I found it work with hard wired 12 push button version. It is for your reference only and you're appreciated telling the trick if it works for you.
Step 5: Implementation
As the implementation uses EM32110 rather than popular serial alphabet LCD used for simulation, be aware the implementation code is different.
Check the repository on Github for Proteus projects, including LCD test, simulation and implementation. See demo video on Youtube.
This configuration can apply any matrix keypad, but it will increase the complexity because number of diodes have to be added exponentially rather in linear.
An elegant solution is in consideration, keep tuned.






