Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

instructables

HotKeys Keyboard With Custom Profiles

by FabroLabs Technologies

I ho pe y o u a re do ing g o o d a m id t his Pa nde m ic. B e S a f e . B e St ro ng . # CO VID19

Being an Industrial Designer, I need to access more than 7-8 software which includes Solidworks, Photoshop,
Illustrator, Keyshot, Indesign, etc. on a daily basis and yes few games also. So, I experienced two issues from which
this device comes to its existence.

S ca t t e re d Ke y s - The complete hand travels over the keyboard in search of a key that exists at the
opposite corner like ESC and ENTER key. Similarly, there are more than 15 keys that I use only in
Solidworks and those are scattered all around the keyboard. So, instead of changing my keyboard
preferences, again and again, I looked for a mini keyboard that can be customized according my
needs. After having some research I found plenty of designs and codes which can do this task easily.
But as soon as I jumped on the second issue, I found that none of the design can eliminate that.
D i e re nt Funct io ns - The second issue was when I switch the program, most of the keys swap
their functions like Adobe Photoshop is doing zoom with ALT+Scroll but when I go to Adobe
Acrobat, zooming is done by CTRL+Scroll. Similarly, I don't want most of the keys in Keyshot which I
usually use in Solidworks. And, I never use arrow keys in Solidworks which are extremely required
while gaming.

So, I decided to build a HotKeys keyboard with a Rotary Knob and a cheap LCD to alter between di erent programs
with dedicated key mapping.

This Instructable is to simplify work ow and enhance productivity.

Let's hope you enjoy it and let's begin!

HotKeys Keyboard With Custom Profiles: Page 1


Step 1: COVID-19 Pandemic Lock-down - a Challenge to Source Components

The world is ghting with the COVID-19 pandemic and one-third of the population is under lockdown. In India, we
are also isolated in our homes and there is no possibility to order components for this project as most of the
commercial activities are halted. But, I have most of the components embedded in one or the other product.

I have a few damaged products, which includes:

HotKeys Keyboard With Custom Profiles: Page 2


TVS Gold Bharat keyboard for CherryMX Switches.
12864 Reprap Smart Display for Rotary Encoder and Potentiometer.
LCD Module for 1602 LCD
Other few components are recovered from previous projects.

Step 2: The Design

Complete Project is designed in Solidworks while keeping all the parameters for additive manufacturing, using o
the shelf-components.

HotKeys Keyboard With Custom Profiles: Page 3


Step 3: What Components We Need?

Electronic Components:

1x Arduino Micro
20x Cherry MX mechanical switch
1x 1602 LCD Module
1x Rotary Encoder

Hardware Components:

3x M3x8 Bolts
4x M3x5 Bolts

Tools:

3D Printer
M3 Allen Keys
Soldering Station
Glue Gun

HotKeys Keyboard With Custom Profiles: Page 4


Step 4: FDM 3D Printing

I printed keyboard body on FDM 3D Printer

My FDM 3D Printer Settings:

Material (PLA)
Layer Height (0.2mm)
Shell Thickness (1.2mm)
Fill Density (20%)
Print Speed (60mm/s)
Nozzle Temp (210°C)
Support Type (Everywhere)
Platform Adhesion Type (None)

You can download all the les that are used in this project -

Download
https://www.instructables.com/ORIG/F11/UC55/K8LSFYWP/F11UC55K8LSFYWP.stl

HotKeys Keyboard With Custom Profiles: Page 5


https://www.instructables.com/ORIG/FSA/ZS92/K8LSFYWQ/FSAZS92K8LSFYWQ.stl
… Download

Step 5: DLP 3D Printing

I printed caps which required higher details and smoother surface on DLP 3D Printer

My DLP 3D Printer Settings:

Layer Thickness (0.05mm)

You can download all the les that are used in this project -

Download
https://www.instructables.com/ORIG/F7X/2WCI/K8LSFYWO/F7X2WCIK8LSFYWO.stl

Download
https://www.instructables.com/ORIG/FHO/QWYF/K8LSFYWR/FHOQWYFK8LSFYWR.stl

Step 6: Assembly of Switches in the Keyboard Body

To assemble the switches we will need following parts:

HotKeys Keyboard With Custom Profiles: Page 6


1x Keyboard Body (3D Printed Part)
20x CherryMX Mechanical Switches

