Two months of work finally comes to fruition. The first keyboard I designed and built from scratch, powered by RP2040. Everything is open-sourced.

This page summarizes the projects mentioned and recommended in the original post on /r/raspberry_pi

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • Pico-Keyboard

    Hardware design for a mechanical keyboard based on RP2040

  • This is my first attempt at designing a mechanical keyboard, and my second shot at PCB design. To me this is truly a "full stack" project: from PCB to case to firmware. The reason I wrote my own firmware is that I want to learn about how to program RP2040 and it's also an excuse to write a lot of code :). In terms of timing, it took roughly one month to do all the hardware stuff, and one month to write the code. For PCB, I went through at least four iterations to get to the current design. For the case I used up almost a whole spool of PLA to finally get everything fit nicely. It turned out my 3D printer (Ender 5) was playing tricks on me. Basically the carriage is slightly off from parallel (like in this video https://www.youtube.com/watch?v=Z3NR7mJ-P0E) that completely screwed up the fitness between parts. Building the firmware is pretty fun and I learned a lot in the process. For example, I finally figured out how USB HID works. I still remember how happy I was when config menu finally worked. The trickiest part of the firmware is perhaps writing to flash, for persisting the configs. On RP2040 you can't execute any code from flash when programming it. Since I'm using both cores of RP2040, I need to make sure the other core is not running anything from flash when one core is writing to it. FreeRTOS's taskENTER_CRITICAL is not sufficient because it doesn't immediately stop the other core, and Pico SDK's lock core isn't initialized by FreeRTOS. In the end I hacked up a high priority task that sits in SRAM and a bunch of locks to immediately block the second core (see storage.cc in the firmware repo). Overall the material cost for building one keyboard is $129.57. Please see here (https://github.com/zli117/Pico-Keyboard#overall-cost-breakdown) for the breakdown (Keycap is Akko clear translucent blue, knob is GMMK pro knob, and switch is Akko blue). Anyway, this is a really fun project and I've learned a lot along the way. Here's the repo for the hardware (https://github.com/zli117/Pico-Keyboard) and the repo for the firmware (https://github.com/zli117/PicoMK).

  • PicoMK

    Configurable firmware for RP2040 powered mechanical keyboard

  • This is my first attempt at designing a mechanical keyboard, and my second shot at PCB design. To me this is truly a "full stack" project: from PCB to case to firmware. The reason I wrote my own firmware is that I want to learn about how to program RP2040 and it's also an excuse to write a lot of code :). In terms of timing, it took roughly one month to do all the hardware stuff, and one month to write the code. For PCB, I went through at least four iterations to get to the current design. For the case I used up almost a whole spool of PLA to finally get everything fit nicely. It turned out my 3D printer (Ender 5) was playing tricks on me. Basically the carriage is slightly off from parallel (like in this video https://www.youtube.com/watch?v=Z3NR7mJ-P0E) that completely screwed up the fitness between parts. Building the firmware is pretty fun and I learned a lot in the process. For example, I finally figured out how USB HID works. I still remember how happy I was when config menu finally worked. The trickiest part of the firmware is perhaps writing to flash, for persisting the configs. On RP2040 you can't execute any code from flash when programming it. Since I'm using both cores of RP2040, I need to make sure the other core is not running anything from flash when one core is writing to it. FreeRTOS's taskENTER_CRITICAL is not sufficient because it doesn't immediately stop the other core, and Pico SDK's lock core isn't initialized by FreeRTOS. In the end I hacked up a high priority task that sits in SRAM and a bunch of locks to immediately block the second core (see storage.cc in the firmware repo). Overall the material cost for building one keyboard is $129.57. Please see here (https://github.com/zli117/Pico-Keyboard#overall-cost-breakdown) for the breakdown (Keycap is Akko clear translucent blue, knob is GMMK pro knob, and switch is Akko blue). Anyway, this is a really fun project and I've learned a lot along the way. Here's the repo for the hardware (https://github.com/zli117/Pico-Keyboard) and the repo for the firmware (https://github.com/zli117/PicoMK).

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts