

Keypad
The hardware and software for a simple 3x4 Keypad
- Size
- 94 × 92 mm
- Copper layers
- 2
- Thickness
- 1.6 mm
- Parts
- 39
- Nets
- 32
- Pads
- 125
- Tracks, vias
- 197, 190
- Pours
- 5
- Routed
- Yes
- KiCad
- KiCad 6 (file 20211014)
- Created
- 19 Aug 2023
- Updated
- 12 Sep 2023
Overview
Keypad is an open-source printed circuit board by StefanLilje, from the StefanLilje/Keypad repository on GitHub, published under the MIT licence. It is a 2-layer board of 94 × 92 mm with 39 parts on 32 nets, routed with 197 tracks and 190 vias.
It is built around the MX1A-E1NW. Its parts include 14 diodes, 13 switches, 2 resistors and 1 IC. It belongs with the keyboards and input boards and the SAM D and SAM boards of this library.
Main components
1README
README.mdKeypad
The Hardware and software for a simple 3x4 Keypad featuring a USB-C Interface
Sources
https://wiki.seeedstudio.com/Seeeduino-XIAO/#resourses
https://grabcad.com/library/5x5mm-smd-tactile-button-1
https://grabcad.com/library/kailh-polia-switch-cherry-mx-compatible-1How to use
Setup
- Install the newest version of arduino IDE
- In arduino IDE, under preferences add this board URL
https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json- Install the newest version of the
Seeed SAMD Boardspackage from the boards manager - Install the newest version of the
Keyboardlibrary from the library manager - Clone or download
Keypadinto your Arduino project folder
Changing keyboard layout
Keyboard.begin(KeyboardLayout_de_DE);The keyboard layout can be changed in Keypad.ino by substituting KeyboardLayout_de_DE with any of the following layouts supported by the arduino keyboard library:
KeyboardLayout_de_DE
KeyboardLayout_en_US
KeyboardLayout_es_ES
KeyboardLayout_fr_FR
KeyboardLayout_it_IT
KeyboardLayout_sv_SE
KeyboardLayout_da_DKEditing macros
Open Keypad.ino with the arduino IDE. Functions of the keypad can be configured by editing the code inside the switch statement inside loop(). Two examples are already filled in.
switch (keys[j][i]) {
//special macros
case 1:
numpadAscii(i, j, 231);
break;
case 10:
textMacro(i, j, "max.mustermann@generic-mailservice.com");
break;
//all other keys: press key according to keyMap
default:
singleKeypress(i, j);
break;
}To configure a specific key, look up its number in the keys variable:
const int keys[3][4] = {
{ 1, 2, 3, 4 },
{ 5, 6, 7, 8 },
{ 9, 10, 11, 12 }
};Then, add a special case to the switch statement (in this example key number 2 was chosen):
case 2:
...
break;Predefined macros
Several common macros are already implemented:
act as single key:
case 2:
singleKeypress(i, j, keycode);
break;where keycode is a either an integer corrosponding to a key or one of the following special keys:
list of special keys
KEY_LEFT_CTRL
KEY_LEFT_SHIFT
KEY_LEFT_ALT
KEY_LEFT_GUI
KEY_RIGHT_CTRL
KEY_RIGHT_SHIFT
KEY_RIGHT_ALT
KEY_RIGHT_GUI
KEY_UP_ARROW
KEY_DOWN_ARROW
KEY_LEFT_ARROW
KEY_RIGHT_ARROW
KEY_BACKSPACE
KEY_TAB
KEY_RETURN
KEY_MENU
KEY_ESC
KEY_INSERT
KEY_DELETE
KEY_PAGE_UP
KEY_PAGE_DOWN
KEY_HOME
KEY_ENDType text macro:
case 2:
textMacro(i, j, "your-text-here");
break;Ascii character macro (where 231 is an example):
case 2:
numpadAscii(i, j, 231);
break;Custom code for macro
activate while key is held
case 2:
if (keysPressed[i][j]) {
...
}
break;activate on rising edge (keypress)
case 2:
if (keysPressed[i][j] && !lastKeysPressed[i][j]) {
...
}
break;Flashing
After changes have been made to Keypad.ino the program has to be uploaded to the microcontroller.
In Arduino IDE:
- select
Seeduino XIAOas your board - select the correct Port
- upload the sketch
Parts
39| Qty | Value | Footprint | References |
|---|---|---|---|
| 12 | 1N4148 | Diode_SMD:D_MiniMELF | D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12 |
| 12 | MX1A-E1NW | miscellaneous:Cherry-MX1A-E1NW-0 | SW1, SW2, SW3, SW4, SW5, SW6, SW7, SW8, SW9, SW10, SW11, SW12 |
| 4 | MountingHole_Pad | MountingHole:MountingHole_2.7mm_M2.5_Pad | H1, H2, H3, H4 |
| 2 | 220R | Resistor_SMD:R_1206_3216Metric | R1, R2 |
| 2 | LED | LED_SMD:LED_0603_1608Metric | D13, D14 |
| 1 | 3V3 | TestPoint:TestPoint_Pad_D1.0mm | TP3 |
| 1 | 5V | TestPoint:TestPoint_Pad_D1.0mm | TP1 |
| 1 | D10 | TestPoint:TestPoint_Pad_D1.0mm | TP4 |
| 1 | D9 | TestPoint:TestPoint_Pad_D1.0mm | TP5 |
| 1 | GND | TestPoint:TestPoint_Pad_D1.0mm | TP2 |
| 1 | RESET | miscellaneous:5x5mm SMD Button | SW13 |
| 1 | SeeeduinoXIAO | miscellaneous:Seeeduino XIAO | U1 |
Similar boards
- 2 layers254 × 85.1 mm

- 4 layers100 × 38 mm

Knob v02-rounded
felop/HapticKnob
Haptic knob inspired by @scottbez1, designed to model different indent shapes
60 partsMIT - 2 layers352 × 60 mm

MCPBasedStopTabPanel
sdjespersen/epworth-organ
MIDI encoder/decoder + associated designs
61 partsBSD-3-Clause - 4 layers42 × 40 mm

Click counter Q2
dudgeon/count-fidget
A lightweight, rechargeable two-key fidget that counts clicks, resets with a second key, and remembers its count while asleep or unpowered. Designed for a home-printed enclosure and professionally assembled electronics.
62 parts - 2 layers24.4 × 24.4 mm

OSO SWAT B1
joeycastillo/Sensor-Watch
A board replacement for the classic Casio F-91W wristwatch
39 parts2.1k - 2 layers100 × 33.5 mm

Breakout 48pin 174917-Connector
rusefi/rusefi
rusefi - GPL internal combustion engine control unit
39 parts1.2k - 2 layers33 × 26 mm

VL53L1x pwm
hackclub/OnBoard
💡 Join 1,000 teenagers and make your first PCB with a $100 grant!
39 parts915 - 2 layers43.4 × 18.8 mm

Usb sniffer lite
ataradov/usb-sniffer-lite
A simple USB sniffer based on Raspberry Pi RP2040
39 parts706BSD-3-Clause
Questions
How big is the Keypad PCB?
It measures 94 × 92 mm and has 2 copper layers, 1.6 mm thick.
What parts does the Keypad use?
39 parts, built around the MX1A-E1NW. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
Where can I download the Keypad KiCad files?
From the StefanLilje/Keypad repository on GitHub, at the commit this page was made from: the board is Hardware/Keypad.kicad_pcb and its schematic Hardware/Keypad.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Can I use the Keypad design in my own project?
Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).