Improving the Firmware of ANAVI Macro Pad 10, ANAVI Knobs 3 and ANAVI Knob 1

There are two different options for mechanical keyboard open source firmware for ANAVI Macro Pad 10, Knobs 3, and Knob 1: KMK and QMK. Both of which have been getting upgrades recently!

KMK is a feature-rich and beginner-friendly open source firmware for mechanical keyboards, written in CircuitPython, which comes preloaded on the Macro Pad 10 and Knobs 1 and 3. The source code is available on GitHub under the GPLv3 license. So… if you have code suggestions to make it better, just open a GitHub pull request. This is exactly what Stefan Misch recently did, by improving the encoder resolution.

ANAVI Macro Pad 10, ANAVI Knobs 3 and ANAVI Knob 1

Huge thanks to Stefan for his valuable contribution to the upstream of KMK! If you own Macro Pad 10, Knobs 3, and Knob 1, please consider upgrading the KMK firmware on your mini mechanical keyboard to get his fix.

In other news: the GitHub pull request that adds support for ANAVI Knobs 3 was finally merged in QMKQMK stands for Quantum Mechanical Keyboard. It is probably the most popular firmware for mechanical keyboards and supports literally hundreds of devices, including ANAVI Macro Pad 8 and our other mechanical keyboards. The source code is available under GPLv2 license and written in C. Initial support for the Raspberry Pi RP2040 microcontroller in QMK was added in September 2022. We started the porting efforts in October, and shortly after that, patches for ANAVI Macro Pad 10 and Knob 1 were merged. However, it took almost 6 months to merge the GitHub pull request for ANAVI Knobs 3. The long wait is over: now all of our mini mechanical keyboards are supported by QMK!

ANAVI Knobs 3

The community is very important and makes all the difference in any open source project. Thank you for supporting and improving our open source hardware mechanical keyboards!

Macro Pad 10, Knobs 3 and Knob 1 are OSHWA-Certified!

Great news! The Open Source Hardware Association (OSHWA) has officially certified ANAVI Macro Pad 10, ANAVI Knobs 3 and ANAVI Knob 1. OSHWA is a non-profit entity registered in the US that organizes the annual Open Hardware Summit and maintains the Certified Projects Directory.

ANAVI Macro Pad 10, ANAVI Knobs 3, ANAVI Knob 1
ANAVI Macro Pad 10, ANAVI Knobs 3, ANAVI Knob 1

As part of the certification program, OSHWA ensures that the definition of “open source hardware” used by a specific project (in our case in these 3 mini mechanical keyboards) matches the community’s definition of open source hardware. They provide a unique identification number (UID) for each version of the certified open hardware device based on the country code and a number. So now we have:

The prefix BG is the country code for Bulgaria, because all these mini mechanical keyboards are made in my hometown of Plovdiv, Bulgaria. As truly and entirely open source projects, we also go one step further. Only free and open source software has been used to design the printed circuit board, the stickers, the firmware, and the documentation. In previous updates we explained how we use KiCad for designing the printed circuit boards and the open source firmware QMK and KMK written in CircuitPython.

ANAVI Macro Pad 10
ANAVI Macro Pad 10

One more thing: this year’s open source hardware summit will be held in New York on April 28 and 29th. You can attend remotely and in person. So make sure to mark the dates on your calendar!

ANAVI Macro Pad 10 & Knobs Shipping Soon

Happy New Year and best wishes for 2023! January starts with good news. All Macro Pad and Knobs kits were shipped to Crowd Supply’s warehouse for distribution.

In the coming weeks, all orders placed during the crowdfunding period will enter into Crowd Supply’s fulfillment system and will be processed soon. Shipping to all backers should begin shortly. After that ANAVI Macro Pad 10, ANAVI Knobs 3 and ANAVI Knob 1 will be in stock at Mouser and Crowd Supply.

Thank you for supporting open source hardware products like ANAVI Macro Pad 10, Knobs 3 and Knob 1! W’ll keep posting updates with technical information and we hope you will have a lot of fun with your new gear!

Is CircuitPython Suitable for Mechanical Keyboards?

Is CircuitPython suitable for mechanical keyboards? Yes, absolutely!  KMK firmware for mechanical keyboards is writen in CircuitPython and we use it of ANAVI Macro Pad 10 and Knobs.

