Bafang BBS Speed Sensor Error 21 Fix

Bafang BBS01 Speed Sensor

My Bafang BBS01 mid-drive electric which was fitted originally to my Bacchetta Giro 20 ATT and is now fitted to my Giant Defy 1 road bike has registered the dreaded Error 21 which means a speed sensor fault. Replacing the sensor with a new Bafang BBS speed sensor from EM3EV has not fixed the problem so here is what I have done to fix the problem.

Error 21 on the Bafang BBS Means …

First up the Bafang BBS Error 21 means a speed sensor fault which in turn “kills the Bafang C961 display”. This means no data is displayed and there is no ability to change assist levels once the error is registered. Thankfully the motor continues to work and because there is delay before the Error 21 is registered there is time to set the desired assist level. So all up there is not a total loss of functionality, more a loss convenience.

In my case I did try a replacement Bafang BBS speed sensor without any luck and I suspect I have a problem at the controller end (the speed sensor is “hard-wired” so to speak into the motor). Fixing the problem at the motor is a bit more involved as the controller needs to removed and the wiring or connection issue sorted if possible. An alternative fix is a using a reed switch speed sensor.

Reed Switch Speed Sensor Fix for Bafang BBS Error 21

The Bafang BBS Error 21 speed sensor problem was recently raised in an Endless Sphere thread. From that thread discussion I got the idea of swapping out the Bafang BBS speed sensor for a simple reed switch speed sensor commonly found on low-end bicycle computers.

As it was I had a speed sensor extension which I no longer use following the switch over to the Giant Defy 1 so I had something to experiment with. Not having an old bicycle computer with a reed switch I ordered a cheap (read under $4.00) bicycle computer from eBay that came with a reed switch. In my case this was described as a TIAU Bicycle Computer. It looks like it comes with what BMS Battery sell as a reed switch sensor, a King Meter Speed Sensor.

Bafang Reed Switch Sensor

Bafang Reed Switch Speed Sensor

The Bafang BBS speed sensor cable is a three-wire configuration: red, white and black and the TIAU bicycle computer sensor switch is a two wire cable: black and black. I joined the white and black wires from the Bafang cable to the twin wires from the TIAU sensor, hence leaving the red wire unconnected. Preliminary testing indicates that TIAU speed sensor is performing as expected and I am getting a speed reading on the C961 display and no Error 21.

Bafang BBS Reed Switch Speed Sensor

Bafang BBS Reed Switch Speed Sensor

Wiring using the speed sensor extension cable whilst giving more length than I need does give me a joining point and the option to down the track to go back to a Bafang speed sensor if required.

I feel that I have been able to tidy the wiring up sufficiently to give this repair a decent run to see how it works. I also made use of some self-amalgamating tape to waterproof the connection. With winter coming on I guess I will find out if this taping has done the trick or not.

