Let’s be honest: using a standard laptop or desktop keyboard can get a little frustrating if you rely on specific shortcuts or repetitive tasks. That's where macro pads come in. Think of them as small, programmable keyboards that allow you to execute multiple commands with just a single keypress. They're incredibly useful for tasks like editing, designing, or even gaming.

In this post, I’ll guide you through building your own custom macro pad using Flux, a powerful PCB design tool that simplifies the design process with its intuitive features. We’ll be working with the Raspberry Pi Pico 2’s RP2350A, the latest in the Pico line, to power this project and give you a flexible platform to customize your macro pad exactly to your needs.

What Exactly is a Macro Pad, Macros or Macro Keys?

Macro pad, macros or macro keys started out as specialized tools for professionals who needed to automate repetitive tasks. Video editors, graphic designers, and even gamers all found ways to create custom shortcuts using these devices. Over time, the idea evolved, and now anyone can build a macro pad to suit their workflow. One cool example is the Figma Creator Micro, which is designed for Figma users and comes pre-loaded with useful shortcuts.

But what’s even better? You can build your own, tailored to whatever you need, and that’s where Flux comes in handy.

Designing Your Own Macro Pad with Flux

So, you’ve decided to build a macro pad. Where do you start? Whether you’re a seasoned PCB designer or just getting into it, Flux makes the process pretty straightforward.

Here’s how you can get started:

1. Start with a Template

The best way to kick off your project in Flux is by using one of the manufacturer design templates. Simply clone or fork it, then off you go. These templates are pre-configured to match the specifications of popular manufacturers like JLCPCB, PCBWay, AISLER, LION Circuits, Seeed Studio, and more. By using these templates, you won’t have to manually configure parameters like trace widths, keepout areas, or other key settings—they’ll be optimized based on the manufacturer’s capabilities.

2. Find Components and Connect Them Together

The next step in designing your macros is to select the right components and connect them in the schematic editor. In Flux, this process is simplified thanks to the component library, which offers a wide variety of pre-configured parts, from switches to microcontrollers.

Typically, a macro keys will include mechanical switches, a microcontroller (like an Raspberry Pi or Arduino ATmega32u4) which support USB HID (Human Interface Device) for keyboard functionality, and passive components like resistors and capacitors to stabilize the signals. If you’re designing something a bit more advanced, you might also want to add LEDs for backlighting and rotary encoders for additional input which can be used for volume adjustment, brightness or zoom control.

Flux Component Library is stacked with pre-built parts, including switches and controllers that are essential for a macro pad. Here are 10 great options you’ll find:

  • MX1A-11NW - a linear switch with a smooth keypress, requiring 60g actuation force, manufactured by Cherry
  • Gateron KS33 - Smooth linear switch with a light keypress and fast actuation, designed for speed and precision
  • Gateron KS-9: Smooth linear switch with a light actuation, ideal for fast typing and gaming.
  • Gateron KS-8: Tactile switch with a noticeable bump, offering responsive feedback.
  • Gateron G Pro 3.0: Optimized for gaming, smooth linear feel with reduced wobble and faster response.
  • Gateron KS-3X: Linear switch designed for durability, offering smooth keystrokes with consistent actuation.
  • KS1100OA1AF060: Tactile switch with medium actuation force, provides both feedback and precision.
  • Kailh PG1353: Low-profile clicky switch, compact with audible feedback, ideal for slim designs.
  • MHPS2266: Compact tactile switch, designed for precise keypress with moderate resistance.
  • MHPS2273: Tactile switch with a firm feel, perfect for applications needing reliable feedback.

All you need to do is drag the components into your schematic editor and start making connections.

Once your components are in place, you'll need to connect them together in the schematic editor to ensure everything communicates properly. In Flux, this is as simple as connecting the symbols of each part. You can ask Flux Copilot to assist with the connections, automating the process and suggesting the right components to add in between.

Here’s the cool part: Flux Copilot, an AI assistant built right into your Flux projects, not only answers complex questions but also helps speed up your design process by automatically wiring up your schematics. For example, you can ask:

@copilot please connect my main 4 buttons to the MCU. Should I add any components in between?

Copilot will suggest any required components and automatically place net portals, connecting your components together, properly. That saves you a ton of time!

3. Move on to the PCB Editor

