
Pen mixer
Brillar0101/pen-mixer
Pen-mounted motion controller: prototype and production firmware, laptop audio stack, and the production PCB as a KiCad project

Pen-mounted motion controller: prototype and production firmware, laptop audio stack, and the production PCB as a KiCad project
Pen mixer is an open-source printed circuit board by Brillar0101, from the Brillar0101/pen-mixer repository on GitHub, published under the MIT licence. It is a 4-layer board of 38 × 36.2 mm with 32 parts on 18 nets, routed with 377 tracks and 28 vias.
It is built around the ISP1807-LR-RS, LSM6DS3TR-C and MCP73831T-2ACI/OT-HXY, with the TPS7A0533PDBV and EVQP7C01P among its other parts. Its parts include 10 capacitors, 8 resistors, 4 ICs, 3 diodes and 2 connectors. It belongs with the audio and music and computers and single-board computers boards of this library.
Pen Mixer is a small motion controller that clips onto the top of an ordinary pen and turns handwriting gestures into live audio control. An IMU on the board reads tilt and twist, an nRF52840 sends the motion to a laptop over Bluetooth, and the laptop shapes whatever track is playing: tilt the pen and a filter sweeps, twist it and the level moves. The better your pen control gets, the better your mix sounds.
The v2.1 board (13 × 35 mm) in its clear case
This repo holds the whole project: prototype firmware, production firmware and laptop stack, and the production PCB as a KiCad project.
flowchart LR
HAND["Hand<br>tilt, twist"] --> FW
subgraph pen["Pen Mixer board: on the pen"]
FW["LSM6DS3TR-C IMU<br>+ ISP1807 nRF52840"]
end
FW -->|"BLE, Nordic UART"| BR
FW -.->|"USB-C, serial"| BR
subgraph laptop["Laptop"]
BR["bridge.py<br>smooth, map"] -->|"UDP"| PD["Pure Data<br>filter + gain"]
BR -->|"SSE"| DASH["dashboard<br>localhost:8080"]
end
PD --> SPK["Speakers"]
classDef pfBlue fill:#E7F1FA,stroke:#0066CC,color:#151515
classDef pfGold fill:#FDF7E7,stroke:#F0AB00,color:#151515
classDef pfGreen fill:#F3FAF2,stroke:#3E8635,color:#151515
classDef pfGray fill:#F0F0F0,stroke:#6A6E73,color:#151515
class HAND,SPK pfBlue
class FW pfGreen
class BR pfGold
class PD,DASH pfGrayTwo production board shapes exist. v2.1 is a 13 x 35 mm bar (frozen in
production/kicad/v2/). v3, the current design in production/kicad/, is a
regular five-point star 40 mm tip to tip with a vertical, top-entry USB-C
(G-Switch GT-USB-7055E) in the body so all five prongs are identical, the
antenna at the top tip, LEDs out on the left arm and the button in the right
arm; otherwise the same parts and the same four-layer 0.8 mm stack. The v2.1 board is a 13 x 35 mm, four-layer, 0.8 mm PCB, all SMD, designed
to ride on a pen barrel with a 401230 LiPo at the back of the pen.
| Ref | Part | Role |
|---|---|---|
| U1 | ISP1807 | nRF52840 with integrated antenna, pre-certified |
| U2 | LSM6DS3TR-C | 6-axis IMU |
| U3 | MCP73831 | LiPo charger, 50 mA |
| U4 | TPS7A02 | 3.3 V LDO, 200 nA quiescent |
| J1 | USB-C 16P | charge, programming, serial |
| J2 | pads on B.Cu | off-board LiPo, 401230 |
The KiCad project lives in production/. Schematic PDF, board plots, a render
and the BOM are in production/output/.
The board is fully routed and fabrication-ready: 0 unrouted connections, ground pours on all four layers, and a clean DRC. U1 sits on the official JLCPCB land pattern with part-for-part verified pad geometry, and every component carries the 3D model of the exact part being ordered.
Every pinout came from a primary datasheet, kept in production/datasheets/.
The one that would have cost a board spin: ISP1807 pin 20 (OUT_ANT) must be
tied to pin 22 (OUT_MOD) on the application PCB, or the radio has no antenna.
prototype/ runs on the Seeed XIAO nRF52840 Sense today and targets the
custom board unchanged, since both are an nRF52840 with an ST IMU on I2C.
prototype/
bridge.py serial or BLE, then smoothing, mapping, UDP, dashboard
ble_source.py laptop-side BLE client for --ble
dashboard.py live web view on :8080
firmware/
code.py IMU over USB serial
code_ble.py IMU over BLE, advertises as PenMixer-Lexy
patches/ Pure Data: track playback, manual sliders, live inputHow to run all of it, from firmware to Pure Data to the dashboard, lives in docs/RUNNING.md.
The Qt app in app/ is the laptop side: it EQs whatever the computer is
playing, driven by the pen over Bluetooth. Full detail, Docker, and
troubleshooting are in app/README.md; the short version:
brew install blackhole-2ch switchaudio-osx # first time only
git clone https://github.com/Brillar0101/pen-mixer.git
cd pen-mixer/app
python3 -m venv venv
venv/bin/pip install -r requirements.txt -e . # first time only
venv/bin/python -m penmixer.app # every timeIn the window: click "Route system audio here", set Source to "Bluetooth (pen board)" or use "Scan Bluetooth", play music, move the pen. Closing the app restores your speakers.
First time only, in an administrator PowerShell, then reboot (VB-CABLE is the Windows loopback device):
curl.exe -L -o $env:TEMP\vbcable.zip https://download.vb-audio.com/Download_CABLE/VBCABLE_Driver_Pack45.zip
Expand-Archive $env:TEMP\vbcable.zip $env:TEMP\vbcable -Force
& $env:TEMP\vbcable\VBCABLE_Setup_x64.exe
shutdown /r /t 0Then in a normal PowerShell:
git clone https://github.com/Brillar0101/pen-mixer.git
cd pen-mixer\app
python -m venv venv
venv\Scripts\pip install -r requirements.txt -e . # first time only
venv\Scripts\python -m penmixer.app # every timeSet Settings > System > Sound > Output to "CABLE Input", then in the window click "Hear music here", set Source to "Bluetooth (pen board)", play music, move the pen. Set the output back to your speakers when done.
No board? Set Source to "Simulate (no board)".
| What | Number |
|---|---|
| Frame rate over USB | 197 Hz against a 250 Hz target |
| Frames in the soak run | 105,872, 0 malformed |
| Smoother settling, alpha 0.4 | 24 ms to 95% of a step |
| End-to-end budget | 32 ms, against ~20 ms where feel degrades |
| BLE vs USB link cost | ~10 ms vs 1 ms |
prototype/ nRF52840 Sense build: real IMU, USB or BLE, laptop stack
app/ Qt desktop app: 3-band EQ, visualizer, one-window stack
(start instructions for macOS and Windows: app/README.md)
production/ the production board
kicad/ KiCad 10 project, footprints, 3D models
datasheets/ primary sources for every pinout
output/ schematic PDF, board plots, render, BOM, DRC report
docs/ architecture, run guide, requirements (PRD)
ARCHITECTURE.md how it all fits together, with diagramsMIT. See LICENSE.
Built by Barakaeli (Brillar0101) and Lexy (vnllagoldfish).
| Qty | Value | Footprint | References |
|---|---|---|---|
| 5 | 100n | C_0402_1005Metric | C5, C7, C8, C10, C11 |
| 2 | 1M | R_0402_1005Metric | R8, R9 |
| 2 | 1u | C_0402_1005Metric | C3, C4 |
| 2 | 4k7 | R_0402_1005Metric | R6, R7 |
| 2 | 4u7 | C_0402_1005Metric | C1, C2 |
| 2 | 5k1 | R_0402_1005Metric | R1, R2 |
| 2 | XL-1010RGBC | LED-SMD_4P-L1.0-W1.0-TL_XL-1010RGBC-WS2812B | LED1, LED2 |
| 1 | +3V3 | TestPad_1.0mm | TP5 |
| 1 | 10u | C_0402_1005Metric | C6 |
| 1 | 1k | R_0402_1005Metric | R4 |
| 1 | 20k | R_0402_1005Metric | R3 |
| 1 | BAT | SolderPad_1.2x2.0mm | J2 |
| 1 | EVQP7C01P | SW-SMD_EVQP7C01P | SW1 |
| 1 | GND | TestPad_1.0mm | TP4 |
| 1 | GRN | LED_0402_1005Metric | D1 |
| 1 | ISP1807-LR | BULETM-SMD_ISP1807 | U1 |
| 1 | LSM6DS3TR-C | LGA-14_3x2.5mm_P0.5mm_LayoutBorder3x4y | U2 |
| 1 | MCP73831T-2ACI/OT | SOT-23-5 | U3 |
| 1 | SWDCLK | TestPad_1.0mm | TP2 |
| 1 | SWDIO | TestPad_1.0mm | TP1 |
| 1 | TPS7A0533PDBV | SOT-23-5 | U4 |
| 1 | USB-C 16P | pen-mixer:GT-USB-7010ASV | J1 |

