PublishedSafety page

Started by the Pedalwise team from official manuals, support pages and repair videos

How to check and align your e-bike speed sensor magnet · Nov 8, 2026, 4:17 PM by Pedalwise team · reviewed Nov 8, 2026, 4:17 PM by Pedalwise team

First version

53 lines added, 0 removed

Added: 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](https://www.bosch-ebike.com/fileadmin/EBC/Service/Downloads/Bedienungsanleitungen/Bedienungsanleitungen-US/MY2018/PCX_201708_280P_PL_0275U07PDC_US_oReg.pdf?_=1515592675)). Bafang lists a speed sensor fault as error 21 ([Bafang error 21 solution sheet](https://www.bafang-e.com/uploaded/errcode/202209091016375212.pdf)). Codes differ by system and display, so check yours on [e-bike error codes](/wiki/e-bike-error-codes).
Added: ! 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.
Added:
Added: ## Before you start
Added:
Added: - 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.
Added: - 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.
Added:
Added: ## Steps
Added:
Added: ### Step 1: Power off and remove the battery
Added: Bosch says to remove the battery before any work on the bike, because the system could switch on by accident.
Added:
Added: ### Step 2: Find the magnet and the sensor
Added: 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.
Added:
Added: [photo] Spoke magnet and frame mounted speed sensor, with the sensor mark visible
Added:
Added: ### Step 3: Spin the wheel slowly and watch
Added: 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.
Added:
Added: [photo] Magnet lined up with the sensor mark as the wheel turns
Added:
Added: ### Step 4: Measure the gap
Added: 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.
Added:
Added: [photo] Ruler measuring the gap between magnet and sensor
Added:
Added: ### Step 5: Reposition the magnet
Added: 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.
Added:
Added: ### Step 6: Check the sensor cable and plug
Added: 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](/wiki/inspect-and-clean-connectors) for how to do that safely.
Added:
Added: ### Step 7: Reinstall the battery and test
Added: 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.
Added:
Added: ## When to get a pro
Added:
Added: - 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.
Added: - The sensor or its cable is cracked, cut or loose on the frame.
Added: - Your bike has no visible magnet or uses a design your manual does not explain.
Added:
Added: ! Leave sensor replacement, controller updates and motor work to a dealer or trained tech. [Find a shop near you](/find).
Added:
Added: Related: [no pedal assist](/wiki/no-pedal-assist), [motor cuts out](/wiki/motor-cuts-out), [Bosch e-bike troubleshooting](/wiki/bosch-ebike-troubleshooting), [Bafang troubleshooting](/wiki/bafang-troubleshooting).
Added:
Added: ## Sources
Added:
Added: - [Performance Line CX drive unit manual, Bosch eBike Systems](https://www.bosch-ebike.com/fileadmin/EBC/Service/Downloads/Bedienungsanleitungen/Bedienungsanleitungen-US/MY2018/PCX_201708_280P_PL_0275U07PDC_US_oReg.pdf?_=1515592675)
Added: - [Error 21 speed sensor solution sheet, Bafang](https://www.bafang-e.com/uploaded/errcode/202209091016375212.pdf)
Added:
Added: Stuck after these checks? [Find a shop near you](/find), or if you're in Austin, [book a Pedalwise tech](/book).

This version

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.

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.

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.

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.

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.

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, or if you're in Austin, book a Pedalwise tech.

All versions of this page