Fork me on GitHub

Project Notes

#303 KeyboardMatrixModule

Demo a simple pushbutton/LED matrix module.



I picked up one of these 4x4 Independent Keyboard Matrix modules to see how useful it might be for arbitrary input with a microcontroller.

It features:

  • 4x4 matrix of Push Buttons
  • 4 independent Push Buttons
  • 8 LEDs

It doesn’t contain any smarts, so using all the 20 possible inputs and outputs requires a bit of ingenuity (if you want to use them all) on many microprocessors (such as the Arduino Uno or Nano). If you are using something like the Arduino Mega, then there should be plently of available I/O directly to the board.

In this project, I examine how it is constructed, and provide some examples of how to make it work:

4x4 Matrix Push Button Array

The module includes an array of 16 (black) pushbuttons K1-K16.

These are connected in a 4x4 matrix, with 8 pins: L1-4, R1-4. Looking at the module with the LEDs at the bottom:

  • the “L” pins connect to all the pushbuttons in a row
  • the “R” pins connect to all the pushbuttons in a column

So for example pressing the button on the second row, third from the left, will open a circuit between L2 and R3.

4 Independent Push Buttons

There are 4 independant (red) pushbuttons S1-4.

With VCC connected to power and GND grounded, pins S1-4 are normally pulled high with a 10kΩ built-in resistor. When pressed, the corresponding button pin will pull low.

8 LEDs

The board includes 8 red LEDs with 1kΩ (102) current-limiting resistors and corresponding pins D1-8.

With VCC connected to power, when any pin D1-8 is pulled to ground the corresponding LED will light.





Credits and References

Project Source on GitHub Project Gallery Return to the LEAP Catalog

This page is a web-friendly rendering of my project notes shared in the LEAP GitHub repository.

LEAP is just my personal collection of projects. Two main themes have emerged in recent years, sometimes combined:

  • electronics - usually involving an Arduino or other microprocessor in one way or another. Some are full-blown projects, while many are trivial breadboard experiments, intended to learn and explore something interesting
  • scale modelling - I caught the bug after deciding to build a Harrier during covid to demonstrate an electronic jet engine simulation. Let the fun begin..
To be honest, I haven't quite figured out if these two interests belong in the same GitHub repo or not. But for now - they are all here!

Projects are often inspired by things found wild on the net, or ideas from the many great electronics and scale modelling podcasts and YouTube channels. Feel free to borrow liberally, and if you spot any issues do let me know (or send a PR!). See the individual projects for credits where due.