There were three reasons why I decided to build this keyboard: Altium Designer, GTA Online ;) and desire to learn Zephyr RTOS. I often use Altium in my work and there is a lot of keyboard shorts. Of course you can click everything by menu, but this option is for much more patient people than I am :). When it comes to GTA, there is multi-level menu, which is not very comfortable to click through, especially when everyone is shooting at you. The keyboard was therefore to facilitate the operation of these two programs. One keystroke is supposed to replace the sequence of several keys, making our lives easier. Of course, nothing stands in the way of adding more programs to the keyboard. And the third reason - Zephyr. I think the best way to learn something new is making some project with this technology.
2. Short characteristic- 8 programmable buttons for one program
- 2 buttons for program changing
- Device visible in Windows as standard HID wireless keyboard
- IPS 1, 47'' color display
- Backlit keys
- Buzzer and vibration
- Move detection
- Power supply: standard Li-ion 3, 7V battery
- Charging: USB-C port
The device was designed in Altium Designer. It's built on the board of unique shape, which allows to fit in ten buttons and longitudinal color screen.
During the design process, there were several other ideas for shapes of the pcb.
After making final decision regarding shape I generated gerber files and sent it to producer. Finally PCB is two-layer and it was made in PCBWay. Fast and with no problems, as usual. Additionaly I designed and ordered stencil, to make assembly much more easier.
On the top side there are ten switches, where each key is backlit by RGB SK6805 LED. I used Kailh chock switches (www.kailhswitch.com) in my project. I have tested many types of buttons which producer have in offer, but I liked the white ones the most. They have characteristic "click" when push it. It sounds really cool :)
Characteristic hex caps are from FKcaps. When I saw them first time, I liked them so much that I immediately knew that I had to use them in my project.
Almost all components are on the bottom side. Device is powered by standard Li-ion 900mAh battery which is mounted to PCB in simple way - with hook&loop TESA tape. Battery is charging by USB-C connector thanks to STMicroelectronics STC4053 chip. USB port is for charging purpose only. There is no any USB class device after plug it into computer. Charging current is limited to 500mA.
Main power is 3V. It's delivered from Texas Instruments buck converter TPS62742. LEDs are powered from TI boost converter TPS61023, which provides 5V from battery voltage and it's switched on only when LEDs are in use. SK6805 seems to be a better choice than standard WS2812. In WS2812 case, there was annoying action, that LEDs accidentally blinks just after power on boost converter. There is no such problem with SK6805. LEDs power is switched off when they are not in use, to decrease power consumption. Vibration and buzzer are powered directly from battery.
I used 1, 47'' IPS display which is built on ST7789 driver. It has 320x240pix and it is drivered from 32MHz SPI bus. I used Zephyr build-in LVGL library. It takes a lot of RAM and Flash, but it has ready everything you want to display fancy screen. Various fonts, buttons, sliders, checkboxes and many others.
Keyboard is matrix type. It has three rows and four columns, scanned twenty times per second. It has debounce software mechanism.
Device is also equipped with accelerometer, which detects move and turns on the screen and buttons.
Main chip on the board is Nordic Semiconductor nRF52840 (64MHz Cortex-M4 with MPU, 1MB Flash and 256KB RAM). It's build in Laird Connectivity BL654 module. I choosed the bigest chip in 52 family because I though that will be the best way, considering the fact that I was going to use color display. It always require a lot of memory.
4. AssemblyAssembly was made by myself. Thanks to stencil I could easly apply the paste on bottom side, place elements and heat the pcb. For heating I'm using my hot plate based on Paul's project. Stove has a program with preheating, heating and cooling stages, so elements can be mounted in right way.
LEDs and switches on the other side I had to mount manually. LEDs pads could be bigger, especially when they are mounted by hands. It will be corrected in next PCB revision.
Casing has been made of five pieces of plexi, which has been cut with laser. The work was done at a local laser cutting company - materialylaser.pl Bottom and side part are made of black plexi. Top part is transparent. In the middle of side wall there is frozen-plexi part which distract led light from LEDs on the PCB. All midle plexi parts were welded together. PCB was mounted to the bottom part of casing with four M2 screw through 10mm long nylon distances. Top and bottom casing parts are screwed to the middle part with miniature screws.
Like most of bluetooth devices, keyboard is pairing with computer. After that it's available in system even after power off and power on PC. The keyboard is detected like a standard Bluetooth HID keyboard (name: BMK HID). Adding it to the system does not interfere with other keyboards in any way.
The keyboard works like a standard macro keyboard. Pressing one key, generates a sequence of pressing several keys pressed in sequence. A macro can consist of a sequence of up to 8 keys. Of course, shortcuts like ctrl+shift, ctrl+alt are supported. Pressing a key is confirmed by turning off its backlight for a short moment.
Two white backlit keys are used to switch between sets of shortcuts assigned to one program. Each of the programs is marked with the appropriate screen on the LCD and has its own color. At the moment, 3 sets of keys are programmed: Altium Designer, GTA ONLINE and Visual Studio Code. The other 8 keys can be programmed with macros.
After 30 seconds of inactivity, the display and LEDs on the keyboard turn off to save power. The bluetooth connection is maintained all the time and pressing a key will immediately send the corresponding key sequence to the PC. After that display and the LED backlight will be turn on again.
Charging is indicated by slowly pulsing green color. When fully charged, the keyboard lights up steady green. Charging the battery takes less than 2 hours.
One of the screen shows information about charging battery level and bluetooth connection status.
Place track in Altium:
Place dimmension in Altium:
Place string:
GTA Online, when you are hungry:
GTA Online, when you need new bulletproof vest:
GTA Online, when you need new car, you call to mechanic :)
GTA Online, when you have serious trouble call to Lester ;)
8. FirmwareGithub repository:
https://github.com/piotrvvilk/bmk_firmware
9. Schematics, gerbers, BOMGithub repository:
https://github.com/piotrvvilk/bmk_hack_hardware
10. SummaryThis is a first, basic version of device. Firmware will be still developed. I want to also make some small hardware changes.
Near future changes:
- better power saving,
- another way to assembling casing,
- next PCB revision, correcting small bugs,
- easy way to programming own key sequences,
- updating firmware over the air (OTA DFU),
Comments