DIY Macro Pad Keyboard Build From Scratch With Custom PCB and Mechanical Switches
by Elecrow in Circuits > Raspberry Pi
1712 Views, 11 Favorites, 0 Comments
DIY Macro Pad Keyboard Build From Scratch With Custom PCB and Mechanical Switches

This is a 12-key macro keyboard with a potentiometer, an OLED module, three illuminated LEDs, and custom keycaps. This macro keyboard is running CircuitPython firmware on Raspberry Pi Pico.
Next, let us start to learn how to design such a macro keyboard step by step!
Supplies

Material:
OLED module × 1
Potentiometer × 1
LED × 3
Mechanical Switch × 12
Keycap × 12
Customized PCB Board



It just so happened that elecrow officially launched a $1 PCB customization service. As long as the size of the customized PCB board is within 10 cm by 10 cm, it only costs one dollar to realize the customization.
You only need to enter www.elecrow.com in the browser, find the "PCB & PCBA special promotion" page on the main interface, click to enter and pull down the page, find the "Quote Now" option, click to enter, and then you can place an order.
This is the PCB board drawing I designed and the actual PCB board I got.
Fixed Male & Female Headers




Turn the PCB board to the back (the side marked with "TOP" on the PCB is the front side), and place two 20pin female headers in the two rows of solder holes on the inner side, and then turn it over to the front side for soldering.
In the same way, place two 20pin male headers on the two rows of solder holes on the outer side of the front of the PCB, and turn them over to the back for soldering.
Install Raspberry Pi Pico

Plug the Raspberry Pi Pico into the female headers on the back of the PCB board.
Fixed Mechanical Switches


Align the 12 mechanical switches one by one and insert them into the corresponding soldering holes, and turn them over for soldering.
Fixed Potentiometer

In the same way, align the pins of the potentiometer and insert it into the corresponding solder hole on the PCB, and turn it over for soldering.
Fixed OLED Module

Here we need to use another custom PCB expansion board.
Align and insert the pins of the OLED module into the corresponding soldering holes of the PCB expansion board, and turn it over for soldering.
Fixed LED

Insert the three LEDs into the corresponding soldering holes in the order of the positive electrode on the left and the negative electrode on the right, and turn them over for soldering.
Fixed PCB Expansion Board


Align the PCB expansion board with the pin header of the PCB board and insert it, and fix the two together perfectly.
Design 3D Structures



Assembled


Assemble the PCB board and the 3D printed casing in order, and finally tighten and fix them with four screws.
Put on the Keycap

Install all the keycaps to the mechanical switch one by one in sequence.
Programming and Testing




Test procedure 1: LED running water light flickers
Test procedure 2: OLED module displays time in real time
Test procedure 3: mechanical switch key value output test
Test procedure 4: read the analog value of the potentiometer
The complete program is not provided here, and those who are interested can design and write it according to the above four test programs.
Digression
Elecrow is about to launch a mechanical keyboard promotion in February 2023, as long as the PCB board of this theme can get a big discount, please look forward to it!