HomeBafang › Error 21

Bafang error 21: Speed sensor error

Bafang BBS01/BBS02/BBSHD, M-series mid-drives and hub motors (UART & CAN displays)Fix at homeRide with caution

The controller does not receive a wheel speed signal. Typical symptoms: speed shows 0 while riding, assist cuts out after a few seconds, or assist is limited to walk-mode power. This is the most common Bafang code and almost always a sensor or magnet problem.

Likely causes

How to fix Bafang error 21

  1. Find the spoke magnet and align it with the sensor at a 2-5 mm gap; tighten it
  2. Check the sensor is fixed firmly and its cable runs undamaged to the connector
  3. Unplug the sensor connector, dry and clean it, plug back in; power cycle
  4. Spin the wheel with the display on: the speed reading should appear at the moment the magnet passes
  5. Replace the sensor and magnet (cheap, plug-and-play)
  6. If a new sensor changes nothing, have the harness and controller input tested
Go to a dealer if: Go to a shop if a new sensor and correctly placed magnet still give error 21; the fault is then in the harness or controller.
Warranty: Bafang parts are usually sold through dealers or online resellers; warranty is typically 1-2 years via the seller, and this code alone is rarely a warranty claim.
Typical cost: Sensor plus magnet EUR/USD 10-30; usually a free fix by realigning the magnet.
Still stuck? Take a photo of the display and show it to a local e-bike workshop. Bring the bike's system name (e.g. Bosch Performance Line CX) and the exact code; that saves diagnostic time and money.

Frequently asked

How do I reset Bafang error 21?

Fix the magnet gap and power cycle. The code clears as soon as the controller sees a speed pulse.

Can I keep riding with error 21?

Yes, safely, but assist will be limited or cut. Ride home and fix the magnet.

Is error 21 a warranty issue?

Rarely; a moved magnet is not a defect. A sensor that fails early can be replaced under seller warranty.

Related Bafang codes

26 · Torque sensor speed signal error30 · Communication error

Not an official Bafang document. Compiled from workshop experience and public service information; details can differ per system version and bike brand.