Hitting the same keys and toggling commands all day is incredibly tedious. A macropad can free up mental bandwidth and speed up your workflow—whether you’re designing PCBs, writing firmware, editing videos, or any other repetitive task. In this post, we’ll guide you through an existing macropad design in Flux so you can:

  • Fork it instantly and use it as-is, or
  • Tweak it to your heart’s content—add more keys, swap out the microcontroller, or rearrange the layout.
  • Use AI Auto-Layout to handle routing automatically.

By the end, you’ll have a production-ready custom macropad you can actually order—and, if you’re up for it, share your unique spin with the Flux community.

Inside the Example Build

This example takes inspiration from the popular “Figma Creator Micro,” which was designed to speed up design software workflows. We wanted a similarly compact macropad with plenty of customization.

Key Components and Features:

1. Raspberry Pi Pico 2 (RP2350A)

  • The latest Pico variant, provides more power and capability.
  • Offers native USB HID functionality, so your custom macropad can be recognized as a keyboard.

2. External Flash Memory (W25Q32RVXHJQ)

  • 3V, 32M-bit serial flash with dual/quad SPI & QPI.
  • Useful if you need extra storage for more complex macros, animations, or data logging.

3. Two Rotary Encoders (PEC12R-2220F-S0024)

  • Adds dial-based input for volume, scrolling, or continuous adjustments.
  • Each encoder can also include a push-button switch, depending on the model.

4. Slide Potentiometer (PTA2043-2010CIB103)

  • Provides smooth, precise adjustment—great for volume, brightness, or scrubbing through a timeline.

5. Mechanical Key Modules

  • Each “module” includes a Kailh PG1353 low-profile clicky switch, an RGB LED (WS2812-2020), and a diode.
  • Using modules in Flux means one click = the entire key circuit. This modular approach simplifies duplication and future updates.
Macropad keyboard close-up 2D view in Flux

Layout & Automatic Ground Fill

We used Flux’s automatic ground fill to ensure easy, noise-free connections across the board. Smart vias also help optimize routing, especially in compact designs. That keeps your layout clean and production-friendly.

See the Schematic and PCB: Open/Clone the Example Project in Flux to explore the design step by step. If you want a no-fuss option, you can literally just fork and order it as-is.

Step 1: Fork the Example

  1. Open the Project: Click this link to open the project
  2. “Fork” in Flux: This copies everything—schematic, PCB layout, modules—into your workspace.
  3. If you love the project and want to manufacture it as is, feel free to skip to Step 5.
Macropad keyboard project schematic diagram in Flux

Step 2: Understand the Modules & Connections

Before you start tinkering, it helps to see how everything fits together. If you’re not sure why certain parts are included or how they’re wired, you can simply ask Flux Copilot, our AI assistant, right in the project.

Example Copilot Prompts:

@copilot can you explain how the Mechanical Key Module is wired to the Raspberry Pi Pico?
@copilot what’s the function of the external flash memory in this design?
@copilot can you outline how the two rotary encoders are connected?
@copilot which GPIO pins are currently free for additional keys or sensors?

You can also request a high-level overview of the entire project:

Copilot is responding to a user, explaining about a project

Copilot will respond with details about components, pin assignments, and even why certain parts were chosen, helping you understand the design before you dive into any major customizations.

Step 3: Customize the design

A quick way of personalizing this design would be to add some more keys. Each Mechanical Key Module is pre-built with the switch, diode, and LED. If you want more (or fewer) keys:

1. Copy the Module in the schematic.

2. Ask Copilot for an unused GPIO on the RP2350. Type:

@copilot Find a free GPIO Pin on the RP2350 where I can connect a new key

3. Let Flux Copilot handle the actual schematic wiring if you’d like. Type:

@copilot connect Key13 GPIO X

For the rotary encoders and slide potentiometer, you’ll see them already placed in the schematic. Feel free to move them around, switch to different pins, or remove them if you don’t need them.

Step 4: Arrange components and run AI Auto-Layout

Switch to the PCB editor to see the current footprint placements.

  1. Move Stuff Around: Want the Pico on the left edge for easier USB access? Just drag it.
  2. Add or Remove Key Modules: If you duplicated or removed keys in the schematic, you’ll see that reflected here.
  3. Run AI Auto-Layout: Click “Auto-Layout.” Flux’s AI engine will handle trace routing, ensuring a clean layout.

Repeat or tweak until the board shape, connector positions, and overall look match your preferences.

AI Auto-Layout is activated on a project. AI will now about to start routing the board.

Step 5: Finalize & Order

  1. DRC Checks: Flux flags any design-rule violations in real-time. Address issues if they pop up (like overlapping components or unconnected nets).
  2. Ground Fill & Stitching: We rely on Flux’s automatic ground fill for noise reduction. No need to do it manually.
  3. Export Gerbers or Order Directly: Once satisfied, generate manufacturing files or send them straight to your chosen PCB board house.

That’s it! You’ll have your custom macropad PCB in hand in a couple of weeks—ready to solder and test.

Step 6: Program the Pico

We’ve included a MicroPython firmware example that handles debouncing, RGB lighting, rotary encoder tracking, and custom macros. You can tweak it however you like: add more key commands, change LED effects, or even integrate USB HID keyboard functionality.

Below is the full example code:

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