ANAVI Knob 1, ANAVI Knobs 3 and ANAVI Macro Pad 10

1991 was a remarkable year for computer science and the open source movement. On February 20th, Guido van Rossum released the first version of Python and then, several months later on August 25th, then 21-year old Linus Torvalds announced the first version of what would become Linux. Now, 31 years later, both projects are more popular than ever!

ANAVI Knob 1, ANAVI Macro Pad 10 and ANAVI Knobs 3

Python is a general-purpose programming language. It supports both object-oriented programming and structured programming which makes Python suitable for a broad range of tasks. MicroPython and CircuitPython are Python 3 variants optimized for constrained devices, primarily microcontrollers. MicroPython appeared in 2014. Three years later, in July 2017, MicroPython was forked into another open source project called CircuitPython. There are some differences, most notably that each of them supports a different set of hardware devices.

CircuitPython is very simple to use. The idea is for it to be accessible to students and beginners. Its development is supported by Adafruit Industries. CircuitPython runs on Raspberry Pi RP2040 microcontrollers and, as you know from our previous update, ANAVI Macro Pad 10, ANAVI Knobs 3 and ANAVI Knob 1 all rely on the XIAO module from Seeed Studio with RP2040.

ANAVI Macro Pad 10

A classical mechanical keyboard consists of keys (mechanical switches with keycaps) wired to a microcontoller. There are a huge variety of models, variants, and manufacturers of mechanical switches. For example, the ANAVI Macro Pad 10 comes with Gateron red mechanical switches, but the hot-swap sockets allow you to actually use any other kind of Cherry MX compatible switch. Firmware on the microcontroller maps the keys to specific characters.

Hot-swap mechanical switches on ANAVI Macro Pad 10

In general, a microcontoller has a limited number of GPIO (general-purpose input/output) pins, so the keys are most commonly organized in a matrix. For example, ANAVI Macro Pad 10 is designed with a three-by-three matrix which only requires six GPIO pins instead of nine. The role of the firmware is to detect when a key is pressed and then send a specific character or sequence of characters (i.e., a macro) to the computer.

Front and back of ANAVI Macro Pad 10

Ease of use combined with the power of the RP2040 makes CircuitPython a very good programming framework for implementing mechanical keyboard firmware. Of course CircuitPython is not as fast as C. However this is not a problem for the RP2040 because it is a dual-core Arm Cortex-M0+ processor with a clock running up to 133 MHz. Furthermore RP2040 has 264kB on-chip SRAM – more than enough for keyboard firmware. Thanks to the powerful microcontoller, it is easy to get started and customize keyboard behavior directly by altering the CircuitPython source code. There is no need to install complex toolchains or to cross-compile the source code. With KMK, it is easy to edit the source code in CircuitPython on pretty much any operating system, no matter if you are a Microsoft Windows, MacOS or a GNU/Linux user.

Of course, since ANAVI Macro Pad 10, ANAVI Knobs 3 and ANAVI Knob 1 are entirely open source projects, you have the freedom to replace the default firmware with whatever you like, no matter if it is KMK, QMK or anything else!

ANAVI Macro Pad 10 & Knobs are Funded!

The launch of our crowdfunding campaign was a blast! ANAVI Macro Pad 10, ANAVI Knobs 3, and ANAVI Knob 1 were all fully funded and all stretch goals were met in the first week. Thanks to all backers and Crowd Supply for bringing life to these three entirely open source projects!

As part of the covered stretch goals, each kit will include stickers from ANAVI Technology and KiCad, the free and open source CAD software used for designing the printed circuit boards of the keyboards. Furthermore, ANAVI Macro Pad 10 kits will include 32 super-cool emoji stickers. You can stick them on the top or sides of the translucent keycaps. Last but not least, we’ll be publishing various video tutorials to ensure getting started is easy.

One more thing… Recently, our mini mechanical keyboards were featured in an article by CNX Software. This is a very popular website with news and tutorials about embedded systems, makers, and open source hardware. It was started in 2010 by Jean-Luc Aufranc. By the way it is worth keep an eye on CNX Software because there are always news about interesting gadgets!

ANAVI Macro Pad 10 and Knobs are Here!

One, two, three new products! After several months of development we are happy to present you 3 new open source hardware mini mechanical keyboards and knobs. The crowdfunding campaign started on Monday!