After completing the schematic diagram of your macro pad, you can move directly to the PCB editor. Flux simplifies this by ensuring that every component you dragged into your schematic already has a footprint (the physical representation of the component on the PCB). This includes pads for soldering, outlines for the silkscreen layer, and even a 3D model to visualize how everything will fit together. This makes it easy to see how your macro pad will fit together, especially if you're planning to use an enclosure.

A handy feature in Flux is the automatic ground fill and stitching vias, which takes care of all the ground connections for you by filling in copper in all the layers of your board. You won’t have to manually connect ground nets, making your design cleaner.

Another helpful feature is smart vias. When you're working with a small, high-density design like a macro pad board, Flux will automatically select and place optimal via types and configurations to make sure your connections are optimized without taking up too much space.

4. Get Help from Flux Copilot

If you ever feel stuck, you can always ask Flux Copilot for help. Here are list of popular Copilot prompts you can copy and paste, or modify for your own use! Whether it’s about placing components, organizing your layout, or selecting the right parts, Copilot’s got your back. It’s like having an expert PCB designer sitting with you, offering tips and suggestions as you work.

Inside My Macro Pad Design: A Raspberry Pi Pico 2 Powered Build

Inspired by the Figma Creator Micro, I set out to build something similar—a compact macro pad that offers customizable control and functionality. The Creator Micro is perfect for streamlining workflows with its Figma shortcuts, so I wanted to recreate that concept but add my own twist.

For my build, I chose to power it with the Raspberry Pi Pico 2, the latest version of the Pico line, which packs more power and capability. I also added a W25Q32RVXHJQ chip—a 3V, 32M-bit serial flash memory with dual/quad SPI & QPI—for storage and flexibility when handling more complex macros or functions.

In addition to two PEC12R-2220F-S0024 rotary encoders, I included a PTA2043-2010CIB103 slide potentiometer, giving the macro pad even more versatile control options. This potentiometer allows for smoother, precise adjustments—ideal for tasks like controlling volume or brightness.

I used the automatic ground fill to simplify the process of connecting ground nets, and the smart vias feature ensured everything was laid out perfectly, even in the limited space I had for this compact design. This helped make the board both efficient and neat, with all connections properly routed.

You can check out the schematic and PCB design here. By following similar steps, you can build a custom macro pad that fits your specific needs—whether for creative work, gaming, or just improving everyday tasks.

Firmware for Your Pico Macro Pad

After designing and building your custom macro pad, the next step is programming it. The Raspberry Pi Pico 2 uses MicroPython, which makes it easy to modify the code for your specific needs.

Here’s a powerful firmware written in MicroPython that includes features like debouncing for switches, RGB color cycling, rotary encoder tracking, and custom macros.

import machine
import utime
from neopixel import NeoPixel

# Define GPIO pins for switches
SWITCH_PINS = [2, 3, 4, 5]  # Assign GPIOs for your 4 macro keys
switches = [machine.Pin(pin, machine.Pin.IN, machine.Pin.PULL_UP) for pin in SWITCH_PINS]

# Define debounce time to avoid false readings from bouncing switches
DEBOUNCE_TIME = 20  # 20 ms debounce

# Define GPIO pins for encoders
ENCODER_A = machine.Pin(6, machine.Pin.IN, machine.Pin.PULL_UP)
ENCODER_B = machine.Pin(7, machine.Pin.IN, machine.Pin.PULL_UP)

# LED control (assuming WS2812 or other RGB LEDs)
LED_PIN = machine.Pin(15, machine.Pin.OUT)
NUM_LEDS = 4
leds = NeoPixel(LED_PIN, NUM_LEDS)

# Variables to track encoder state
encoder_position = 0
last_encoder_state = (ENCODER_A.value(), ENCODER_B.value())

# RGB Color values
OFF = (0, 0, 0)
RED = (255, 0, 0)
GREEN = (0, 255, 0)
BLUE = (0, 0, 255)
WHITE = (255, 255, 255)

# Macro definitions
MACROS = {
    0: 'Volume Up',
    1: 'Volume Down',
    2: 'Next Track',
    3: 'Previous Track',
}

# Timer to avoid debounce issues
def debounce(pin):
    last_state = pin.value()
    utime.sleep_ms(DEBOUNCE_TIME)
    current_state = pin.value()
    return last_state == 1 and current_state == 0

# Key press handler with debounce and macro execution
def check_keys():
    for i, switch in enumerate(switches):
        if debounce(switch):
            print(f"Key {i+1} pressed")
            execute_macro(i)
            led_feedback(i)

