21
Speed sensor fault
Quick answer
Error code 21 signifies a fault with the speed sensor, which measures the wheel speed for the e-bike's controller. When this error occurs, the motor will not operate, and the display will show the error code. The issue is typically related to mechanical problems such as a misaligned magnet or a damaged cable.
Does this apply to your bike?
H700 · Bafang · Common displays: DP E171
Heads-up: the same number can mean different things on other systems — always check your drive system first. Browse all drive systems →
What you’ll notice
The display shows error code 21, and the motor is non-functional.
Likely causes, ranked
Start at #1 — causes are ordered by how often they turn out to be the problem.
#1 Misaligned or Missing Magnet
How to check: Inspect the spoke magnet to ensure it is properly aligned and not missing.
#2 Loose or Disconnected Sensor Connector
How to check: Check the sensor connector for a secure fit and proper seating.
#3 Damaged Sensor Cable
How to check: Examine the sensor cable for any visible damage or pinching.
#4 Failed Speed Sensor
How to check: Test the speed sensor functionality by checking if the LED blinks when the magnet passes.
Troubleshooting steps
-
Restart the System
Turn off the e-bike and then turn it back on to see if the error clears.
If it passes →Check the magnet position.If it fails →Proceed to check the speed sensor. -
Check Magnet Position
Ensure the spoke magnet is aligned correctly and within 10-20mm of the sensor.
If it passes →Check the sensor connector.If it fails →Adjust the magnet position. -
Inspect Sensor Connector
Look for loose connections or corrosion on the sensor connector.
If it passes →Check the sensor cable.If it fails →Clean or repair the connector. -
Examine Sensor Cable
Inspect the cable for any signs of damage or wear.
If it passes →Test the sensor functionality.If it fails →Replace the sensor cable. -
Test Speed Sensor Functionality
Spin the wheel and observe if the sensor's LED blinks.
If it passes →Error resolved.If it fails →Replace the speed sensor.
When to stop and get professional help
If the error persists after all checks and replacements, consult a professional.
Never open, puncture, or disassemble the battery pack, and never bypass the BMS. See our safety guide.
More codes for H700
Different number? Type it into the search box at the top of the page.
Did this fix your problem?
None% of riders reported this solved
Sources & verification
- "30" - Communication failed - Bafang E
- BAFANG | FAQs |
- Bafang Error Codes List: Meanings, Quick Fixes, and When to Contact a | Upway
- "21" - Speed sensor fault - Bafang E
- Bafang E-Bike Motor Error 21 Troubleshooting | Upway
- E21 E-bike Error Code Explained
Missing a code or step? Tell us.
Spotted a code we don’t cover, or a step that didn’t match your bike? Send it in — submissions shape what we research next.