Nine keys and a knob: design notes for a first macropad
A 3 × 3 macropad is small enough to finish and has a little of everything: a switch matrix, USB-C, a microcontroller, lighting. These are the choices that decide whether the first board works.
A macropad is the classic first keyboard project. Nine keys and a knob fit on a board smaller than a postcard, and the same board teaches a switch matrix, USB, a microcontroller and lighting. The film walks round one such design. These notes go through it in the same order.
The keys: 19.05 mm, no exceptions
Mechanical switches sit on a 19.05 mm grid, three quarters of an inch. Every keycap on the market assumes it. Draw the nine footprints on that grid first, then fit everything else around them.

Two more decisions belong here:
- Solder or socket. Switches can be soldered straight to the board, or pushed into hot-swap sockets so they can be changed later. Sockets cost a little more and are worth it on a first build.
- Light. One small RGB LED under each key makes the legends glow. Mind the current: a full-size addressable LED can draw up to about 60 mA at full white, and nine of them is 540 mA, more than the 500 mA a USB 2.0 port promises. Cap the brightness in firmware.
One diode per key
Nine keys could each have their own pin. Wiring them as a matrix of three rows and three columns needs only six, and it is how every larger keyboard is built.
A matrix has one trap. Hold three keys that form the corners of a rectangle and the controller sees a fourth key that nobody pressed. A small diode in series with each switch stops the current from sneaking back, and three keys read as three.

Place all nine diodes facing the same way. It makes assembly, and finding a mistake, much easier.
The knob
A rotary encoder gives two signals that tell the controller which way it turned, and it clicks when pressed. In firmware it becomes volume, scroll or zoom. It has five pins: three for the rotation and two for the click.
The controller
Choose a microcontroller with USB built in, so it needs no separate USB chip. The open-source keyboard firmware projects support several, and with one of those the pad shows up on the computer as an ordinary keyboard with no driver.

Around it, the usual rules:
- A decoupling capacitor at every power pin, as close as it will go.
- The crystal close to its two pins, with nothing fast routed underneath.
- A reset or boot button, or two pads to short. You will want it the first time firmware goes wrong.
USB-C: two resistors that are easy to forget

A USB-C socket needs a 5.1 kΩ resistor from each of its two CC pins to ground. They tell the charger or computer that a device is attached. Leave them out and the pad works from an old USB-A port and stays dead on a USB-C to USB-C cable, a fault that puzzles people for days.
Also near the connector: a small protection chip on the data lines, and the two data tracks routed side by side.
Before ordering
Two layers are enough for this board. Before sending it out, check the things factories ask about:
- Enough copper round the switch pin holes.
- Parts kept back from the board edge. The USB connector is the one part that should overhang it.
- Silkscreen clear of every pad, and a clear mark for the diode direction.
A practical way to build a first batch is to have the small surface-mount parts assembled and to solder the switches and the knob yourself.
On EIN, the DFM check looks for exactly these things before you order, and makers quote within minutes.
The macropad in this film was drawn for the article. It is a design sketch, not a product.