Brillar0101/pen-mixer
Pen-mounted motion controller: prototype and production firmware, laptop audio stack, and the production PCB as a KiCad project

mx3353672833-debug/moto-gps-waveshare
MOTO GPS · Waveshare ESP32-S3 1.75C 圆屏导航 + iPhone App | Author: Maler X | Noncommercial, attribution required | Experimental


us3r-d0e5nt-3x1st/esp32c5-airunit-nano
air-unit based on esp32c5-wroom-1u and ov5640, made for the hx-esp32-cam-fpv project, supports both digital video with osd and rc control


sequoia-hope/ultraroute
PCB autorouting experiments around copperroute: route jobs, leaderboards, board morphing

ChrisHayward-dev/SapphireKicad
See the LastProduction branch for the most current revision


BerkeleyHCI/PolymorphicBlocks
A Python-based hardware description language for PCBs for higher-level (block-diagram / system-architecture level) PCB design through libraries of directly reusable subcircuit generators.
It measures 38 × 36.2 mm and has 4 copper layers, 0.8 mm thick.
32 parts, built around the ISP1807-LR-RS, LSM6DS3TR-C, MCP73831T-2ACI/OT-HXY and TPS7A0533PDBV. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
From the Brillar0101/pen-mixer repository on GitHub, at the commit this page was made from: the board is production/kicad/pen-mixer.kicad_pcb and its schematic production/kicad/pen-mixer.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).