μDrive is an open-source hardware and software project designed to convert any standard "dumb" DC motor into a smart, closed-loop servo motor. By retrofitting a standard DC motor with an analog potentiometer or an I2C magnetic encoder, μDrive grants you precise control over position, velocity, and current.
A comprehensive documentation suite is available in the docs directory:
μDrive is available in two PCB variants sharing the same MCU and logic, but using different motor drivers:
| Feature | Servo Board | MG996 Drop-in Board |
|---|---|---|
| Motor Driver | CP2119 | BDR6121H |
| Form Factor | Standard — attach to any DC motor | Drop-in replacement for MG996R servo |
| Operating Voltage | Up to 18V max | Up to 7.5V max |
| Current Rating | 5A continuous | 1.5A continuous / 3A peak |
| PCB Files | servo_pcb | servo_pcb_mg99x |
The project uses a Master/Slave architecture over a half-duplex UART bus. You simply import the driver library onto your master microcontroller and send high-level commands.
graph TD
Web["<span style='color:#000'>💻 Web Browser<br>(Svelte WebGUI)</span>"] -- "Web Serial API" --> Master["<span style='color:#000'>🧠 Master Microcontroller<br>(Running Python Script)</span>"]
Master -- "Single-Wire UART" --> Servo["<span style='color:#000'>⚡ μDrive Servo Board</span>"]
Servo --> Motor["<span style='color:#000'>⚙️ DC Motor + Encoder</span>"]
%% Styling
style Web fill:#e1f5fe,stroke:#01579b,stroke-width:2px;
style Master fill:#e8f5e9,stroke:#1b5e20,stroke-width:2px;
style Servo fill:#fff3e0,stroke:#e65100,stroke-width:2px;
style Motor fill:#efebe9,stroke:#3e2723,stroke-width:2px;
Why use a Raspberry Pi Pico? Programming obscure chips like the MM32G0001 usually requires buying dedicated, expensive hardware programmers (like mm32link or ST-Link). By using a $4 Raspberry Pi Pico instead, we keep the project incredibly cheap and accessible. Even better: once you've flashed the servo board, you can wipe the Pico and reuse it as the master MicroPython controller for your entire servo network!
Step 1: Turn the Pico into a Programmer
Flash your Raspberry Pi Pico with the Picoprobe (Debug Probe) firmware to turn it into a CMSIS-DAP debugger. You can download the latest debugprobe_on_pico.uf2 file directly from the official Raspberry Pi GitHub Releases page. Just hold the BOOTSEL button, plug in the Pico, and drag-and-drop the file!
Step 2: Wire the Pico to the μDrive Board Connect these 4 wires from the Pico to the programming header on the μDrive board:
Step 3: Install the Software Tools
pip install pyocd
pyocd fails to detect your probe later, Windows likely installed the wrong default driver. Download the free Zadig tool, select "Picoprobe CMSIS-DAP" from the dropdown, and replace the driver with WinUSB).Step 4: Open and Flash!
Microdrive folder in VS Code.→ arrow at the bottom of the screen). PlatformIO will automatically compile the code and trigger pyocd to flash it onto the MM32G0001!Once the servo board is flashed, it listens for commands over a half-duplex UART line. You will need a "Master" microcontroller to send these commands.
To easily tune and monitor your servo network from your computer, you can run the provided Svelte WebGUI:
gui folder inside this repository.npm install to download the web dependencies.npm run dev to start the local server.localhost link in a browser that supports the Web Serial API (like Chrome or Edge) to connect to your Master MCU and start tuning!Microdrive is actively under development. Current focus areas include:
Contributions are welcome! Whether it's firmware, hardware, documentation, or the WebGUI — check out the Contributing Guide to get started. Found a bug or have an idea? Open an issue.
This project is fully open-source and OSHWA certified (UID: IN000092):
You are free to build, modify, and integrate μDrive into your own projects (commercial or hobbyist).
C
93.5%
Svelte
4.7%
Python
1.1%
μDrive is an open-source hardware and software project designed to convert any standard "dumb" DC motor into a smart, closed-loop servo motor. By retrofitting a standard DC motor with an analog potentiometer or an I2C magnetic encoder, μDrive grants you precise control over position, velocity, and current.
A comprehensive documentation suite is available in the docs directory:
μDrive is available in two PCB variants sharing the same MCU and logic, but using different motor drivers:
| Feature | Servo Board | MG996 Drop-in Board |
|---|---|---|
| Motor Driver | CP2119 | BDR6121H |
| Form Factor | Standard — attach to any DC motor | Drop-in replacement for MG996R servo |
| Operating Voltage | Up to 18V max | Up to 7.5V max |
| Current Rating | 5A continuous | 1.5A continuous / 3A peak |
| PCB Files | servo_pcb | servo_pcb_mg99x |
The project uses a Master/Slave architecture over a half-duplex UART bus. You simply import the driver library onto your master microcontroller and send high-level commands.
graph TD
Web["<span style='color:#000'>💻 Web Browser<br>(Svelte WebGUI)</span>"] -- "Web Serial API" --> Master["<span style='color:#000'>🧠 Master Microcontroller<br>(Running Python Script)</span>"]
Master -- "Single-Wire UART" --> Servo["<span style='color:#000'>⚡ μDrive Servo Board</span>"]
Servo --> Motor["<span style='color:#000'>⚙️ DC Motor + Encoder</span>"]
%% Styling
style Web fill:#e1f5fe,stroke:#01579b,stroke-width:2px;
style Master fill:#e8f5e9,stroke:#1b5e20,stroke-width:2px;
style Servo fill:#fff3e0,stroke:#e65100,stroke-width:2px;
style Motor fill:#efebe9,stroke:#3e2723,stroke-width:2px;
Why use a Raspberry Pi Pico? Programming obscure chips like the MM32G0001 usually requires buying dedicated, expensive hardware programmers (like mm32link or ST-Link). By using a $4 Raspberry Pi Pico instead, we keep the project incredibly cheap and accessible. Even better: once you've flashed the servo board, you can wipe the Pico and reuse it as the master MicroPython controller for your entire servo network!
Step 1: Turn the Pico into a Programmer
Flash your Raspberry Pi Pico with the Picoprobe (Debug Probe) firmware to turn it into a CMSIS-DAP debugger. You can download the latest debugprobe_on_pico.uf2 file directly from the official Raspberry Pi GitHub Releases page. Just hold the BOOTSEL button, plug in the Pico, and drag-and-drop the file!
Step 2: Wire the Pico to the μDrive Board Connect these 4 wires from the Pico to the programming header on the μDrive board:
Step 3: Install the Software Tools
pip install pyocd
pyocd fails to detect your probe later, Windows likely installed the wrong default driver. Download the free Zadig tool, select "Picoprobe CMSIS-DAP" from the dropdown, and replace the driver with WinUSB).Step 4: Open and Flash!
Microdrive folder in VS Code.→ arrow at the bottom of the screen). PlatformIO will automatically compile the code and trigger pyocd to flash it onto the MM32G0001!Once the servo board is flashed, it listens for commands over a half-duplex UART line. You will need a "Master" microcontroller to send these commands.
To easily tune and monitor your servo network from your computer, you can run the provided Svelte WebGUI:
gui folder inside this repository.npm install to download the web dependencies.npm run dev to start the local server.localhost link in a browser that supports the Web Serial API (like Chrome or Edge) to connect to your Master MCU and start tuning!Microdrive is actively under development. Current focus areas include:
Contributions are welcome! Whether it's firmware, hardware, documentation, or the WebGUI — check out the Contributing Guide to get started. Found a bug or have an idea? Open an issue.
This project is fully open-source and OSHWA certified (UID: IN000092):
You are free to build, modify, and integrate μDrive into your own projects (commercial or hobbyist).
C
93.5%
Svelte
4.7%
Python
1.1%