aayushchouhan24/MacroPad

TypeScriptMIT1001
Created Feb 11, 2026Last commit Feb 14, 2026Last human commit Feb 14, 2026
Embed Badge
Play on Codakey
Markdown
[![Play on Codakey](https://codakey.io/badge.svg)](https://codakey.io/projects/aayushchouhan24-macropad)
HTML
<a href="https://codakey.io/projects/aayushchouhan24-macropad"><img src="https://codakey.io/badge.svg" alt="Play on Codakey" height="28" /></a>

Daily Activity

Monthly Activity

Star History

README

๐ŸŽน MacroPad - ESP32-C3 Wireless Macro Keyboard

Transform your workflow with a custom 10-key programmable macro keyboard featuring dual connectivity (Bluetooth + USB), rotary encoder, and a sleek desktop configurator app.

License Platform Firmware Status


โœจ What Makes This Special?

๐Ÿš€ Dual Connectivity โ€” Connect via Bluetooth OR USB-C, or both simultaneously! USB automatically takes priority when plugged in, seamlessly falling back to Bluetooth when disconnected.

โšก Instant Setup โ€” USB auto-detection means zero configuration. Just plug it in and start mapping keys.

๐ŸŽจ Beautiful UI โ€” Modern dark material design with fully responsive layout. Works perfectly on any screen size.

๐Ÿ”ง Real-Time Debug โ€” Built-in serial monitor shows live firmware output โ€” debug your macros without leaving the app.

๐ŸŽฏ Infinite Possibilities โ€” 10 programmable keys + rotary encoder with 5 rotation modes and custom key mappings.


๐ŸŒŸ Key Features

๐Ÿ”Œ Connectivity

  • ๐Ÿ”ต Bluetooth LE โ€” Wireless freedom with auto-reconnect
  • ๐ŸŸฆ USB Serial โ€” Direct connection via USB-C (Web Serial API)
  • โšก Dual Mode โ€” Both connections work simultaneously, USB prioritized
  • ๐Ÿ”„ Auto-Connect โ€” Instantly detects and connects to USB devices
  • โ™ป๏ธ Smart Fallback โ€” Seamlessly switches between transports

๐ŸŽฎ Hardware

  • โŒจ๏ธ 10 Programmable Keys โ€” 2ร—5 matrix layout with mechanical switches
  • ๐ŸŽš๏ธ Rotary Encoder โ€” Infinite rotation with tactile feedback + push button
  • ๐Ÿ”‹ Battery Monitor โ€” Real-time battery level tracking (Bluetooth mode)
  • ๐Ÿ˜ด Smart Sleep โ€” Auto-sleep on inactivity (disabled when USB connected)

๐Ÿ–ฅ๏ธ Desktop App

  • ๐ŸŽจ Material Dark Theme โ€” Eye-friendly interface with glass morphism
  • ๐Ÿ“ฑ Fully Responsive โ€” Adapts beautifully to any window size
  • ๐Ÿ” Serial Monitor โ€” Live firmware debug console with pop-out window
  • ๐Ÿ‘๏ธ Live Preview โ€” Real-time visualization of key presses and encoder rotation
  • ๐ŸŽฏ Visual Key Mapper โ€” Click-to-configure with instant feedback
  • ๐Ÿ“‚ Profile Manager โ€” Save, load, import/export configurations
  • ๐Ÿ”„ Device Sync โ€” Push configs directly to device flash memory
  • ๐ŸชŸ System Integration โ€” Tray icon, auto-startup, minimize to tray

๐ŸŽน Mapping Options

  • โŒจ๏ธ Single Key โ€” Any HID keyboard key (A-Z, F1-F12, modifiers)
  • ๐ŸŽ›๏ธ Key Combos โ€” Multi-key shortcuts (Ctrl+C, Alt+Tab, Shift+Win+S)
  • ๐ŸŽต Media Keys โ€” Volume, playback, brightness controls
  • ๐Ÿ“ Text Macros โ€” Type entire phrases or commands
  • ๐Ÿš€ Launch Apps โ€” Open programs, scripts, or shell commands
  • ๐Ÿ”ข Multi-Step Macros โ€” Complex keystroke sequences with delays

๐ŸŽš๏ธ Encoder Modes

  • ๐Ÿ”Š Volume Control โ€” System volume up/down
  • ๐Ÿ“œ Scroll โ€” Mouse wheel simulation
  • ๐Ÿ” Zoom โ€” Ctrl+scroll for browser/app zoom
  • โ˜€๏ธ Brightness โ€” Display brightness adjustment
  • ๐ŸŽฏ Custom Keys โ€” Assign any key combination (CW/CCW)

๐Ÿ“ฆ What You'll Need

ComponentQtyDescription
๐Ÿง  ESP32-C3 Mini1The brain โ€” handles Bluetooth and USB
๐ŸŽš๏ธ Rotary Encoder1Infinite rotation, push button (KY-040 or similar)
โŒจ๏ธ Cherry MX Switches10Your choice of tactile, clicky, or linear
๐ŸŽฉ Keycaps101U standard size
โšก 1N4148 Diodes10For anti-ghosting (optional for 10-key)
๐Ÿ”Œ Wire~1m22-24 AWG solid core recommended
๐Ÿ› ๏ธ PCB/Perfboard1For clean assembly (or breadboard for testing)
๐Ÿ  3D Printed Case1Optional but makes it look pro โœจ

๐Ÿ–จ๏ธ Get the Case

Download STL: 9-Key + Encoder Case on MakerWorld

๐Ÿ’ก Tip: The linked model is for 9 keys but easily adapts to our 2ร—5 layout!

๐Ÿ”Œ Pin Configuration

ESP32-C3 Mini Connections

FunctionPinDescription
Matrix Rows
Row 1GPIO 21First row of key matrix
Row 2GPIO 20Second row of key matrix
Matrix Columns
Col 1GPIO 0Column 1
Col 2GPIO 1Column 2
Col 3GPIO 2Column 3
Col 4GPIO 3Column 4
Col 5GPIO 4Column 5
Rotary Encoder
Encoder AGPIO 5Quadrature signal A
Encoder BGPIO 6Quadrature signal B
Encoder GNDGNDGround
Encoder ButtonR1ร—C5Connected to matrix position

Key Matrix Layout

     C1   C2   C3   C4   C5
R1   K1   K2   K3   K4   K5/ENC_BTN
R2   K6   K7   K8   K9   K10

Note: The encoder button is wired to Row 1, Column 5 position (same as Key 5)

๐Ÿ”ง Circuit Diagram

shader-mouse banner


๐Ÿš€ Quick Start Guide

Step 1๏ธโƒฃ: Flash the Firmware

  1. Grab the code:

    git clone https://github.com/yourusername/macropad.git
    cd macropad/MacroPadSketch
    
  2. Open in Arduino IDE (or PlatformIO):

    • Load MacroPadSketch.ino
    • Install ESP32 board support (Espressif Systems)
    • Install NimBLE-Arduino library (v1.4+)
  3. Select your board:

    • Board: ESP32C3 Dev Module
    • Upload Speed: 921600
    • USB CDC On Boot: Enabled
    • Flash Mode: QIO
    • Flash Size: 4MB
    • Partition Scheme: Default 4MB with spiffs
  4. Hit Upload ๐Ÿš€

๐Ÿ’ก First-time tip: Hold the BOOT button while connecting USB if upload fails!


Step 2๏ธโƒฃ: Install the Desktop App

Option A: Download Installer (Easiest)

  1. Go to Releases
  2. Download MacroPad-Setup-1.0.0.exe
  3. Run installer โ€” done! ๐ŸŽ‰

Option B: Build from Source

cd MacroPadApp
pnpm install           # or npm install
pnpm run dev           # Development mode
# --- OR ---
pnpm run build         # Build production
pnpm run dist          # Create installer

Step 3๏ธโƒฃ: Connect & Configure

๐Ÿ”ต Bluetooth Mode

  1. Power on your MacroPad
  2. Open the desktop app
  3. Click "BT" button in top-right
  4. Select your device from the list
  5. โœจ You're connected!

๐ŸŸฆ USB Mode (Recommended)

  1. Plug in USB-C cable
  2. Open the desktop app
  3. That's it! โ€” Auto-detects and connects automatically
  4. No drivers, no pairing, no hassle ๐ŸŽฏ

๐Ÿ”ฅ Pro tip: Keep both Bluetooth paired AND USB plugged in. The app uses whichever is available, prioritizing USB for lower latency!


Step 4๏ธโƒฃ: Map Your Keys

  1. Click โŒจ๏ธ Key Mapper in the sidebar
  2. Click any key in the grid
  3. Choose mapping type (Single Key, Combo, Macro, etc.)
  4. Configure the action
  5. Click ๐Ÿ“ค Apply to sync
  6. Your key is live! Test it immediately ๐ŸŽฎ

Bonus: Try the ๐ŸŽš๏ธ Encoder section to customize rotation modes!


๏ฟฝ Desktop App Features

๐ŸŽจ Modern UI

  • ๐Ÿ“ฑ Fully Responsive โ€” Works beautifully from small laptop screens to ultrawide monitors
  • ๐ŸŒ™ Dark Mode โ€” Easy on the eyes during late-night coding sessions
  • โšก Real-time Updates โ€” See key presses and encoder rotation instantly
  • ๐Ÿ“Š Live Dashboard โ€” Monitor battery, connection status, and input activity at a glance

โŒจ๏ธ Key Mapping Powerhouse

Configure each of the 10 keys with:

Mapping TypeDescriptionExample Use
๐Ÿ”ค Single KeyAny keyboard keyF13, Escape, Space
๐Ÿ”€ Key ComboModifiers + keyCtrl+Shift+T, Alt+F4
๐ŸŽต Media KeysPlayback controlsPlay/Pause, Next Track, Volume
๐Ÿ“ Text MacroType entire phrasesEmail signature, code snippets
๐Ÿš€ Launch AppOpen applicationsnotepad.exe, C:\Scripts\backup.bat
๐ŸŽฎ AdvancedCustom sequencesMulti-step automation

๐ŸŽš๏ธ Smart Encoder Modes

The rotary encoder is incredibly versatile:

  • ๐Ÿ”Š Volume Control โ€” Smooth system volume adjustment (default)
  • ๐Ÿ–ฑ๏ธ Scroll Wheel โ€” Vertical scrolling anywhere
  • ๐Ÿ” Zoom โ€” Ctrl + scroll for precise zoom control
  • โ˜€๏ธ Brightness โ€” Display brightness control (where supported)
  • โš™๏ธ Custom Keys โ€” Map rotation to any key combo (arrow keys, undo/redo, etc.)
  • โ™พ๏ธ Infinite Rotation โ€” No limit! Encoder tracks steps indefinitely

Encoder Button: Click for separate action (mute, play/pause, etc.)

๐Ÿ“ก Connectivity Options

Choose your connection style:

  • ๐ŸŸฆ USB Mode:

    • Zero-config auto-connect
    • Lowest latency
    • Plug-and-play
    • Works while charging
  • ๐Ÿ”ต Bluetooth Mode:

    • Wireless freedom
    • Multi-device support
    • Background operation
    • Lower power consumption
  • ๐Ÿ”ฅ Dual Mode:

    • Keep both connected!
    • USB takes priority when plugged
    • Seamless fallback to BT
    • Best of both worlds

๐Ÿ” Serial Monitor

Built-in debug console for troubleshooting:

  • Real-time firmware output
  • Packet inspector
  • Connection diagnostics
  • Pop-out window support
  • Always visible at bottom of Dashboard

โš™๏ธ System Integration

  • ๐Ÿ“Œ System Tray โ€” Runs in background, accessible via tray icon
  • ๐Ÿš€ Auto-startup โ€” Launch with Windows (optional)
  • ๐Ÿ’พ Profile Sync โ€” Settings saved to device flash memory
  • ๐Ÿ”” Notifications โ€” Connection events and updates
  • ๐ŸŽฏ Auto-reconnect โ€” Seamlessly reconnects on wake/unlock

๏ฟฝ๐Ÿ› ๏ธ Troubleshooting

๐Ÿ”Œ USB Connection Issues

Problem: App doesn't see my MacroPad via USB

โœ… Solutions:

  • Check if another app (Arduino IDE, Putty, etc.) is using the serial port โ€” close them!
  • Try a different USB cable (data cable, not just power)
  • Restart the MacroPad (unplug & replug)
  • Check Device Manager (Windows) โ€” should see "USB Serial Device (COMx)"
  • Click the ๐Ÿ“ก Serial Monitor at bottom โ€” are you seeing data?

Still stuck?

  • Open Serial Monitor in the app
  • If you see scrambled text โ†’ wrong baud rate (should be 115200)
  • If you see [SERIAL] Bridge started โ†’ firmware is working!
  • If you see nothing โ†’ try reuploading firmware with USB CDC On Boot: Enabled

๐Ÿ”ต Bluetooth Connection Issues

Problem: Device not found in Bluetooth scan

โœ… Solutions:

  • Make sure Bluetooth is enabled on your PC
  • Keep MacroPad close (< 3 feet) during first pairing
  • Restart the MacroPad โ€” LED should blink (advertising mode)
  • Windows: Go to Settings โ†’ Bluetooth โ†’ "Add device"
  • Try connecting via USB first, then switch to BT

Problem: Connected but keys don't work

โœ… Solutions:

  • Look at Event Log in Dashboard โ€” seeing key events?
  • Check Live Input panel โ€” encoder/keys lighting up?
  • Open Serial Monitor (if USB connected) โ€” look for debug output
  • Re-sync config: Go to Key Mapper โ†’ click ๐Ÿ“ค Apply

โš™๏ธ Firmware Upload Issues

Problem: Upload fails or "Device not found"

โœ… Solutions:

  • Hold BOOT button while plugging USB
  • Select correct board: ESP32C3 Dev Module
  • Enable USB CDC On Boot: Enabled in Arduino IDE
  • Try slower upload speed: 115200 instead of 921600
  • Check cable (some cheap cables are power-only!)

Problem: Code compiles but doesn't upload

โœ… Solutions:

  • Close Serial Monitor if it's open
  • Press and hold BOOT, then press RESET, then release BOOT
  • Try different USB port (direct to motherboard, not hub)
  • Install CH340/CP2102 drivers if needed

๐ŸŽš๏ธ Encoder Not Working

Problem: Encoder spins but nothing happens in app

โœ… Solutions:

  • Check wiring: CLK โ†’ GPIO2, DT โ†’ GPIO3, SW โ†’ GPIO6
  • Verify in Live Input โ€” rotation counter changing?
  • Try different encoder mode in Key Mapper โ†’ Encoder section
  • Check Serial Monitor for [ENC] Steps: X messages

Problem: Encoder is jittery or skips

โœ… Solutions:

  • Add 0.1ยตF capacitors between each encoder pin and GND
  • Change encoder type in code (if mechanical โ†’ try different detent count)
  • Check for loose connections

๐Ÿ–ฅ๏ธ Desktop App Issues

Problem: App won't start / crashes on launch

โœ… Solutions:

  • Delete %APPDATA%\macropad-app folder (resets settings)
  • Run as Administrator (right-click โ†’ "Run as administrator")
  • Check antivirus โ€” sometimes blocks serial port access
  • Reinstall from latest release

Problem: Auto-connect keeps disconnecting

โœ… Solutions:

  • USB mode: Check cable quality โ€” auto-reconnect should be instant
  • Bluetooth mode: Increase connection interval in firmware
  • Dual mode: If both connected, app prefers USB โ€” disconnecting BT is normal

๐Ÿ“Š Still Having Issues?

  1. Check Serial Monitor โ€” most issues show debug messages!
  2. Look at Event Log on Dashboard โ€” see what the device is sending
  3. Open an Issue on GitHub with:
    • Serial Monitor output
    • Event Log screenshot
    • Connection mode (USB/BT)
    • OS version

๐Ÿ’ก Pro debugging tip: Keep Serial Monitor open while testing. It shows every packet, key press, and connection event in real-time!


๐Ÿค Contributing

We'd love your help making this MacroPad even better! Whether it's:

  • ๐Ÿ› Bug fixes โ€” Squash those pesky issues
  • โœจ New features โ€” Add encoder modes, mapping types, or UI improvements
  • ๐Ÿ“š Documentation โ€” Help others understand and build
  • ๐ŸŽจ Design โ€” Make it prettier, smoother, more intuitive
  • ๐Ÿงช Testing โ€” Try exotic configurations and report findings

How to contribute:

# 1. Fork this repo (click Fork button on GitHub)

# 2. Clone your fork
git clone https://github.com/YOUR-USERNAME/macropad.git
cd macropad

# 3. Create a feature branch
git checkout -b feature/my-awesome-feature

# 4. Make your changes, test thoroughly

# 5. Commit with a clear message
git commit -m "Add volume fine-tune mode to encoder"

# 6. Push to your fork
git push origin feature/my-awesome-feature

# 7. Open a Pull Request on GitHub

Code Style:

  • TypeScript for app code
  • Arduino/C++ for firmware
  • Follow existing patterns and formatting
  • Comment complex logic

Found a bug? Open an issue with:

  • Steps to reproduce
  • Expected vs actual behavior
  • Serial Monitor output (if relevant)
  • Screenshots/screen recordings help!

๐Ÿ“„ License

This project is open source under the MIT License โ€” you're free to:

  • โœ… Use it for personal or commercial projects
  • โœ… Modify and customize to your heart's content
  • โœ… Share and distribute
  • โœ… Build upon it and make something amazing

See the LICENSE file for the legal details.

TL;DR: Build it, hack it, sell it, share it โ€” just keep the license notice. ๐ŸŽ‰


๐ŸŒŸ Author

๐Ÿ™ Acknowledgments

  • ๐Ÿ’™ ESP32-Arduino community for excellent libraries and support
  • โšก Electron team for the incredible desktop framework
  • โŒจ๏ธ Mechanical keyboard enthusiasts for endless inspiration
  • ๐Ÿ–จ๏ธ MakerWorld community for 3D printing resources and case designs
  • ๐ŸŽจ Tailwind CSS for making beautiful UIs actually enjoyable to build

๐Ÿ’ฌ Support & Community


โญ Star this repo if you found it helpful!

Built something cool with this? Share it in Show & Tell discussions!


Happy macro-ing! ๐ŸŽนโœจ

Made with โค๏ธ and lots of โ˜•

Related Projects