Project 11: Production-Ready Custom Keyboard Line
Design a scalable keyboard product line with shared hardware standards, modular firmware, and production-grade QA processes.
Quick Reference
| Attribute | Value |
|---|---|
| Difficulty | Level 5: Expert |
| Time Estimate | 3-6 months |
| Main Programming Language | C (QMK/ZMK) + KiCad + Python tooling |
| Alternative Programming Languages | None |
| Coolness Level | Level 5: Pure Magic |
| Business Potential | Level 5: Industry Disruptor |
| Prerequisites | Projects 1-10, PCB and firmware skills |
| Key Topics | Design system, firmware modularity, QA |
1. Learning Objectives
By completing this project, you will:
- Define a hardware design system for multiple keyboard models.
- Build a modular firmware architecture that supports variants.
- Create a production test fixture and QA checklist.
- Automate firmware builds and releases in CI.
- Produce customer-ready documentation and update paths.
2. All Theory Needed (Per-Concept Breakdown)
2.1 Hardware Design System and Variant Management
Fundamentals
A product line requires consistency. Instead of designing each keyboard from scratch, you create a hardware design system: shared MCU family, consistent connector placement, standardized footprints, and repeatable matrix patterns. This reduces engineering time and minimizes bugs. Variant management means you can build multiple layouts (60%, 65%, split) using the same core hardware modules. The key is to separate what must be common (power, USB, MCU pinouts) from what can vary (matrix size, case design).
Deep Dive into the Concept
A design system for hardware is similar to a UI design system: it provides reusable building blocks. For keyboards, these blocks include the MCU module (USB, power, reset), the matrix module (rows, columns, diode orientation), the peripheral module (RGB, OLED), and connector standards (USB-C footprint, JST battery connector). If these blocks are standardized, you can assemble new designs quickly. The main benefit is reduced risk: if a module works in one product, it will likely work in the next.
Variant management begins with a shared pin map. If you keep the same row/column pin assignments across models, the firmware can reuse the same matrix definitions and only the matrix size changes. This allows a single firmware codebase to support multiple layouts. For example, a 60% and 65% board might share the same MCU and pin assignments, with the 65% board adding a few extra columns. The firmware can include both layouts and select the correct one based on a build flag.
Mechanical and electrical consistency also matter. Using the same USB connector footprint across models simplifies manufacturing and reduces errors. Standardizing the location of ESD protection and decoupling capacitors ensures that layout engineers follow known-good patterns. This is especially important for USB routing, where small mistakes can cause failures. A consistent ground plane strategy and power distribution network reduces noise and improves reliability.
Design system documentation is critical. A module library without documentation is just a collection of files. You need to specify rules: which footprints are allowed, how to name nets, how to place decoupling, how to route USB, and what design rules to use. This documentation becomes part of your QA process. When a new board is designed, you can review it against the design system checklist and catch deviations early.
Scaling also introduces supply chain considerations. If you choose an MCU that is hard to source, the entire product line is affected. This is why many keyboard vendors standardize on one or two MCUs and maintain approved component lists. Design system decisions are not just technical; they are business decisions.
Additional scaling concerns: treat the design system as a versioned artifact. When you change a module (e.g., switch to a new USB connector), update the module version and record which products use it. This is critical for traceability when field failures occur. Maintain an approved component list (ACL) with alternates for critical parts, and define a change control process so that substitutions are reviewed for electrical and mechanical compatibility. A disciplined change process prevents subtle bugs from creeping into new production runs.
Extra platform governance: create a change log for every hardware module revision, including rationale and test results. This becomes invaluable when diagnosing field failures months later. Maintain CAD libraries in a dedicated repository with version tags and enforce code review on footprint changes. When a component goes end-of-life, you can update the library with a vetted alternative and propagate it across variants systematically.
Additional compliance note: if you sell products at scale, you may need regulatory testing (FCC, CE) for electromagnetic compatibility. Standardizing USB routing, ground planes, and shielding options across variants helps ensure compliance without redesigning each board. Consider keeping a consistent enclosure grounding scheme so that EMI performance is predictable across the lineup.
How this fits on projects
This concept is the culmination of Project 7 and builds on all hardware projects in the series.
Definitions & key terms
- Design system: A set of reusable hardware modules and standards.
- Variant: A specific keyboard model built from shared modules.
- Pin map: Consistent mapping of matrix rows/cols to MCU pins.
Mental model diagram (ASCII)
Shared MCU module + Shared USB module + Shared power module
| | |
+---- Variant-specific matrix -----+
How it works (step-by-step, with invariants and failure modes)
- Define a shared MCU and USB module.
- Standardize pin mappings and footprint libraries.
- Create variant matrix modules for different layouts.
- Validate each variant against the design system checklist.
Invariant: shared modules remain unchanged across variants. Failure modes include pin map drift and inconsistent footprints.
Minimal concrete example
MCU: RP2040
Rows: GPIO0-5 for all models
Cols: GPIO6-17 for all models
Common misconceptions
- “We can standardize later”: Retrofitting a design system is costly.
- “Variants are independent”: Variants share risks and supply constraints.
- “Pin maps can change freely”: Firmware complexity grows rapidly.
Check-your-understanding questions
- Why is a shared pin map valuable?
- What hardware modules should be standardized first?
- How does a design system reduce manufacturing risk?
Check-your-understanding answers
- It allows firmware reuse and simplifies debugging.
- MCU, USB, power, and matrix wiring patterns.
- It reduces variation and ensures known-good designs are reused.
Real-world applications
- Keyboard product lines from boutique vendors.
- Any hardware startup with multiple SKUs.
Where you’ll apply it
- In this project: §3.2 Functional Requirements and §5.10 Phase 1.
- Also used in: Project 7.
References
- “Clean Architecture” by Robert C. Martin (modularity mindset).
- Hardware design system documentation from open-source keyboard communities.
Key insights
Consistency is a product strategy: it reduces bugs, costs, and time to market.
Summary
A hardware design system makes a keyboard product line scalable and maintainable. It turns one-off designs into a repeatable platform.
Homework/Exercises to practice the concept
- Create a pin map standard for rows and columns.
- List the modules you would standardize across models.
Solutions to the homework/exercises
- Assign rows and columns to fixed GPIO ranges and document them.
- MCU, USB connector, power conditioning, reset/bootloader circuits.
2.2 Firmware Modularity, QA, and Production Testing
Fundamentals
A product line requires firmware that supports multiple models with minimal duplication. This means modular design: shared core features, per-model configuration, and build-time variants. QA is equally important: you need automated tests, production test fixtures, and a clear definition of success. Without QA, scaling manufacturing leads to inconsistent quality and returns.
Deep Dive into the Concept
Firmware modularity starts with separating configuration from logic. In QMK, you can use a shared userspace to store common keymaps and features, while each keyboard directory holds hardware-specific config. For production, you might generate firmware variants using CI pipelines that compile each model with specific rules.mk flags. This ensures consistent builds and reduces human error. The build artifacts should be versioned and reproducible.
QA in a hardware product line is multi-layered. First, you need software QA: firmware builds must compile cleanly, and key features should be tested. For example, you can build automated tests that verify keymaps compile, and that the firmware size is within limits. Second, you need hardware QA: every board must pass a production test. This is usually done with a test jig (pogo pins) that can automate pressing keys or shorting row/col pads. The firmware should include a “test mode” that reports each key when a test pin is touched. This speeds up manufacturing and reduces errors.
Production testing also includes USB enumeration, LED tests, and accessory checks. A good test fixture verifies: (1) matrix scanning for all keys, (2) USB enumeration and VID/PID, (3) RGB and OLED functionality, (4) reset/bootloader access. These tests should be scripted to avoid manual errors. The test results should be logged and stored for traceability.
Firmware updates are another product requirement. Customers will expect easy updates for bug fixes or new features. This means you need a simple updater tool or clear documentation for QMK Toolbox/DFU flashing. For wireless devices, OTA updates might be required. In either case, firmware versioning and release notes are critical to avoid confusion.
Finally, documentation is part of QA. Clear assembly instructions, flashing guides, and troubleshooting docs reduce support burden. Production success depends on not just building the product but enabling customers to use and update it.
Additional QA depth: production testing should generate artifacts you can audit later. Assign a serial number to each board and log test results with timestamps and firmware version. For firmware QA, create golden reference tests that compare scan timing and USB descriptors against known-good baselines. Automate regression tests so that a change in firmware or hardware immediately flags inconsistencies. Finally, include a simple customer-facing update tool and clear recovery steps so that firmware updates do not create support tickets.
Extra QA depth: build a small firmware “factory mode” that reports raw matrix positions and hardware IDs over USB serial or HID feature reports. This allows automated test stations to verify each key without relying on OS key mapping. Record QA results in a database or CSV per unit so you can trace failures back to specific batches. If you sell wireless models, add a battery and charging test step to the QA pipeline.
Additional release discipline: treat firmware builds as reproducible artifacts. Use deterministic build flags and embed version metadata into the firmware so customer support can identify versions quickly. For critical releases, sign firmware binaries or provide checksums so users can verify integrity. A lightweight release checklist reduces the chance of shipping a broken build.
How this fits on projects
This concept is the culmination of Projects 4-10 and the core of Project 11.
Definitions & key terms
- Userspace: Shared QMK configuration across keyboards.
- Test jig: Hardware fixture for production testing.
- CI pipeline: Automated build and test system.
- SKU: Distinct product variant.
Mental model diagram (ASCII)
Shared firmware core
|-- Model A config
|-- Model B config
|-- Model C config
CI builds each -> QA tests -> release artifacts
How it works (step-by-step, with invariants and failure modes)
- Define shared firmware core and per-model configs.
- Build each model in CI with fixed versions.
- Run automated tests and size checks.
- Use test jig to validate hardware.
Invariant: each model build must be reproducible. Failure modes include config drift and untested variants.
Minimal concrete example
CI pipeline:
- build model60
- build model65
- build split
- upload artifacts with version tags
Common misconceptions
- “Manual testing is enough”: It doesn’t scale to production.
- “One firmware fits all”: Hardware differences require configuration.
- “QA is only software”: Hardware QA is equally important.
Check-your-understanding questions
- Why use a shared userspace in QMK?
- What does a production test jig validate?
- Why is CI important for firmware variants?
Check-your-understanding answers
- It centralizes shared logic and reduces duplication.
- Matrix scanning, USB enumeration, LED/OLED, and reset.
- It ensures consistent builds and prevents human error.
Real-world applications
- Keyboard manufacturers with multiple models.
- Embedded products requiring firmware QA.
Where you’ll apply it
- In this project: §3.2 Functional Requirements and §5.10 Phase 2.
- Also used in: Project 10.
References
- “Clean Architecture” Ch. 5-8.
- QMK docs: userspace and CI examples.
Key insights
Scaling a product line is a software and process problem as much as hardware.
Summary
Modular firmware and rigorous QA are what turn a prototype keyboard into a reliable product line.
Homework/Exercises to practice the concept
- Design a CI pipeline that builds three keyboard variants.
- Draft a QA checklist for production testing.
Solutions to the homework/exercises
- Use a matrix build in GitHub Actions to compile each model.
- Include matrix scan, USB enumeration, LED/OLED, reset checks.
3. Project Specification
3.1 What You Will Build
A complete product line blueprint including:
- Three keyboard models with shared hardware standards.
- A shared firmware codebase with build variants.
- A production test jig plan and QA checklist.
3.2 Functional Requirements
- Hardware standardization: shared MCU, USB, power.
- Firmware modularity: shared userspace and per-model configs.
- CI builds: automated firmware builds for each SKU.
- QA process: documented tests and pass/fail criteria.
3.3 Non-Functional Requirements
- Reliability: QA catches >95% of failures.
- Scalability: adding a new model requires minimal changes.
- Maintainability: shared modules documented and versioned.
3.4 Example Usage / Output
Product Line Summary
Model 60: USB-C, QMK/VIA
Model 65: USB-C, QMK/VIA
Model Split: OLED + RGB
QA Checklist:
- Matrix scan verified
- USB enumeration verified
- RGB/OLED tests passed
3.5 Data Formats / Schemas / Protocols
- CI build manifests, BOMs, QA checklists.
3.6 Edge Cases
- Firmware variants drift over time.
- Supply chain issues with MCU availability.
- QA process too slow for production volume.
3.7 Real World Outcome
A documented, repeatable process that produces consistent keyboards across models.
3.7.1 How to Run (Copy/Paste)
# Example CI build matrix (conceptual)
make model60
make model65
make model_split
3.7.2 Golden Path Demo (Deterministic)
- CI produces three firmware artifacts with version tags.
- Test jig validates 100% of keys in under 60 seconds.
3.7.3 If CLI: exact terminal transcript
$ make model60
Build successful
exit_code=0
$ make model65
Build successful
exit_code=0
$ make model_split
Build successful
exit_code=0
$ make unknown
error: target not found
exit_code=2
4. Solution Architecture
4.1 High-Level Design
Hardware design system -> Variants
Firmware core -> Config variants -> CI builds
Test jig -> QA results -> Release
4.2 Key Components
| Component | Responsibility | Key Decisions |
|---|---|---|
| Hardware system | Shared modules and standards | MCU family, USB connector |
| Firmware system | Shared core + per-model configs | Userspace + build flags |
| QA system | Automated tests and jig | Test coverage, logging |
4.3 Data Structures (No Full Code)
variants.yaml: model60, model65, split
4.4 Algorithm Overview
Key Algorithm: Variant Build
- Load variant configuration.
- Build firmware with flags.
- Run size and lint checks.
- Publish artifact.
Complexity Analysis:
- Time: O(n) variants
- Space: O(1) per build
5. Implementation Guide
5.1 Development Environment Setup
git, qmk, kicad, python
5.2 Project Structure
product-line/
├── hardware/
│ ├── modules/
│ └── variants/
├── firmware/
│ ├── userspace/
│ └── keyboards/
└── qa/
├── jig/
└── checklist.md
5.3 The Core Question You’re Answering
“How do I scale from a one-off keyboard to a reliable product line?”
5.4 Concepts You Must Understand First
- Hardware standardization and pin maps.
- Firmware modularity and build variants.
- QA testing and production processes.
5.5 Questions to Guide Your Design
- What must be identical across all models?
- What features are optional without creating support issues?
- How will you test each unit quickly?
5.6 Thinking Exercise
List the top five reasons a customer would return a keyboard and how your QA process prevents them.
5.7 The Interview Questions They’ll Ask
- How do you manage firmware variants at scale?
- What does a production test jig validate?
- How do you ensure consistent hardware across models?
5.8 Hints in Layers
Hint 1: Standardize MCU and pin map Reuse the same MCU family across models.
Hint 2: Build a shared userspace Keep common features in one place.
Hint 3: Automate builds Use CI to create artifacts for each model.
Hint 4: Create a test firmware mode Add a factory test mode that reports each key.
5.9 Books That Will Help
| Topic | Book | Chapter |
|---|---|---|
| Architecture | “Clean Architecture” | Ch. 1-8 |
| Embedded reliability | “Making Embedded Systems” | Ch. 7-8 |
| Build systems | “The GNU Make Book” | Ch. 6-8 |
5.10 Implementation Phases
Phase 1: Hardware Platform (4-6 weeks)
Goals: define shared hardware modules
Tasks:
- Select MCU family and USB connector.
- Build schematic module library.
Checkpoint: Module library documented and approved.
Phase 2: Firmware Platform (4-6 weeks)
Goals: shared firmware and CI builds
Tasks:
- Create shared userspace.
- Set up CI build matrix.
Checkpoint: CI builds all variants.
Phase 3: QA and Production (4-6 weeks)
Goals: test jig and QA process
Tasks:
- Build a pogo-pin test jig.
- Write automated test scripts.
Checkpoint: Each unit passes tests in under 60 seconds.
5.11 Key Implementation Decisions
| Decision | Options | Recommendation | Rationale |
|---|---|---|---|
| MCU family | AVR vs ARM | ARM | more headroom |
| Build system | manual vs CI | CI | reproducibility |
| QA strategy | manual vs automated | automated | scales with production |
6. Testing Strategy
6.1 Test Categories
| Category | Purpose | Examples |
|---|---|---|
| Firmware Tests | Compile and size checks | CI build matrix |
| Hardware Tests | Key matrix verification | test jig scanning |
| QA Tests | End-to-end validation | USB enumeration, LEDs |
6.2 Critical Test Cases
- Every key registers in test mode.
- USB enumerates with correct VID/PID.
- RGB/OLED features pass visual tests.
6.3 Test Data
QA checklist: matrix, USB, LEDs, reset
7. Common Pitfalls & Debugging
7.1 Frequent Mistakes
| Pitfall | Symptom | Solution |
|---|---|---|
| Firmware drift | Inconsistent behavior | Centralize configs in userspace |
| Incomplete QA | High return rates | Expand test coverage |
| Supply chain changes | Unexpected failures | Approved component list |
7.2 Debugging Strategies
- Version every firmware build with commit hash.
- Track QA results per serial number.
7.3 Performance Traps
Over-customizing variants increases support burden. Keep variants minimal and documented.
8. Extensions & Challenges
8.1 Beginner Extensions
- Add QR code labels linking to firmware updates.
- Add a quick-start guide.
8.2 Intermediate Extensions
- Add automated regression tests for keymaps.
- Add a firmware updater tool.
8.3 Advanced Extensions
- Implement OTA updates for wireless models.
- Add telemetry for field failure analysis.
9. Real-World Connections
9.1 Industry Applications
- Hardware startups with multiple product SKUs.
- Consumer electronics manufacturing pipelines.
9.2 Related Open Source Projects
- QMK userspace repositories.
- Open-source keyboard manufacturing guides.
9.3 Interview Relevance
- Demonstrates product engineering and systems thinking.
10. Resources
10.1 Essential Reading
- “Clean Architecture” Ch. 1-8.
- “Making Embedded Systems” Ch. 7-8.
10.2 Video Resources
- Hardware production and QA talks.
10.3 Tools & Documentation
- GitHub Actions CI, QMK build tools.
10.4 Related Projects in This Series
- Project 7: hardware foundation.
- Project 10: firmware architecture.
11. Self-Assessment Checklist
11.1 Understanding
- I can explain a hardware design system.
- I can describe how QA prevents returns.
11.2 Implementation
- CI builds produce versioned artifacts.
- Test jig validates all keys.
11.3 Growth
- I can scale firmware across multiple models.
12. Submission / Completion Criteria
Minimum Viable Completion:
- Documented hardware standard and pin map.
- CI build pipeline for at least two models.
Full Completion:
- Production test jig plan and QA checklist.
- Shared firmware core with variants.
Excellence (Going Above & Beyond):
- OTA updates for wireless models.
- Field failure tracking and analytics.