Keyboard Builders' Digest
Save 5% at Mechboards! Code: KBDNEWS5 [all coupons]
Keyboard Builders' Digest / Projects

Hello Word Smart Keyboard

Peng Zhihui designed a feature-packed modular keyboard with a motor-controlled haptic knob – and a lot more.

KBD.news
Published July 31, 2022

Based in Shanghai, Peng Zhihui seems to be a prolific engineer working at Huawei Research and publishing projects from autonomous bicycles to robotic arms.

Dipping his toes into custom keyboards, he kicked the door open with a quite unique keyboard packed with lots of features, one he calls HanWen or "Hello Word Smart Keyboard" in English.

Being tired of the mk keyboard scene focusing on design and aesthetics, he decided to ensure the maximum degrees of freedom for development by designing the hardware and firmware from scratch.

Features

  • Shift registers to implement key scan
  • ultra-low latency custom firmware
  • replaceable interactivity module
  • e-ink display
  • OLED display
  • motorized knob with configurable feedback
  • capacitive touch bar

PCB & matrix

To reconstruct the scan circuit from its basics, he came up with using shift registers. The keyboard still scans the keys the same way as common boards with matrices do. However, instead of using an m x n matrix Zhihui adopted a 1 x n matrix which utilizes the parallel to serial function of the shift registers.

Pic:

As mentioned in the video, every key is one bit of the register so we can read every key's status every time a clock sequence is loaded.

This solution saves a lot of IO pins: no matter how many keys we have, only three GPIO pins are used – one data wire, one clock wire, and one latch wire.

As of my understanding, we need a relatively cheap and easily available shift register for every 8 keys – or whatever component we have.

Pic:

The second advantage is extreme speed: The maximum speed of 74HC165 series circuits exceeds 50MHz (48-56MHz).

Another benefit of this approach is the simple circuit layout which eliminates all diodes.

Custom firmware

Zhihui also tried to address the shortcomings of existing firmware projects which in his opinion are too complex, not optimized enough – as a result of being compatible with many keyboard types.

So based on an ARM MCU (STM32F103CBTx (LQFP48)) he developed a suite of keyboard firmware which basically "releases the performance of full-speed HID devices to the limit".

In the firmware he implemented HD device enumeration resulting in 1ms latency and extreme per-key RGB refresh rate with NKRO support. What's more interesting though: also per-key debounce algorithm for all keys.

The firmware's source will be released later.

Hardware

The base keyboard layout is not too intuitive, it's pretty convenient and modeled after one called S98 by XiKii. However, it is modular and consists of three parts.

Apart from the main keyboard, there's a USB-Hub deck with some power boost capabilities, and also a replaceable interaction module.

Interaction module

The interaction module can run various apps.

Obviously, it has an e-ink screen which can display a wallpaper, weather forecast, computer status, or quite anything you'd like. The author provides some easy-to-use apps for this keyboard, e.g. you can simply drag and drop images you want to see on the screen.

Pic:

The keyboard also features a smaller OLED screen and a motorized knob with haptic feedback.

In a previous video the Zhihui demonstrated how to simulate a physical knob with a brushless motor and FOC control.

The knob can simulate force feedback effects from frictionless rotation to acting as a multilevel switch, spring, etc. – all this with configurable parameters.

Pic:

Combined with the small OLED screen there are a lot of different ways to use this feature, and don't forget that it's a motor so you can also use it as a pointer along with a scale displayed on the screen.

Some problems had to be solved for this to work, e.g. the power limitations of the USB, but the author managed to borrow an idea from the electromagnetic catapult of aircraft carriers...

Capacitive touch bar

In addition, the author put a capacitive touch bar below the spacebar with user-defined functions: switching desktops, tabs, music – it can be used even for copy/pasting.

Pic:

Resources

Both the hardware and firmware will be open sourced later: https://github.com/peng-zhihui Until then, try to process all the info above. :D

Aaand it's out: https://github.com/peng-zhihui/HelloWord-Keyboard

Published on Sun 31st Jul 2022. Featured in KBD #89 (source).


Did you like reading this post?

Donate to keep this project alive


Related

PD_DECK

PD_DECK is a hot macropad by Monksoffunk primarily to control Lightroom.

Self-aligning 3D gaskets

A self-aligning 3D gasket posted by machine0.

Keyboards recessed into the desktop

The question of keyboards recessed into the desktop raised by LipsLikeCrispyBacon, and some immediate warnings.

Plinky, a PCB-synth

Plinky is an 8-voice polyphonic touch synthesiser that specialises in melancholic sounds.

Mason60 - Art Series

Sneak peek into how the Mason60 keyboard cases and wrist rests are made.

Cocot46

The cocot46 is a homebrew keyboard with an integrated trackball and rotary encoder.

×