OPEN-SOURCE FIRMWARE TURNS A CHEAP MID-DRIVE E-BIKE MOTOR INTO A SMOOTHER RIDE
Cheap mid-drive motor, terrible factory firmware — open-source replacement makes it read torque properly.
AutomationOpen-hardware
- difficulty
- ●●●○○
- time
- an afternoon
- license
- GPL-3.0
- repo
- repo ACTIVE276 stars
●●●○○ · an afternoon · GPL-3.0 · 276 stars · repo ACTIVE
WHAT YOU’LL NEED
- Electronic parts — full list with part numbers in the repo BOM
- Dev board / microcontroller — runs the project firmware
Partner
COMPAREE VERDICT
The TSDZ2 is one of the cheapest mid-drive motors and its factory firmware is the worst part of the package — jerky power delivery, crude torque sensing. This GPL-3.0 firmware replaces it and reads the motor's torque sensor frame-by-frame, so assistance follows how hard you pedal instead of stepping through fixed levels. The result is smoother, more natural, and much less tiring on long rides. The project is mature, with years of community use and active forks. Flashing requires opening the motor casing, soldering or buying an ST-Link programmer cable, and following a Windows-based guide (or running a VM). The single biggest trap is buying a motor kit that does not include the torque sensor version of the TSDZ2 — the non-sensor version exists and the firmware cannot fix that. If you already own a TSDZ2 and hate how it rides, this is the obvious fix. If you are buying new, budget 800–1,100 dollars for motor plus battery, then add the afternoon to flash it.
IN THE REPO
NOT IN THE REPO
- —GPL-3.0 licence, free for any use including commercial.
- —Firmware source, flashing instructions, and configurator app all present.
- —Bill of materials is the motor kit itself (TSDZ2) plus battery and optional displays — not a PCB build.
- —No STM32 programming cable is included in most kits; you will need to buy or make one.
- —Active fork emmebrusa/TSDZ2-Smart-EBike-1 has most recent commits (last push May 2026).
- —Local e-bike speed and power limits apply; the firmware lets you configure beyond legal limits but riding that way is your liability.
Can I build this?
Build at your own risk. Projects involve tools, electronics and sometimes mains voltage — follow the creator’s safety notes.
Partner · KickstarterHeyGears G1: 10M+ colors and transparent parts in one print, plus UV printing on flat objects. Figures, parts and labels — no painting.
Videos
Community installation video linked in payload; specifics not extracted.
Gallery
Start here
Navigation into the creator’s own docs — we don’t rewrite the guide, we route you to the source.
- 1.Confirm your motor kit is the TSDZ2 with torque sensor (not the cadence-only version)(The firmware cannot add torque sensing if the hardware lacks it.)
- 2.Read the flashing guide in the wiki (Covers opening the motor, soldering the ST-Link connection, and Windows flashing steps.)
- 3.Check the active fork emmebrusa/TSDZ2-Smart-EBike-1 for latest commits(Most recent development happens in the fork; original repo is the documentation home.)
- 4.Install the configurator app to tune assistance curves after flashing(Android app in the repo lets you adjust torque response and power levels from your phone.)
Resources
Documentation, files and community threads for this build — we link straight to the original sources and never rehost the creator’s files.
- Reddit discussion thread reddit.com
- Build video youtube.com
- Build video youtube.com
- Build video youtube.com
KNOWN ISSUES
- Buying a TSDZ2 kit without torque sensor — the cadence-only version exists and looks identical in listings; firmware cannot fix missing hardware.
- No ST-Link programmer cable in most kits — you will need to buy or make one, and soldering to the motor controller board is required.
- Flashing guide is Windows-based; macOS and Linux users will need a VM or wine setup.
- Opening the motor casing voids any warranty, and reassembly requires threadlock on certain bolts or they will vibrate loose.
- Configuring power or speed beyond local legal limits is possible in firmware but riding that way is your own liability.
- Some display units are not compatible with the open firmware — check the wiki list before buying a display separately.
Does this work with the non-torque-sensor TSDZ2?
No. The firmware reads the torque sensor frame-by-frame; if your motor has only a cadence sensor the firmware cannot add that capability.
Will this void my motor warranty?
Yes. You open the casing, solder to the controller board, and replace the factory firmware.
Which fork should I use?
emmebrusa/TSDZ2-Smart-EBike-1 has the most recent commits (last push May 2026). The original OpenSourceEBike repo is the documentation and community home.
Can I flash this without soldering?
No. The ST-Link programmer must connect to pads on the motor controller board, and those are not brought out to a connector.
Is this legal?
The firmware is GPL-3.0 and legal to install. Riding an e-bike with power or speed beyond local limits is a separate question and your own responsibility.
Community builds
No community builds yet — be the first, we feature the best ones.
Discussion1
FROM THE COMPAREE TEAM
The motor kit plus battery runs 800–1,100 USD, but the firmware that makes it rideable is free. If you have ridden both stock and flashed TSDZ2, what surprised you most about the difference?
OpenSourceEBike community
Started by contributors frustrated with the TSDZ2's factory firmware. Now maintained as a community project with active forks and years of field use.
DISCLAIMER
- Comparee is not the author of the projects featured here. All rights to each project belong to its creator — every page links to the original source, and we never host creators’ files.
- Information is provided without warranty and may become outdated as projects evolve. Prices are indicative bands only — always check the creator’s parts list for current costs.
- Building and operating any project is at your own responsibility. Protective equipment, safe workshop practice and compliance with local regulations are the builder’s responsibility.


CompareeTEAM21d ago
Practical notes from our verification: the most active development has moved to the emmebrusa fork (last push May 2026), but the original OpenSourceEBike repo remains the documentation home and the one most walkthroughs reference. The flashing guide is thorough but Windows-focused — macOS and Linux users report success with VMs, though setup takes longer. The single biggest mistake is buying a TSDZ2 without confirming it has the torque sensor; the cadence-only version looks identical in many listings and the firmware cannot fix missing hardware. One more note from the community: some people skip the configurator app and ride the default curves, but the app is where the firmware really shines — being able to tune torque response from your phone mid-ride is the difference between 'better' and 'completely different motor'.