How to Flash:

  • Put your Pico in bootloader mode. (Hold the BOOTSEL button while plugging it in via USB.)
  • Drag-and-drop a .uf2 build of this code onto the Pico drive.
  • Or use a MicroPython IDE (like Thonny) to upload the .py script directly.

We Want to See Your Mods!

A macropad is a fun, hands-on introduction to designing professional-grade PCBs with Flux—while still being small and easy to iterate on. Using modules, AI Auto-Layout, and built-in Copilot means you can move fast, experiment freely, and end up with a fully functional device you’ll actually use every day.

Ready to fork this design and customize the hardware, firmware, or both?

  • Add More Keys: Throw in extra mechanical key modules.
  • Go Wild with RGB: Make each key’s LED do something different.
  • Try a Different Microcontroller: If you need more GPIO or different features.
  • Join Our Slack: We’d love to see build photos and code snippets.

Share your unique designs in our Flux Slack Community for a chance to be featured in an upcoming showcase!

We can’t wait to see your take on this build—happy designing!

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
Work with Flux like an engineering intern—automating the grunt work, learning your standards, explaining its decisions, and checking in for feedback at key moments.
Illustration of sub-layout. Several groups of parts and traces hover above a layout.
Design PCBs with AI
Introducing a new way to work: Give Flux a job and it plans, explains, and executes workflows inside a full browser-based eCAD you can edit anytime.
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.
Design PCBs with AI
Introducing a new way to work: Give Flux a job and it plans, explains, and executes workflows inside a full browser-based eCAD you can edit anytime.
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.
Design PCBs with AI
Introducing a new way to work: Give Flux a job and it plans, explains, and executes workflows inside a full browser-based eCAD you can edit anytime.
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.

Related Content

High-Speed PCB Design: Layout Rules, Signal Integrity, and Routing Best Practices

High-Speed PCB Design: Layout Rules, Signal Integrity, and Routing Best Practices

Whether you're migrating from popular EDA applications or starting fresh, mastering high speed PCB design has never been more intuitive. Flux enables teams to design, simulate, and route with real-time AI assistance, so you can spin your next high-speed board with total confidence.

Profile avatar of Yaneev Hacohen
Yaneev Hacohen
|March 26, 2026
Design Rule Checking (DRC) in PCB Design: Real-Time vs Batch, Rules, and Common Failures

Design Rule Checking (DRC) in PCB Design: Real-Time vs Batch, Rules, and Common Failures

DRC is an automated process that checks your PCB layout against manufacturing and electrical constraints, catching errors like trace spacing and drill sizes before fabrication. Modern tools run this in real-time during design, while older ones batch-check at the end, often producing overwhelming error lists.

Profile avatar of Yaneev Hacohen
Yaneev Hacohen
|March 26, 2026
What Is a PCB? A Beginner's Guide to Printed Circuit Board Design

What Is a PCB? A Beginner's Guide to Printed Circuit Board Design

Whether you are exploring “What is a PCB?” for the first time or moving into advanced hardware engineering, modern tools make the process easier than ever. With Flux's AI-assisted platform, you can skip the steep learning curve of popular ECAD applications and design collaboratively directly in your browser. Once your board is routed and ready for fabrication, Flux's built-in supply chain features connect you directly with worldwide distributors to source parts instantly. Sign up for free today and start building!

Profile avatar of Yaneev Hacohen
Yaneev Hacohen
|March 21, 2026
PCB Prototyping vs. Fabrication: Which Process Is Right for Your Project?

PCB Prototyping vs. Fabrication: Which Process Is Right for Your Project?

A practical guide to when hardware teams should use low-volume PCB prototyping to validate a design versus full-scale fabrication to scale production, and how to transition between the two without costly mistakes.

Profile avatar of Yaneev Hacohen
Yaneev Hacohen
|April 21, 2026
Blind Vias, Buried Vias, and Microvias: A Complete Guide to PCB Via Types

Blind Vias, Buried Vias, and Microvias: A Complete Guide to PCB Via Types

A practical guide to the four main PCB via types — through-hole, blind, buried, and microvia — covering how each is fabricated, their cost and signal-integrity trade-offs, and when to use them based on layer count, BGA pitch, and routing density.

Profile avatar of Yaneev Hacohen
Yaneev Hacohen
|April 21, 2026
PCB Design for Manufacturability (DFM): Rules and Best Practices

PCB Design for Manufacturability (DFM): Rules and Best Practices

Learn PCB design for manufacturability (DFM) guidelines, rules, and common issues to ensure your circuit boards can be reliably produced.

Profile avatar of Yaneev Hacohen
Yaneev Hacohen
|April 16, 2026
Best PCB Routing Techniques for Clean Circuit Board Layouts

Best PCB Routing Techniques for Clean Circuit Board Layouts

Learn the best PCB routing techniques for clean circuit board layouts, including trace routing tips, differential pair routing, and layout best practices.

Profile avatar of Yaneev Hacohen
Yaneev Hacohen
|April 16, 2026
Simulate Circuits with a Prompt

Simulate Circuits with a Prompt

Flux brings circuit simulation to wherever you are in the design process. Start from a prompt when you have no schematic, or let Flux analyze your existing design automatically.

Profile avatar of Lance Cassidy
Lance Cassidy
|March 20, 2026