MACROPAD Pi






Greetings everyone and welcome back. here's something useful.
MACROPAD Pi is a three-button Macropad built from scratch and powered by the Raspberry Pi PICO. We're utilizing PICO as an HID device, adding three mechanical switches to it and an OLED screen to perform COPY PASTE and erase commands.
The idea here was to create a super small macropad that I could use while using Fusion360 and other software that required frequent use of the COPY, PASTE, and DELETE commands. We have also incorporated an OLED screen to provide feedback on which command has been selected.
This Instructables is about the whole build process of this small MACROPAD so let's get started with the build.
Supplies
These were the components used in this project:
- Custom PCBs (provided by NEXTPCB)
- Raspberry Pi PICO
- Female Header Pin CON20
- SSD1306 OLED screen
- Mechanical Switches
- Keycaps
- 3D Printed Base
- M2 Screws
3D Design




We began the project's 3D design by importing the PICO 3D model, as well as the Switches and OLED screen 3D models.
We prepared a PCB with a mechanical switch on one side and a display on the other. We set PICO on the bottom side of the board.
After completing this simple PCB model, we created the frame part that holds the circuit on top. This frame part has a little inclined bottom, allowing the circuit to be put at an angle and lightly tilted as a keyboard.
Frame part was finalized and 3D printed with PLA using a 0.4mm nozzle and 0.2mm layer height.
PCB Design



For the schematic of this project, we initially created a small setup consisting of a Raspberry Pi Pico, an SSD1306 OLED screen, and three mechanical switches. We connected the OLED's VCC to the PICO's VBUS pin, GND to GND, the SDA pin to GPIO4, and the SCL pin to GPIO 5. All three switches are connected to GPIO0, GPIO1, and GPIO2.
Using the dimensions from the cad file, we created the PCB layout and the board outline and placed components in their proper locations. PICO 2 is located at the bottom of the board.
NextPCB PCB Service



Gerber Data was sent to HQ NextPCB, and an order was place for Blue Soldermask and white silkscreen.
After placing the order, the PCBs were received within a week, and the PCB quality was pretty great.
In addition, I have to bring in HQDFM to you, which helped me a lot through many projects. Huaqiu’s in-house engineers developed the free Design for Manufacturing software, HQDFM, revolutionizing how PCB designers visualize and verify their designs.
Take advantage of NextPCB's Accelerator campaign and get 2 free assembled RP2040-based PCBs for your innovative projects.
https://www.nextpcb.com/blog/rp2040-free-pcba-prototypes-nextpcb-accelerator
This offer covers all costs, including logistics, making it easier and more affordable to bring your ideas to life. SMT services can be expensive, but NextPCB is here to help you overcome that hurdle. Simply share your relevant project, and they'll take care of the rest. Don't miss out on this amazing opportunity to advance your tech creations!
HQDFM: Free Online Gerber Viewer and DFM Analysis Tool

Also, NextPCB has its own Gerber Viewer and DFM analysis software.
Your designs are improved by their HQDFM software (DFM) services. Since I find it annoying to have to wait around for DFM reports from manufacturers, HQDFM is the most efficient method for performing a pre-event self-check.
This is what I see in the online Gerber Viewer. It's decent for a quick look but not entirely clear. For full functionality—like detailed DFM analysis for PCBA—you’ll need to download the desktop software. The web version only offers a basic DFM report.
With comprehensive Design for Manufacture (DFM) analysis features, HQDFM is a free, sophisticated online PCB Gerber file viewer.
With over 15 years of industry experience, it offers valuable insights into advanced manufacturing processes. If you’re looking for reliable PCB services at a budget-friendly price, HQ NextPCB is definitely worth checking out.
PCB ASSEMBLY






- We start the PCB assembly process by connecting the two CON20 female header pins on PICO's Footprint from the bottom side of the board.
- Turning the board over, we use a soldering iron to solder the connector pads from the top side.
- Next, from the top side of the PCB, we place the SSD1306 OLED, followed by the three mechanical switches.
- We solder the switch and OLED pins from the bottom of the PCB.
- Finally, we install the PICO over the CON20 Header pin connectors.
The PCB assembly has been completed.
FINAL ASSEMBLY





After completing the PCB assembly, we begin the final assembly process, which begins with placing the Circuit over the 3D printed frame and then securing both of them with two M2 screws each.
We added keycaps over the mechanical switches as a finishing touch, which completed the assembly process.
CODE
This was the code we used in this project and it's a simple one.
Libraries
We added essential libraries like as Wire for I²C communication with OLED and Adafruit_GFX for graphics primitives like lines and text. Adafruit_SSD1306 drives the OLED screen, and the Keyboard library emulates keyboard input via USB.
Pin Definitions
We assign readable names and GPIO numbers to the button pins.
OLED Configuration
Next we set up a 128×64 pixel OLED, communicating via I²C using Wire.
State Variable
LastActionTime keeps track of when the last command was executed, and showing Command helps determine when to reset the display.
Setup Function
The Setup function Initializes buttons, the OLED display, and the keyboard and also shows an idle splash screen on startup that says MACROPAD.
Loop Function
The loop function reads buttons and triggers actions, Sends keystrokes and updates OLED. If the device is idle for 5 seconds, OLED will display "MACROPAD." This is a default text that is triggered by showIdle().
RESULT





This tiny yet practical build culminated in a macropad capable of performing copy, paste, and delete commands. When you push the copy button, the OLED screen will confirm your action. The paste button allows for seamless pasting, while the delete button provides instant removal functionality. Simple, efficient, and designed for simplified input.
Using this Macropad, I was able to use my preferred design software, Fusion 360, without having to press the Control plus C button; instead, I simply pressed one button to copy and another to paste, and things became slightly easier.
Overall, this project is completed and requires no revisions.
Special thanks to HQ NextPCB for providing components that I've used in this project; check them out for getting all sorts of PCB or PCBA-related services for less cost.
Thanks for reaching this far, and I will be back with a new project soon