Getting error 21 on e-bike with Bafang M400 motor

ma_ko

1 µW
Joined
May 23, 2025
Messages
2
Location
Poland
I have a Van Holland vh4 electric bike with Bafang M400 250W motor. Bought it used and for severeal weeks I had no problems with it. But suddenly one day it stopped showing speed, displayed error 21 and stopped assisting mid-trip. It then started happening on every trip. After several kilometres of riding it would suddenly error out. First thing I though it's a speed sensor. I removed my old one. It was a 4 pin CAN version. Bought the same on aliexpress, installed it and... nothing. It still shows the error :(

But now that I think about it, maybe the motor/electronics overheats. It walys happen after several kilometers. And after waiting for 10-15min I can drive for another few hundred meters. But what exactly causes this I don't know. Hence my question. Thanks in advance.
 
So if you changed the speed sensor to a new one and you are sure the magnet passes it at correct place (chapter 6.3.7) and you still get error 21 then it's probably the controller itself. Try another controller, it's easy to remove, but if you look for a new one search for the correct one!
Controller M400 Can(bus) <your battery voltage> 250W
 
Yeah, it's probably the controller. Today I've called several service centers in my country on some technicians I managed to talk to suggested that if I checked everything else it's the controller's fault... I'll look around for it.
 

Attachments

  • 2025-05-23 20.42.14.jpg
    2025-05-23 20.42.14.jpg
    3.1 MB · Views: 6
It might be worth trying to adjust that magnet closer to the sensor. I have a similar sensor, and it was pretty flakey (registering speed, then dropping to zero) , so I needed to move it further down on the chainstay in order to get the magnet to within about 10mm.
 
It is always worth a try to place the sensor a little closer to the magnet before buying a new controller. If possible put a washer between sensor and frame so the distance between sensor and magnet is less than 15mm. You never know :)
 
Back
Top