# Execute macro action based on key pressed
def execute_macro(key):
    macro = MACROS.get(key, "Undefined Macro")
    print(f"Executing {macro}")
    # Advanced users can add HID USB keyboard functionality here
    # For example, using the 'uhid' module or CircuitPython's USB HID library

# LED feedback function with color cycling for each key press
def led_feedback(key):
    colors = [RED, GREEN, BLUE, WHITE]  # Different colors for each key
    leds.fill(OFF)  # Clear all LEDs
    leds[key] = colors[key % len(colors)]  # Cycle through colors for each key
    leds.write()

# Encoder read function to track position and detect rotation
def check_encoder():
    global encoder_position, last_encoder_state
    current_state = (ENCODER_A.value(), ENCODER_B.value())
    
    if current_state != last_encoder_state:
        if current_state == (0, 1):  # Clockwise
            encoder_position += 1
            print(f"Encoder rotated clockwise: {encoder_position}")
        elif current_state == (1, 0):  # Counterclockwise
            encoder_position -= 1
            print(f"Encoder rotated counterclockwise: {encoder_position}")
        
        # Apply color change based on encoder position
        adjust_led_brightness(encoder_position)
        last_encoder_state = current_state

# Function to adjust LED brightness based on encoder input
def adjust_led_brightness(position):
    brightness = max(0, min(255, position * 10))  # Scale brightness from 0 to 255
    print(f"Adjusting LED brightness to: {brightness}")
    leds.fill((brightness, brightness, brightness))  # Uniform brightness for all LEDs
    leds.write()

# Main loop with key check, encoder check, and periodic updates
while True:
    check_keys()
    check_encoder()
    utime.sleep(0.05)  # Short delay to prevent CPU overuse

This flexible firmware tracks keypresses, controls RGB lighting, and handles rotary encoder inputs. It also allows for key remapping or adding more advanced features, such as USB HID keyboard functionality.

With this setup, you can expand your macro pad to include custom controls for media playback, design software, gaming functions, and more. The code is versatile, allowing you to tweak and expand it to match your specific use case.

Ready to Build Your Own?

If you’re tired of working with generic keyboards or need a more efficient way to manage your workflow, building a macro pad is a fun and practical solution. With Flux and its AI-powered Copilot, you don’t need years of PCB design experience to get started. The tool’s simple interface and handy features will guide you through the entire process—from schematic design to finished PCB layout.

So, what are you waiting for? Sign up for Flux and start designing your custom macro pad today. You’ll be surprised at how much time you can save once you have a device tailored to your specific needs!

No items found.
No items found.
No items found.

If this sounds interesting to you and you'd like to request a demo or learn more, please contact sales.

Contact Sales
Profile avatar of the blog author

Jharwin Barrozo

Jharwin is an electronics engineer mainly focused on satellites. He built his own ground station using Flux to monitor RF activities on the International Space Station. Find him on Flux @jharwinbarrozo

Go 10x faster from idea to PCB
Flux is an all-in-one EDA. Use re-usable blocks, scripting, and a library you don’t have to manage to dramatically reduce the time it takes to go from idea to prototype.
Illustration of sub-layout. Several groups of parts and traces hover above a layout.
Illustration of sub-layout. Several groups of parts and traces hover above a layout.
Flux is a better way to build PCBs
Go 10x faster from idea to PCB by reducing busy work, never starting from scratch, and keeping your team in sync. All from the browser.
Screenshot of the Flux app showing a PCB in 3D mode with collaborative cursors, a comment thread pinned on the canvas, and live pricing and availability for a part on the board.
Flux is a better way to build PCBs
Go 10x faster from idea to PCB by reducing busy work, never starting from scratch, and keeping your team in sync. All from the browser.
Screenshot of the Flux app showing a PCB in 3D mode with collaborative cursors, a comment thread pinned on the canvas, and live pricing and availability for a part on the board.
Flux is a better way to build PCBs
Go 10x faster from idea to PCB by reducing busy work, never starting from scratch, and keeping your team in sync. All from the browser.
Screenshot of the Flux app showing a PCB in 3D mode with collaborative cursors, a comment thread pinned on the canvas, and live pricing and availability for a part on the board.
Flux for Enterprise
Learn how Fortune 500s are revolutionizing hardware design at scale with AI.
Flux for Enterprise
Join leading Fortune 500s and over 300k hardware engineers revolutionizing the way they build PCBs with AI
Flux for Enterprise
Join leading Fortune 500s and over 300k hardware engineers revolutionizing the way they build PCBs with AI