Source: https://mokxi.com/learn/path/keyboard-matrix
Updated: 2026-11-20

All paths

# Custom keyboards from the matrix up

Scan a key matrix, see ghosting and the diode that stops it, then add layers, a knob and per-key light.

SparkFun Pro Micro Free 3 lessons 3 h 2 chapters 725 XP Maker · Intermediate +150 XP

0 of 3 done

Start the course free Rows, columns and the scan Lesson plan for teachers

What you will build

## One project, built step by step

3 lessons in 2 chapters, about 3 hours on a simulated SparkFun Pro Micro. Free, in your browser, every step checked by the simulator.

Chapter 1 project

### Ghosting, and why every key gets a diode

Scan a membrane keypad that has no diodes, hold three keys on a rectangle and watch a fourth appear, then see how one diode per key stops it.
Open it in the simulator

The map

## Chapter by chapter

Each lesson opens when the one before it is done, and each chapter ends in a project.

Chapter 1

## The matrix

Rows, columns, the scan, and why every key gets a diode.

Open 187 XP

### Rows, columns and the scan

Why twelve keys need only seven pins: drive one row LOW at a time, read the columns, and find every key by its row and column.

0 of 5 steps

Start What is in it

Project Locked 338 XP

### Ghosting, and why every key gets a diode

Scan a membrane keypad that has no diodes, hold three keys on a rectangle and watch a fourth appear, then see how one diode per key stops it.

0 of 5 steps

Chapter 2

## The keyboard

A layered keymap, an encoder and one LED per key.

Locked 200 XP

### Layers, a knob and per-key light

Turn the matrix into a keyboard: a keymap with layers you hold and toggle, an encoder that scrolls or steps by layer, and one WS2812B per key.

0 of 6 steps

Syllabus

## Every lesson in the course

All 3 lessons, in order, each with what it covers. Any of them opens in the editor right away.

Chapter 1

### The matrix

- Rows, columns and the scan Why twelve keys need only seven pins: drive one row LOW at a time, read the columns, and find every key by its row and column.
- Ghosting, and why every key gets a diode Scan a membrane keypad that has no diodes, hold three keys on a rectangle and watch a fourth appear, then see how one diode per key stops it.

Chapter 2

### The keyboard

- Layers, a knob and per-key light Turn the matrix into a keyboard: a keymap with layers you hold and toggle, an encoder that scrolls or steps by layer, and one WS2812B per key.

Kits

## Build it on your bench too

Every lesson runs in the simulator with nothing to buy. When you want the real thing, these kits have the parts.

Have a kit already?

### Find your kit

Pick the starter kit you own and run every lesson in its manual with the same parts on the same pins.
See every kit

Questions

## About Custom keyboards from the matrix up

Is Custom keyboards from the matrix up free?

Yes. All 3 lessons of Custom keyboards from the matrix up are free and run in your browser, with nothing to install and no parts to buy before you start.

Do I need a real SparkFun Pro Micro?

No. Every lesson runs on a simulated SparkFun Pro Micro with its parts on the canvas, and the simulator checks each step as you go. When you want to build it for real, the same wiring and code work on a real board.

How long does Custom keyboards from the matrix up take?

About 3 hours: 3 lessons in 2 chapters, each one a few short steps. Your progress is kept, so you can stop after any lesson and pick up where you left off.

What will I build?

Each chapter ends in a project that puts it together: Ghosting, and why every key gets a diode.

Where do I start?

With "Rows, columns and the scan", and each lesson builds on the one before it. New to circuits? Electronics basics is the course that starts from zero.