ANAVI Knob 1, ANAVI Knobs 3 and ANAVI Macro Pad 10

ANAVI Macro Pad 10, ANAVI Knobs 3 and ANAVI Knob 1 all come with gold-plated black printed circuit boards, Raspberry Pi RP2040 microcontrollers, USB-C connector and clickable rotary encoders. The popular open source KMK firmware allows you to easily program and configure custom keyboard layouts and macros using CircuitPython.

ANAVI Knobs 3

Once again we rely on Crowd Supply for the crowdfunding. The campaign has a very modest goal of just $1 and it has been already funded. Our plan is to make the keyboards in Plovdiv, Bulgaria, EU thanks to the trusted supply chain we have established throughout the years. We hope you will jump in and help us bring these entirely open source mechanical keyboards to life!

ANAVI Knob 1, ANAVI Macro Pad 10 and ANAVI Knobs 3

ANAVI Macro Pad 2 in a Home Automation Control Center

Do you remember our tiny keyboard with just 2 keys called ANAVI Macro Pad 2? Recently AE Chadwick used ANAVI Macro Pad 2 in his amazing home automation control center for his 1939 Minimalist Cottage.

ANAVI Macro Pad 2 in a Home Automation Control Center
ANAVI Macro Pad 2 mounted below a Stream Deck

AE Chadwick ran new wiring straight up into the ceiling and through one wall to connect to his home media server. Stream Deck is the primary interface and ANAVI Macro Pad 2 fits below it. Our open source hardware 2-key keyboard has a simple but important task in this complex setup to perform the feature ” “tap any key to wake the computer.”

3D printed parts to hold ANAVI Macro Pad 2

AE Chadwick also designed a panel cut with CNC and 3D printed parts to hold the electronic gadgets. He was kind enough to share his experience in a Crowd Supply Field Report.

AE Chadwick, thank you for using ANAVI Macro Pad 2 and for sharing details about your project with us! It looks amazing!

ANAVI Macro Pad 10 and Knobs Coming Soon

With Crowd Supply we are preparing a new crowdfunding campaign for 3 open source hardware mechanical keyboards: ANAVI Macro Pad 10, ANAVI Knobs 3 and ANAVI Knob 1.

ANAVI Macro Pad 10, ANAVI Knobs 3 and ANAVI Knob 1

There are many common things between these 3 mini mechanical keyboards:

  • Seeed XIAO RP2040 – a power module with USB-C and Raspberry Pi RP2040 MCU from Seeed Studio
  • Rotary encoders
  • KMK – an open source firmware for mechanical keyboards written in CircuitPython
  • Open source hardware designed with the free and open source software KiCad

Subscribe at our pre-launch page at Crowd Supply to be the first to know when we launch the crowdfunding campaign!

ANAVI Info uHAT Manufacturing Progress

Thanks to the support of all backers at Crowd Supply, ANAVI Info uHAT has been successfully funded and has hit all stretch goals so we proceed with manufacturing. This week we received from the local factory the first batch of almost fully assembled boards. Only the EEPROM is missing. We will flash and solder it in-house.

The printed circuit boards still on panels before adding the EEPROM

The printed circuit board of ANAVI Info uHAT has a green solder mask and a gold surface finish. There are a few steps more to complete the manufacturing process. An EEPROM has to be flashed and soldered on each board. It will contain software description of the add-on board following Raspberry Pi Foundation’s HAT (Hardware Attached on Top) specifications. After that each board will go through a quality assurance, and finally each kit will be packaged in a recyclable cardboard box.

Panels with ANAVI Info uHAT

Low-volume manufacturing is not an easy task nowadays, especially during a global chip shortage. As usual we will keep you updated. Thank you again for supporting ANAVI Info uHAT!

Exploring I2C buses on ANAVI Info uHAT

I2C stands for Inter-Integrated Circuit, pronounced eye-squared-C, and alternatively known as IIC. It is a synchronous, multi-controller/multi-target (controller/target), packet switched, single-ended, serial communication bus. This protocol is suitable for devices wired at short distances, no more than 2-3m. We use I2C in pretty much all our open source products: Internet of Things, mechanical keyboards and Raspberry Pi HATs.

Anavi Info uHAT
I2C sensor modules attached to ANAVI Info uHAT

