OPEN-SOURCE FIRMWARE TURNS A CHEAP MID-DRIVE E-BIKE MOTOR INTO A SMOOTHER RIDE

Cheap mid-drive motor, community firmware — the open-source replacement makes it more efficient and more responsive.

by OpenSourceEBike community

FULL CAD BOM FIRMWARE DOCS

AutomationOpen-hardware

difficulty
●●●○○
time
an afternoon
license
GPL-3.0
repo
repo DISCONTINUED (ACTIVE FORK: EMMEBRUSA/TSDZ2-SMART-EBIKE-1)277 stars
1
Jump to section

COMPAREE VERDICT

The TSDZ2 is one of the cheapest mid-drive motors, and this GPL-3.0 community firmware replaces its factory software. The project says the motor runs more efficiently with it, so it feels more powerful, uses less energy and is more responsive, and supported displays add features. The original repository is no longer developed — its maintainers moved on to a VESC-based approach — but work continues in the emmebrusa fork, which also ships a Java configurator. Flashing needs an ST-Link V2 wired to the motor's wheel speed sensor plug, with STVP on Windows or stm8flash on Linux. The biggest trap is the controller version: this firmware is for controller v1, and v2 has its own project. Installing it voids the warranty of the motor and the KT-LCD3 display, and the project offers no safety guarantee. If you already own a TSDZ2 and want more control over how it rides, this is the obvious thing to try.

GOOD TO KNOW

  • —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 ST-Link V2 programmer is included in most kits; you will need to buy one (cheap clones work) for the STM8S105 controller.
  • —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.

Parts to buy

4 items

From our check of the build. Exact quantities and part numbers are in the creator’s BOM.

  • TSDZ2 motor kit (controller v1 for this firmware)Find
  • E-bike batteryFind
  • Supported displayFind
  • ST-Link V2 programmer (cheap clones work)Find

BUILDS OF THE WEEK

Five open-source builds worth your weekend, every week.

Checked like this one: what’s really in the repo, what it costs, how hard it is. One email, unsubscribe anytime.

Can I build this?

Printnothing required
BuyTSDZ2 motor kit (controller v1 for this firmware), an e-bike battery, a supported display, and an ST-Link V2 programmer (cheap clones work)
ToolsST-Link V2, a few short female jumper wires or a spare speed sensor cable, a PC (STVP on Windows, stm8flash on Linux or Mac); soldering iron only if you make an adapter plug
SkillsComfortable wiring three pins on a connector and following firmware configuration and flashing steps. No coding required.
Timean afternoon including making the ST-Link cable for the speed sensor plug, configuring and flashing
Cost$$$, dominated by the motor kit and battery — firmware is free
SafetyDisconnect the battery before attaching the ST-Link wires — the wiki warns that some clones get damaged otherwise — and follow the wiki's power-on steps for the actual flash. Back up the existing firmware first. The project gives no safety guarantee. Local e-bike speed and power laws apply, and the firmware lets you configure beyond them.

Build at your own risk. Projects involve tools, electronics and sometimes mains voltage — follow the creator’s safety notes.

Videos

Community review of the TSDZ2 open-source firmware by jbalatutube; the project wiki is the step-by-step flashing reference.

More builds like this

All projects

Start here

Navigation into the creator’s own docs — we don’t rewrite the guide, we route you to the source.

  1. 1.Confirm your TSDZ2 has controller v1 (v2 needs the separate TSDZ2_motor_controller_v2 project)(Flashing the wrong controller version will not work.)
  2. 2.Read the flashing guide in the wiki (Covers wiring the ST-Link to the wheel speed sensor plug and flashing on Windows (STVP) or Linux (stm8flash).)
  3. 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. 4.Install the configurator app to tune assistance curves after flashing(The emmebrusa fork includes a desktop Java configurator to set assistance levels, torque response and power limits before you compile and flash.)

Resources

Documentation, files and community threads for this build — we link straight to the original sources and never rehost the creator’s files.

KNOWN ISSUES

  • Check which controller your TSDZ2 has before flashing: this firmware is for controller v1; controller v2 has its own separate project.
  • No ST-Link programmer in most kits — buy an ST-Link V2 clone and wire it to the wheel speed sensor plug as the wiki shows (GND and SWIM, plus 5V if flashing without the battery); keep the wires short, around 10 cm.
  • The main flashing tool (STVP) is Windows-only; on Linux or macOS use stm8flash as described in the wiki.
  • Installing the firmware voids the motor and display warranty, and there is no safety guarantee — the project says you use it at your own risk.
  • 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.

Will this void my motor warranty?

Yes. The project states that installing this firmware voids the warranty of the TSDZ2 motor and the KT-LCD3 display.

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?

Yes. The ST-Link V2 connects to three pins (GND, 5V and SWIM) on the motor's wheel speed sensor plug — you can poke wires in directly or make a small adapter plug. No need to open the motor.

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 and battery cost real money, but the firmware that changes how it rides is free. If you have ridden both a stock and a flashed TSDZ2, what surprised you most about the difference?

CompareeTEAM2mo agoedited

Practical notes from our verification: the original OpenSourceEBike repository now says plainly that it is not in development anymore — its maintainers moved on to a VESC plus ESP32-C3 approach — but its wiki is still the documentation most walkthroughs reference, and work continues in emmebrusa's forks (last pushes in May 2026), which also ship the Java configurator. Check which controller your motor has first: this firmware targets the TSDZ2 with controller v1, and v2 has its own separate project. Flashing is done with an ST-Link wired to the wheel speed sensor connector (the MCU is an STM8S105); on Linux the wiki uses stm8flash. The README is blunt that installing the firmware voids the warranty of the motor and the KT-LCD3 display and comes with no safety guarantee, and it advises you to check your country's laws and configure the motor accordingly. Correction (4 October 2026): we re-checked this page line by line against the project's own repository, documentation and videos, and fixed errors in earlier versions.

OpenSourceEBike community

Built and maintained for free by a community of users under OpenSourceEBike. The original repository is no longer developed; work continues in community forks such as emmebrusa's.

GitHub

Star the project on GitHub

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.