DIY Macro Pad Keyboard Build From Scratch With Custom PCB and Mechanical Switches

by Elecrow in Circuits > Raspberry Pi

1568 Views, 11 Favorites, 0 Comments

DIY Macro Pad Keyboard Build From Scratch With Custom PCB and Mechanical Switches

000.png

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

001.png

Customized PCB Board

001 00_00_00-00_00_30.gif
003.png
002.png

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

002 00_00_00-00_00_30.gif
003 00_00_00-00_00_30.gif
004.png
005.png

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

004 00_00_00-00_00_30.gif

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

Fixed Mechanical Switches

005 00_00_00-00_00_30.gif
006.png

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

Fixed Potentiometer

007.png

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

006 00_00_00-00_00_30.gif

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

007 00_00_00-00_00_30.gif

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

008 00_00_00-00_00_30.gif
008.png

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

011.png
009.png
010.png

Assembled

009 00_00_00-00_00_30.gif
012.png

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

Put on the Keycap

010 00_00_00-00_00_30.gif

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

Programming and Testing

011 00_00_00-00_00_30.gif
012 00_00_00-00_00_30.gif
013 00_00_00-00_00_30.gif
014 00_00_00-00_00_30.gif

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!