31 Responses to Bafang BBS Speed Sensor Error 21 Fix

  1. David 30 April 2015 at 2:36 AM #


    I have exactly the same problem with my Bafang . I’m getting no voltage between the red and the black wire but am getting 5V between the white and the black wire. Have tried to install a reed sensor but I get no response when I move the magnet in front of the sensor. Do you think I need to reset the display?

    Regards David

    • Aushiker 30 April 2015 at 8:21 PM #

      Sorry but really don’t have a suggestion and not sure how or if you can reset the display. IIRC I was not getting any voltage at all. I assume that you have wired the reed switch sensor to the white and black wires, leaving the red isolated?

    • Claude Gousenbourger 2 August 2019 at 1:35 AM #

      Just turn the plot 180 degrees !

  2. Kory Garretson 10 December 2015 at 1:50 AM #

    My new bafang motor is throwing error code 21 as well. After initial turn on the battery indicator flashes empty and after a moment or two of throttle the error code 21 appears. Strangely enough the speed sensor seems to be working properly before the error code, as long as no throttle is applied the display registers speed and the small red light on the sensor itself functions. PAS also works as normal. This is a BBSHD, battery is pushing 39V according to voltmeter. Any thoughts? Thanks.

    • Aushiker 15 December 2015 at 9:42 PM #

      Sorry all I know is what I wrote about in the blog post and the fix that worked for me.

      • Uilleam 22 May 2016 at 12:28 PM #

        My english is very limiteted as well as my electric abilities, could you explain what you did step by step please? Hope im not asking too much, this is a verh annoying problem. Thanks!

        • Aushiker 22 May 2016 at 9:24 PM #

          Sorry but what I have posted here is about all I provide to help.

  3. Uilleam 22 May 2016 at 12:11 PM #

    Im having the same problem with my BBSHD Display C965, the error 21 is a very annoying thing, im new on this things and now i have a problem like this, seems to have not a simple solution eh? any recommendation man?

  4. BRAD GRACIE 15 August 2016 at 8:06 PM #

    Uilleam, take your BBSHD /Bike back to the outlet, or to their recommended service mechanic. If it is less than what..2 years old, it will be under warranty. Otherwise, instead of stressing out about it and trying to fix something using second hand knowledge, and possibly stuffing it up more, just pay a bike mechanic that knows e bikes to do the job. $60-100 should see you with a new sensor, and pay for the labour involved.

  5. Dirk W 23 August 2016 at 9:27 AM #

    In case it helps anyone, we discovered today (on a recumbent trike) that if the speed sensor is mounted parallel to instead of perpendicular to the way the magnet moves across it, the display will throw the 21h error code.

    • Daniel 13 October 2016 at 3:37 PM #

      I was getting the error 21 also untill I changed the position of my censor like you said and it works fine now no more error 21. Thank you very much for sharing what you discovered.

      • Aushiker 13 October 2016 at 4:39 PM #

        Glad to help and thanks for letting me know.

    • oczc 9 November 2016 at 4:08 AM #

      thanks for comment. Fresh installed bbs02 here and sensor was not working with the metal-thing mounted.
      However if I moved the magnet by hand the sensor registered it.
      Changed mounting position -> works.
      Thanks dude, you saved me a lot of trouble.

      • Aushiker 9 November 2016 at 6:32 AM #

        Cool to hear you have got it sorted.

    • 2 tanners 24 January 2017 at 12:10 PM #

      That fixed mine too – the circular sensor that points at the magnet on the wheel had been bumped so it was pointing at the sky instead. Once back in its correct position, no more problems. Thanks, Dirk W and Aushiker

    • admin 27 May 2017 at 7:40 PM #

      Discovered that too!

    • Paul@EV 4 July 2018 at 12:36 PM #

      Today 2018.07.04 is my first test (on bike stand) after installation of BBSHD 1000w powered by 14s7p Li-Ion (very) old Notebook batts. My 1st power-on and after few minutes, the display shows “Error 21H Controller report” and it does not register speed nor distance. I had the speed sensor installed on my Bianchi Kuma 27.5 MTB with the “plus sign” on the sensor (should be the sensing window) point upward thinking that it should be ok. It is not. I thought it might be from that Dead-on-Arrival speed sensor bought from AliExpress and how could I claim it – do not want to imagine the hassle going through all that. Perhaps, it might also be from that little broken wire that I already fixed when opening the BBSHD motor to thoroughly lube all the gears with Mobilgrease 28.

      After reading “Dirk W August 23, 2016 at 9:27AM” comment re orientation of the sensor, decide to give it a try. It works at an instant after I re-orient the sensing window pointing towards the wheel and facing directly into the magnet!! Now everything looks good. Will give it a road test soon. Thanks a bunch to Aushiker and Dirk W for their posts and fixes.

  6. Frank Lo 30 November 2016 at 1:50 AM #

    Has anyone got Error 20 before? It showed up on my bike yesterday. What does it mean??

  7. Jonas Fjellhaug Gressnes 30 January 2017 at 8:29 AM #

    I had this error and all I did was to put an extra round magnet from the hydraulic brake kit on the magnet on the spokes so it’s closer to the sensor and the error went away. It was a brand new motor kit and I got the error on my first power up.

    • Nikolay 29 May 2017 at 4:08 AM #

      Same to me. But i had to add two, because i installed bafang on fatbike.

  8. admin 27 May 2017 at 7:45 PM #

    As posted above in comments, but worth repeating, make sure the sensor is horizontal, not vertical, as this can cause it not to function properly and throw up an error 21.

  9. Thor 13 June 2017 at 2:39 PM #

    Replaced mine now, I think the old Hall-sensor was broken. Just bought a cheapo speedo-sensor and soldered it in directly. Works very good and the new reed-sensor does not need voltage to work.

  10. Mak 7 September 2017 at 10:00 AM #

    Similar 21 code pay attention to 3 very small wires in connecting end, they can bent and not connecting correctly.

  11. Martin 2 April 2018 at 1:18 AM #

    Thanks! That helped a lot. I did connect a hydraulic brake sensor as a speed sensor. Works fine!

    • Ray 4 February 2019 at 2:56 AM #

      Martin, the Bafang hydraulic brake sensors use a 2 pin Higo connector and the Bafang speed sensor is a 3 pin Higo connector…….I know the red wire is not to be used as it is the bias voltage from the controller…..did you have to modify any of the connectors?

  12. Hannes 6 May 2019 at 3:41 AM #

    Thanks! I had the same problem. Your solution worked great.

  13. Bill De Vere 10 May 2019 at 12:37 AM #

    I had the same error 21 with my BBSHD the first time I powered up, and the 2nd and the 3rd time but it turned out the only thing wrong with the Bafang speed sensor I bought from Luna Mate Australia in WA was the install info. As soon as I squared the magnet face up with the + on the pickup the red light came on and everything worked great.

  14. H-D 22 May 2019 at 6:50 PM #

    Thank you soooo much for this discussion. I’m amazed Bafang doesn’t make a point to tell folks about the importance of orientation for the sensor/magnet. I also had error 21 and when I did this simple fix all was well.

  15. Claude Gousenbourger 2 August 2019 at 1:57 AM #

    The plot was turned 180 degrees. Turned back in the good position, problem solved.

    • alan mercer 1 June 2020 at 1:18 AM #

      All I had to do to get rid of CR 21 error was align it better and clean both magnetic heads. 10 min.

  16. Muru 2 June 2020 at 12:42 AM #

    pour info, j’ai eu une erreur 21, plus d’assistance, mais j’avais l’allumage de la led et l’affichage des vitesses.Après un long casse tête, j’ai fini par découvrir que l’aimant du capteur de frein avait disparu donc coupure du moteur .
    FYI, I had an error 21, more assistance, but I had the LED on and the speed display. After a long headache, I finally discovered that the magnet of the brake sensor disappeared, therefore engine shutdown.

Please share your thoughts ...

This site uses Akismet to reduce spam. Learn how your comment data is processed.

WP Twitter Auto Publish Powered By :
%d bloggers like this: