KMK: Harnessing the Potential of Open Source and CircuitPython to Energize Mechanical Keyboards

Within the realm of computer keyboards, a remarkable open-source firmware called KMK has surfaced, captivating enthusiasts from all corners. KMK possesses a potent capability to revolutionize mechanical keyboards into personalized instruments, enabling users to venture into uncharted territories of customization and productivity.

KMK Open Source Mechanical Keyboard Firmware Written in CircuitPython

CircuitPython is an open-source programming language that runs on microcontrollers used in various embedded applications, including mechanical keyboards like ANAVI Macro Pad 12 and ANAVI Arrows from our crowdfunding campaign at Crowd Supply. Built upon the foundations of Python, CircuitPython is specifically crafted to cater to the requirements of resource-limited embedded devices housing microcontrollers. One of the standout merits of CircuitPython lies in its user-friendly nature and effortless adaptability, particularly beneficial for newcomers who may not possess extensive coding expertise.

ANAVI Arrows and ANAVI Macro Pad 12 with the open source firmware KMK written in CircuitPython

The source code of KMK is readily available on GitHub, released under the GPLv3 license. The inception of KMK can be traced back to 2018. Notably, the KMK source code follows a coding style that employs the Python code formatter, known as Black, and embraces the usage of single quotes.

KMK firmware runs on Raspberry Pi RP2040 microcontoller which is in the core of Seeed Studio XIAO RP2040 module

The hardware requirements for microcontrollers to run KMK are: a minimum of 256KB of flash storage, support HID over USB and/or Bluetooth, CircuitPython version 7.0 or newer. With its impressive hardware capabilities, the Raspberry Pi RP2040 microcontroller is a perfect fit for CircuitPython and KMK. Because of this we selected Seeed Studio’s XIAO module with RP2040 for ANAVI Macro Pad 12 and ANAVI Arrows.

KMK offers many key features:

  • Key Mapping: Customize key assignments to suit individual preferences
  • Macros: Create and assign macros for automating tasks or executing commands
  • Layers: Define multiple virtual layers for accessing different functions or modes
  • LED Control: Customize backlighting and LED behavior
  • Rotary Encoder: Rotary encoders for various functions like volume control or scrolling.
  • Mini OLED Display: Compatibility with mini OLED displays, allowing users to display custom information or visuals on their keyboards
Back-light and under-light effects with KMK firmware on the mechanical keyboards ANAVI Macro Pad 12 and ANAVI Arrows

KMK supports many mechanical keyboards, including ANAVI Macro Pad 12 and ANAVI Arrrows. Although you are free to change to another firmware at any time, both ANAVI Macro Pad 12 and ANAVI Arrrows out of the box will come with KMK pre-installed.

You may also like

ANAVI Smiley Add-on Board for Raspberry Pi

ANAVI Smiley is a simple open source hardware add-on board for Raspberry Pi. It is compatible with any Raspberry Pi model or version. ANAVI Smiley has educational purposes: it is useful for learning how to solder and how to program. The simplicity of the board makes the kit appropriate for beginner. Example application written in Python shows how to use it.

Closer look at ANAVI Smiley after soldering the kit

ANAVI Smiley combines open source hardware with free and open source software. It has been certified by the Open Source Hardware Association under UID BG000061. ANAVI Smiley is available as a soldering kit with through-hole components:

  • Printed Circuit Board (PCB)
  • 2 LEDs
  • 2 resistors
  • Tactile button
  • Female connector
ANAVI Smiley soldering kit with all components

The color of the LEDs may vary. The primary kit includes with one green and another red LED, but there is also a kit with 2 yellow LEDs.

ANAVI Smiley with red and green LED as well another unit with 2 yellow LEDs

Have a look at the video for the exact steps how to solder ANAVI Smiley and to use it with Raspberry Pi.

A photo of ANAVI Smiley a moment after the kit has been assembled.

The short leg of the LED must go to ground (GND), aka the hole marked with a square on the printed circuit board. It is recommended to solder 4-pin connector on the opposite side, as shown on the picture. This way ANAVI Smiley will fit better on the 40-pin header of Raspberry Pi.

Python3 script to use ANAVI Smiley on a Raspberry Pi is available at GitHub. It relies on gpiozero to control the LEDs and to read the state of the button. Gpiozero is a simple and convenient Python interface to GPIO devices with Raspberry Pi, started by Ben Nuttall and Dave Jones.

Please note that SW1 button on the PCB doesn’t have a resistor, therefore your application must use the internal pull-up resistor present on each Raspberry Pi GPIO, for example with gpiozero in Python and pin 26:

btn = Button(26, pull_up = True, bounce_time=0.1)
ANAVI Smiley PCB in KiCad

ANAVI Smiley has been designed with the free and open source software tool KiCad. The whole KiCad project is also in GitHub. The two layer printed circuit board is made in Plovdiv, Bulgaria.

You may also like

ANAVI Miracle Controller Successfully Crowdfunded!

Hip hip hooray! The crowdfunding campaign of ANAVI Miracle Controller at Crowd Supply was successful. It ended on 5 February 2020. We met all stretch goals.

ANAVI Miracle Controller is an ESP8266-powered Wi-Fi dev board to control two 5 V or two 12 V addressable (digital) LED strips like WS2812B, WS2812, WS2811, etc. Furthermore, mini OLED display and up to 3 I2C sensors can be attached. It has been certified by the Open Source Hardware Association.

We have already started manufacturing. The first and second batches of boards are ready. Right now we are testing and packaging them. The estimated shipping date remains the same – Mar 30, 2020. In the meantime you can still place pre-orders at the same prices. Crowd Supply will take care of the shipping for all orders placed during the crowdfunding campaign and pre-orders.

You may also like