How-to guide

How to check and align your e-bike speed sensor magnet

If your speed reads zero, assist cuts out or you get a speed sensor error, check that the wheel magnet passes the sensor at the gap your maker gives. Here is how, and when to hand it to a dealer.

The Pedalwise team started this page from official manuals, support pages and repair videos. Fixed this yourself, or spotted something wrong? Help improve it.

Battery and electrical safety. Lithium-ion batteries can catch fire if they're damaged or charged wrong. Never open a battery pack, and stop using any battery that's swollen, hot, wet or smells burnt. Every edit to this page is checked by a second person before it goes live.

Difficulty
Easy
Time
10 to 20 minutes

Tools

  • Screwdriver (to fit the magnet screw)
  • Ruler

Parts

  • Spoke magnet (only if yours is cracked or missing, from your bike's maker)

Most e-bikes measure speed with a small magnet on the wheel that passes a sensor on the frame. If the magnet gets knocked out of line, the system cannot read your speed. Bosch says that when the gap is wrong or the sensor is not connected properly, the speed display fails and the drive runs in an emergency mode (Bosch Performance Line CX manual). Bafang lists a speed sensor fault as error 21 (Bafang error 21 solution sheet). Codes differ by system and display, so check yours on e-bike error codes.

This guide is only about putting the magnet back where the maker intends. Never move, remove or add magnets or devices to change what the sensor reads. Bosch warns against any change to the system or add-ons meant to raise performance, and says unauthorized changes can cause death or serious injury. If the steps below don't fix it, see a dealer or a pro.

Before you start

  • Find your system's manual. Many systems put the magnet on a spoke, but some use a different design, so if you can't find a spoke magnet, check your manual before you go further.
  • Know your maker's gap. Bosch gives at least 5 mm and no more than 17 mm between magnet and sensor for the system in its Performance Line CX manual. Bafang's error 21 sheet gives 10 to 20 mm for Bafang systems. Use the number for your own system.

Steps

1Power off and remove the battery

Bosch says to remove the battery before any work on the bike, because the system could switch on by accident.

2Find the magnet and the sensor

On a spoke magnet system, look for a small magnet fixed to a spoke and a sensor mounted next to the wheel where the magnet passes. Bosch describes the magnet passing a mark on the sensor.

Photo needed: Spoke magnet and frame mounted speed sensor, with the sensor mark visible. Add one

3Spin the wheel slowly and watch

Turn the wheel by hand and watch the magnet go past the sensor. It should pass right by the sensor's mark, not above, below or far to the side of it.

Photo needed: Magnet lined up with the sensor mark as the wheel turns. Add one

4Measure the gap

Stop the wheel with the magnet next to the sensor and measure the gap with a ruler. Compare it with your maker's range, such as 5 to 17 mm for the Bosch system above, or 10 to 20 mm on Bafang systems.

Photo needed: Ruler measuring the gap between magnet and sensor. Add one

5Reposition the magnet

Bosch says to loosen the magnet's screw, move the magnet on the spoke so it passes the sensor mark at the right gap, and tighten the screw again. Recheck the gap and alignment after tightening, since the magnet can shift.

6Check the sensor cable and plug

Bafang's sheet says to look at the sensor plug and cable for looseness, corrosion, bent or broken pins, dirt, damaged insulation or a cracked shell. Follow inspect and clean connectors for how to do that safely.

7Reinstall the battery and test

Put the battery back, turn the system on and check that speed shows when you ride. Bafang's sheet starts and ends with restarting the system to see if the error clears. If speed still does not show, Bosch says to contact an authorized Bosch dealer.

Videos

Fix the Bosch E-bike 503 Error and Speed Not Reading from Bike Shop Girl: Shows how a misplaced or missing spoke magnet stops the speed reading on a Bosch system and how lining it up with the sensor clears the 503 error.
How-To: Fix Error Code 21 on Bafang's ULTRA Mid-Drive Motor from BAKCOU: An e-bike maker walks through clearing the Bafang speed sensor error 21 by checking the sensor and magnet on the rear wheel.

When to get a pro

  • The error comes back after the magnet and plug check out. Bafang's next steps use its BESST dealer service tool to read the sensor signal and update the controller, then replace the sensor, then the motor. Those are dealer jobs.
  • The sensor or its cable is cracked, cut or loose on the frame.
  • Your bike has no visible magnet or uses a design your manual does not explain.

Leave sensor replacement, controller updates and motor work to a dealer or trained tech. Find a shop near you.

Related: no pedal assist, motor cuts out, Bosch e-bike troubleshooting, Bafang troubleshooting.

Sources

Stuck after these checks? Find a shop near you.

Need a pro?

If these steps didn't fix it, find a shop near you in our partner network. For battery or wiring trouble, look for shops marked Battery and electrical.

Talk

Questions, things that worked for you, or something that looks wrong on this page.

Sign in to join the conversation.

CC BY-NC-SA 4.0Text by Pedalwise and contributors, shared under CC BY-NC-SA 4.0. Linked videos and manuals keep their own terms. How to reuse it