I2C was originally developed in 1982 by Philips. While that makes it 40 years old, it is still a very convenient and widely used bus. There are many I2C sensors and peripherals. It is in pretty much every smartphone, embedded electronics, microcontroller, personal computer and of course Raspberry Pi.

ANAVI Info uHAT with 4 slots for I2C sensors and mini OLED dsiplay

Actually, since the introduction of the famous 40-pin header in 2014, Raspberry Pi single board computers have not one but two I2C buses! We use them both on ANAVI Info uHAT and our other HATs. Th first I2C bus is on pins 3 and 5. On the ANAVI Info uHAT, it is used for the three I2C slots for sensors and the 4th dedicated slot for the mini OLED display.

The I2C bus on ANAVI Info uHAT in KiCad’s Schematic Layout Editor.

The second I2C bus is on pins 27 and 28 of the Raspberry Pi and is reserved exclusively for attaching an ID EEPROM. The ID EEPROM contains a software description of the hardware so the operating system on your Raspberry Pi can automatically identify the add-on board.

The EEPROM on ANAVI Info uHAT attached on the 2nd I2C bus

The I2C bus consists of two signals: SDA (Serial Data) is a data signal, SCL (Serial Clock) is a clock signal. I2C modules also need power, so the dedicated I2C connectors on the ANAVI Info uHAT and our other open source hardware provide two additional pins for VCC and GND. Typically, the VCC for the I2C connectors on our add-on boards for Raspberry Pi are 3.3V.

The I2C bus drivers are “open drain”, which means they can only pull the corresponding signal line at low level. They cannot drive it high. To restore the signal to high when no device is asserting it low, a pull-up resistor has to be added to each signal line. For example, on the ANAVI Info uHAT, we have 4.7K pull-up resistors R4 and R5 connected to SDA and SCL.

Resistor selection varies depending on the devices attached to the bus. In some specific use cases, further adjustment of the resistance value might be required. For systems with lots of devices or longer wires, smaller resistors are better.

How to Enable I2C on Raspberry Pi OS

Raspberry Pi OS, previously known as Raspbian, is the default and recommended Linux distribution for all models and versions of the Raspberry Pi single board computer. By default, I2C is not enabled. There are several ways to enable it, but probably the easiest is using the command-line tool raspi-config to perform few basic commands:

  • Open a terminal or login remotely via SSH to your Raspberry Pi and type in the following command: sudo raspi-config
  • Select Interfacing Options > I2C and enable it
  • Reboot the board

More details are available in the user’s manual for the ANAVI Info uHAT.

I2C Addresses

Each I2C device must have a unique address. The I2C reference design has a 7-bit address space, although rarely it might be used with a 10-bit extension. The 7-bit addresses range from 0 to 127 (0 to 0x7F hexadecimal). This is a limitation because it is not possible to have two I2C devices with the same address on the same I2C bus. For example, the I2C address on the mini OLED display included in all ANAVI Info uHAT kits is 0x3C. From the software side, this address is used in the example Python 3 script to access the display.

Python3 script controlling the mini OLED display over I2C on ANAVI Info uHAT

For Linux distributions, including Raspberry Pi OS, there is a package with a heterogeneous set of I2C tools called i2c-tools. To install it on Raspberry Pi OS, open a terminal and execute: sudo apt install -y i2c-tools. Once you have it installed, you can list attached I2C devices by their addresses with i2cdetect. For example, if the HTU21 temperature and humidity sensor module is attached to the Raspberry Pi, the output will be:

pi@raspberrypi:~ $ sudo i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: 40 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

I2C Sensors and Peripherals

I2C Sensors and Peripherals

ANAVI Info uHAT officially supports the following I2C devices:

  • Mini OLED SSD1306 0.96″ display
  • HTU21D sensor for temperature and humidity
  • BH1750 sensor for light
  • BMP180 sensor for barometric pressure

Some of the other popular I2C sensor modules in maker community include:

  • APDS-9960 sensor for RGB color and gesture detection
  • BME680 for temperature, humidity, pressure and gas sensor
  • MCP9808 for temperature
  • MPL115A2 for barometric pressure
  • ADT7410 for temperature
  • MPU-6050 for triple axis acccelerometer and gyroscope

Which is your favorite I2C device? Join the discussion and let us know on Twitter!