As described in the images, snap t all the switches in their respective places. No need of bolts or glue is required as
designing is done with all tolerances and all the components gets t on their own.

Step 7: Assembly of LCD in the Keyboard Body

To assemble the LCD we will need following parts:

1x Keyboard Body (3D Printed Part)


1x 1602 LCD
4x M3x5 Bolts

As described in the images, install the LCD in the respective place and x it using M3x5 bolts.

HotKeys Keyboard With Custom Profiles: Page 7


Step 8: Assembly of Rotary Encoder in the Keyboard Body

To assemble the Rotary Encoder we will need following parts:

1x Keyboard Body (3D Printed Part)


1x Rotary Encoder

As described in the images, install the Rotary Encoder in the respective place.

HotKeys Keyboard With Custom Profiles: Page 8


Step 9: Assembly of Arduino Micro in the Keyboard Body

To assemble the Arduino Micro we will need following parts:

1x Keyboard Bottom Part (3D Printed Part)


1x Arduino Micro

As described in the images, install the Arduino Micro in the respective place.

HotKeys Keyboard With Custom Profiles: Page 9


Step 10: Wiring

Follow the Schematic to wire all the electronics in the following way:

-----------------------------------------------
| Arduino Micro | LCD Module |
-----------------------------------------------
| VCC | VDD |
| GND | VSS |
| D4 | Register Select |
| D3 | Read/Write |
| D2 | Enable |
| A0 | Data 4 |
| A1 | Data 5 |
| A2 | Data 6 |
| A3 | Data 7 |
-----------------------------------------------

-----------------------------------------------
| Arduino Micro | Keypad Matrix |
-----------------------------------------------
| D9 | Column 1 |
| D8 | Column 2 |
| D7 | Column 3 |
| D6 | Column 4 |
| D5 | Column 5 |
| D15 | Row 1 |
| D14 | Row 2 |
| D16 | Row 3 |
| D10 | Row 4 |
-----------------------------------------------

-----------------------------------------------
| Arduino Micro | Rotary Encoder |
-----------------------------------------------
| D0 | Pad_A |
| D1 | Pad_B |
| GND | GND |
-----------------------------------------------

HotKeys Keyboard With Custom Profiles: Page 10


3

4
1
2

6 7 5 8 9
23 26 27 28 29

22 13 12 11 10
30 31 32 34 33

14 25 17 18 19
35 37 38 39 40

15 24 16 21 20
36 44 43 42 41

1. Arduino Micro
2. Rotary Encoder
3. 16X2 LCD Module
4. LCD Contrast Knob
5. Cherry Key
6. Cherry Key
7. Cherry Key
8. Cherry Key
9. Cherry Key
10. Cherry Key
11. Cherry Key
12. Cherry Key
13. Cherry Key
14. Cherry Key
15. Cherry Key
16. Cherry Key
17. Cherry Key
18. Cherry Key
19. Cherry Key
20. Cherry Key
21. Cherry Key
22. Cherry Key
23. Diode
24. Cherry Key
25. Cherry Key
26. Diode
27. Diode
28. Diode
29. Diode
30. Diode
31. Diode
32. Diode
33. Diode
34. Diode
35. Diode
36. Diode
37. Diode
38. Diode
39. Diode
40. Diode
41. Diode
42. Diode
43. Diode
44. Diode

HotKeys Keyboard With Custom Profiles: Page 11


Step 11: Arduino Micro Firmware

HID Int e r f a ce Firm w a re

For communicating with the Laptop/Computer via HID interface we'll be using Arduino Micro's ATmega32U4
microcontroller.

QMK (Quantum Mechanical Keyboard) is an open source community centered around developing computer input
devices. The community encompasses all sorts of input devices, such as keyboards, mice, and MIDI devices.

Instrunctions to follow:

1. Clone the QMK rmware from GitHub.


2. Prepare your build environment for compiling the rmware as instructed here.
3. Download and extract the given custom keyboard rmware in the qmk_ rmware/keyboards
directory cloned in the rst step.
4. Compile the keyboard rmware using the following command:
qmk compile -kb key5pro -km default
5. Download and install QMK toolbox for ashing the rmware. (QMK Toolbox)
6. Open QMK Toolbox and open the compiled rmware (.hex le) which can be found at
qmk_ rmware/.build directory, then select atmega32u4 as Microcontroller and check Auto-Flash
option.
7. Connect the Keyboard to PC via USB cable, now for ashing the keyboard put Arduino Micro into
bootloader mode which can be done by shorting the RST pin to GND.
8. After reseting the arduino, QMK toolbox automatically nds it and ash the rmware onto it.

