๐น 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.
โจ 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
| Component | Qty | Description |
|---|---|---|
| ๐ง ESP32-C3 Mini | 1 | The brain โ handles Bluetooth and USB |
| ๐๏ธ Rotary Encoder | 1 | Infinite rotation, push button (KY-040 or similar) |
| โจ๏ธ Cherry MX Switches | 10 | Your choice of tactile, clicky, or linear |
| ๐ฉ Keycaps | 10 | 1U standard size |
| โก 1N4148 Diodes | 10 | For anti-ghosting (optional for 10-key) |
| ๐ Wire | ~1m | 22-24 AWG solid core recommended |
| ๐ ๏ธ PCB/Perfboard | 1 | For clean assembly (or breadboard for testing) |
| ๐ 3D Printed Case | 1 | Optional 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
| Function | Pin | Description |
|---|---|---|
| Matrix Rows | ||
| Row 1 | GPIO 21 | First row of key matrix |
| Row 2 | GPIO 20 | Second row of key matrix |
| Matrix Columns | ||
| Col 1 | GPIO 0 | Column 1 |
| Col 2 | GPIO 1 | Column 2 |
| Col 3 | GPIO 2 | Column 3 |
| Col 4 | GPIO 3 | Column 4 |
| Col 5 | GPIO 4 | Column 5 |
| Rotary Encoder | ||
| Encoder A | GPIO 5 | Quadrature signal A |
| Encoder B | GPIO 6 | Quadrature signal B |
| Encoder GND | GND | Ground |
| Encoder Button | R1รC5 | Connected 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
๐ Quick Start Guide
Step 1๏ธโฃ: Flash the Firmware
-
Grab the code:
git clone https://github.com/yourusername/macropad.git cd macropad/MacroPadSketch -
Open in Arduino IDE (or PlatformIO):
- Load
MacroPadSketch.ino - Install ESP32 board support (Espressif Systems)
- Install NimBLE-Arduino library (v1.4+)
- Load
-
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
- Board:
-
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)
- Go to Releases
- Download
MacroPad-Setup-1.0.0.exe - 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
- Power on your MacroPad
- Open the desktop app
- Click "BT" button in top-right
- Select your device from the list
- โจ You're connected!
๐ฆ USB Mode (Recommended)
- Plug in USB-C cable
- Open the desktop app
- That's it! โ Auto-detects and connects automatically
- 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
- Click โจ๏ธ Key Mapper in the sidebar
- Click any key in the grid
- Choose mapping type (Single Key, Combo, Macro, etc.)
- Configure the action
- Click ๐ค Apply to sync
- 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 Type | Description | Example Use |
|---|---|---|
| ๐ค Single Key | Any keyboard key | F13, Escape, Space |
| ๐ Key Combo | Modifiers + key | Ctrl+Shift+T, Alt+F4 |
| ๐ต Media Keys | Playback controls | Play/Pause, Next Track, Volume |
| ๐ Text Macro | Type entire phrases | Email signature, code snippets |
| ๐ Launch App | Open applications | notepad.exe, C:\Scripts\backup.bat |
| ๐ฎ Advanced | Custom sequences | Multi-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: Enabledin Arduino IDE - Try slower upload speed:
115200instead of921600 - 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: Xmessages
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-appfolder (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?
- Check Serial Monitor โ most issues show debug messages!
- Look at Event Log on Dashboard โ see what the device is sending
- 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
- ๐ Bug Reports: Create an Issue
- ๐ก Feature Requests: Discussions
- ๐ Documentation: Wiki (detailed guides & assembly tips)
- ๐ฌ Questions: Discussions Q&A
โญ 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 โ