HotKeys Keyboard With Custom Profiles: Page 12


Ke y m a ps Cus t o m iz a t io n

For customizing the keymaps, encoder functions, LCD functionality & pro le management modify the
key5pro/keymaps/default/keymap.c le.

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {};

This array contains the di erent layers of a keymap which can be used as di erent pro les. Each pro le or layer can
be set with di erent keycodes, macros or functions. (List of Keycodes)

void encoder_update_user(uint8_t index, bool clockwise);

This function callback will be excuted every time the encoder is triggered, this callback handles the functioning of
the rotary encoder.

lcd_clrscr(); // clear the lcd


lcd_gotoxy(column, row); // goto position
lcd_puts(""); // display data

These functions are used to operate the 16X2 LCD module which can be used to display the operation speci c
information to the user.

Download
https://www.instructables.com/ORIG/FA3/9WDO/KC93736Q/FA39WDOKC93736Q.rar

Step 12: Complete the Assembly

To Complete the assembly, we will need following parts:

HotKeys Keyboard With Custom Profiles: Page 13


1x Keyboard Body(3D Printed Part)
1x Keyboard Bottom Part (3D Printed Part)
1x Rotary Encoder Cap (3D Printed Part)
20x CherryMX Round Cap (3D Printed Part)

As described in the images, plug all the caps on switches and the rotary cap on encoder. Then, close the bottom
part and fasten it with M3x8 bolts.

Step 13: And We're DONE !!

You're nally done! Here's how the nal product should look and work like.

W e ' re pro ce s s ing t he v ide o a nd w ill upda t e it in ne xt 24 ho urs .

HotKeys Keyboard With Custom Profiles: Page 14


Step 14: Please VOTE !

If you like this project, please vote for the "Trash to Treasure" Contest.

Really much appreciated! I hope you guys enjoyed the project!

HotKeys Keyboard With Custom Profiles: Page 15


The code has the display RS and EN lines swapped on the Arduino Micro. The display won't
function that way. Swap D4 and D2 connections on the micro to make it work.
Firmware updated.
Thanks
Any details on the diodes used? Did not mention them in the list of items needed.

Like 99% of the Handwired Keyboards use the 1N4148 diodes

Yep found the answer a day after my post. Have completed a couple of these... then fell down the
rabbit hole and have handwired a planck, a dactyl manuform, and so on...
I think you can use 1N4148

I keep getting this error. What does it mean?

It looks like you didn't setup QMK right...


You have to point it to the direction where your qmk_firmware clone is

Than you have to copy the content of the 'key5pro.rar' to the qmk_firmware Folder
Hey ho,
Close to the Finishline ... Done with the Hardware Side
But I Suspect there is a error in the Wiringdiagram *Image and List isn't the same* not sure which
is the right one :(

An could you provide the Keymap you're using atm as a Startingpoint?


Fantastic re-use for components you have on hand and kudos for doing so with no need to get
parts from mail/store! That being said... for those of us who may just be getting started in this arena
and may not have a stack of hardware to re-purpose :) I have a few questions:
1) How did you get the pinout and configuration to drive the display? I was looking for a
comparable product and could read AGENA AA16102 on the picture - just curious how you figured
out how to get the Arduino to drive the display (and to wire it).
2) If I had to source the product elsewhere (MicroCenter, Amazon, etc) what would I be looking
for? (Closest I could find was something like this which appears to be 2 parts - the top half looking
similar to the part you used: https://www.microcenter.com/product/613554/-16-x-2-lcd-display-and-
keypad-shield - it looks to have a shield that provides an Arduino interface)
"Compile the keyboard firmware using the following command:
qmk compile -kb key5pro -km default"

I couldn't find this key5pro to compile. Did I miss anything on the tutorial?
Where can I find this custom keyboard?
Download the attached key5pro.rar file, then extract it to the qmk_firmware/keyboard directory,
then compile it.
Very nice concept. How many key sets does this device hold?

Theoretically it can hold tens of thousands depending on how well the code is written. If you're
asking how many that specific one currently holds I can't answer that!
Thanks

HotKeys Keyboard With Custom Profiles: Page 16


Whare is the video

HotKeys Keyboard With Custom Profiles: Page 17

You might also like