Error code 21 on new Bafang BBS01B

PASJames

1 mW
Joined
Jan 31, 2018
Messages
17
ERROR CODE 21: Recently took delivery of a new Bafang BBS01B mid drive. When first test driven the speed sensor worked fine on my C965 display which came new with the Bafang drive. I got speed and mileage readings. I then added a kickstand to the bike and accidentally crimped the speed sensor cable. When code 21 displayed, I first checked the location of the magnet...at 5mm it was fine. The sensor cable was not cut by the crimping but the copper of the black wire was exposed and possibly grounded to the frame? The red and white wires were fine. I repaired the cable and checked continuity of all three wires = fine. The speed sensor still does not work...still getting code 12. The three levels of pedal assist and the throttle work. The error code clears each time I pull the brake lever and shut off the motor.

With the display turned on, I checked the voltage of the red, black and white wires at the female plug end of the sensor cable where it connects to the sensor itself. Black to white = 0 volts. Red to black = 0 volts. Red (negative) to white (positive) = 64 volts. It seems 64 volts is not possible from a 36 volt 13 ah battery pack coupled to a 36 volt 250 watt BBS01B drive?? I checked my volt meter. It measured a 1.5 volt flashlight cell just fine on the DC setting and when switched to AC, measured our house current fine at 118 volts. So I assume the 64 volt DC reading was accurate.
Can anyone help me??
 
Don't get stuck on the 5mm distance between the magnet and the pick-up. It may be passing at the wrong place. Do the following checks with the wheel off the ground:

Turn the system on and check that the little red light at the far end of the pick-up is lit. Then turn the wheel in the forward direction and check that the red light turns off when the magnet passes the pick-up. It's a quick blink so turn the wheel slowly by hand and even stop it right when the magnet is at the pick-up.

If the red light never came on there is still a wiring problem that needs to be fixed.

If the red light comes on but does not go off when the magnet passes you need to adjust the position of the magnet and/or the pick-up.

I can't relate to your voltage issue, but I doubt the voltage is even as high as your battery voltage. Perhaps it is a fraction of a volt and your meter is set on the wrong place to get a good reading, etc. If the above doesn't fix your problem, post again and one of us will unplug the speed sensor and report the voltage we see.
 
Rassy. Thanks. I will go through the procedure you suggest and if that does not correct it, I will find another volt meter a retest. I agree a higher voltage than the 36 volt battery pack seems unlikely.
 
First of all, I checked Rassy's suggestion regarding the red light. It does not light up. So I un-taped the place on the sensor cable where I had repaired the crimping explained in my first post. I put 12 volts DC across the red and white wires and the red light lit up. Note the light only shines when positive is hooked to the white wire and negative to the red. Reversing this produces no light. Also, no connection combination with the black produced light.

Regarding my strange 64 DC volt reading: I was unable to secure a different voltmeter. But I triple checked to make sure my voltmeter works. It does, I but discovered upon closer inspection that the reading is 64 millivolts. I had not seen the tiny m on the display. In other words, the controller is not sending sufficient voltage to the sensor.

Does this mean my controller has a problem? Please recall that the bike functions perfectly fine...I have throttle control and three levels of PAS. It is just that the error code 21 appears and the speedometer/odometer does not read.

If anyone out there can, it would be much appreciated if you could post the voltages of the red, white and black wires on a working unit. On my unit when you unplug the cable from the sensor and look at the cable's female plug end with the flat portion down, the white is on the right, the black is on the left and the red is centered on top.

Also, it would be helpful if someone could explain in terms that are not too technical how the three wire sensor works with the C965 display. Is it something as simple as one wire carries voltage for the light, one functions as the ground and the third carries on and off continuity through a reed switch? Or is this the hall type which I don't really understand?
 
Typically the red wire is 5v power, black is ground, and white is the signal. On the BBS01, I don't know if this is the case.

Ground and 5v are pretty simple. 5v stays on steady when the power is switched on.

The signal line is normally high (5v) until the magnet is close, then it toggles low and returns to high once the magnet moves away.

If the signal line is shorted to the 5v line when it tries to pull down, it can fry the hall sensor. Randomly applying power to the wires is usually another good way to fry the sensor.

You can use the main battery negative wire as a reference and measure the voltage on 3 wires going to the sensor. You should have 5v on at least one of them.
 
Using Fechter's suggestions I did the following: Turned on the battery pack switch, powered up the speedo display and checked the sensor cable voltages this time using the battery's black wire ground. Red is 5 volts, white is 5 volts and black is low millivolts or zero.
I also once again checked the wires with each other: Red to black, red to white, white to black...all produce only millivolts.

Maybe this is confusing to me because I do not fully understand electrical circuits. At the sensor cable end, doesn't there need to be a positive (5 volts in this case) wire (usually red) and a ground wire to complete the circuit? Or is there something about Hall sensor technology I don't understand where the current path is different?
 
You're right, the hall sensor needs to complete the circuit.

From the measurements, it seems like your ground (black) wire is broken somewhere.

Try putting your meter in ohms mode, power off controller and measure resistance from battery negative to the 3 wires. The black wire should show near zero ohms. The others should show something in the kOhms range.
 
Fechter- Connecting my digital meter on the ohms setting to the battery pack negative and the black produces no reading...an open circuit. The red is 26 Meg and the white is 6.9 K.
Assuming the black ground is somehow disconnected/open in the sealed controller, can the black wire be connected safely to the battery negative to fix this problem?
 
One more thing: I posted originally that when I tested the sensor red light that it would only light when I connected positive voltage to the white wire and negative to the red. That was mistaken. It is the reverse. Positive to red and negative to white makes it light. No combination of using the black wire with my 12 volt testing source to white or red makes it light up.

Again, I'm not sure I understand how this Hall sensor works. Does it need three wires so that constant power it there as one circuit and the other circuit is used for the relaying the intermittent on/off of the magnet passing across the sensor??
 
PASJames said:
Again, I'm not sure I understand how this Hall sensor works. Does it need three wires so that constant power it there as one circuit and the other circuit is used for the relaying the intermittent on/off of the magnet passing across the sensor??

Right. Red and black supply power, which is constant and powers an amplifier circuit inside the hall sensor. The 3rd wire is for the signal which goes low when the magnet is close.

Yes, it should be OK to run a wire from the battery negative to the sensor.
 
I connected the black wire to the battery pack negative, turned the display on. No red light. I passed the magnet by hand past the sensor. No change at the display and no red light.

Deciding I needed to confirm that the red light actually still works, I disconnected the wire (above) to the battery pack and connected 12 volts DC to the black and the red...no red light. Connected 12 volts to the black and the white...no red light. Connected 12 volts to the red and the white...no light. Switched polarity (+ to red and - to white) and the red light lit up just as it had in the past.

Is it possible that the functions of the wires are different than we think?
 
PASJames said:
Is it possible that the functions of the wires are different than we think?

Totally possible. Since the wires are nicely bundled up in a cable and I can't see which color goes where on mine. But I am pretty sure one wire has to be ground, one is 5v and one is a signal.

It's also possible the sensor is toast, but the LED still works.

One more test: try taking the white wire and briefly touch it to the battery negative line and do this repeatedly to simulate the sensor working and see if you get a reading on the speedometer.
 
Fechter-
It worked! I cannot thank you enough for hanging in there with me working through possibilities. Your help is what these forums are all about.
After the trial connection you suggested worked, I took a reed switch sensor off an old bike and installed it. I have speedo and odo again! Now my wife and I can go riding together this afternoon along the Huntington Beach bike trail. She with her newly electrified bike and I on my Haibike MTB.
 
PASJames said:
Fechter-
It worked! I cannot thank you enough for hanging in there with me working through possibilities. Your help is what these forums are all about.
After the trial connection you suggested worked, I took a reed switch sensor off an old bike and installed it. I have speedo and odo again! Now my wife and I can go riding together this afternoon along the Huntington Beach bike trail. She with her newly electrified bike and I on my Haibike MTB.


James: Having similar problems with my Bafang giving me error code 21. Am on second speed sensor from LUNA. If this doesn't work, want to use a reed switch sensor like you have. Not at all familiar with reed switch sensors and If I go this route - can you send me a photo of your reed switch sensor or something I can purchase on-line that will work?

Many, many thanks. Roger Freedman, Berekeley, Ca. normal e-mail I use is woninberkeley@gmail.com
 
Roger-
If you read through the entire string, it will be clear that I don't have expertise in speedometer sensors. I got the idea of using an old sensor I had on another bike from a separate forum post. If I understand sensors correctly (and I may be wrong) there are the more sophisticated three wire hall sensors (the Bafang unit uses this) which need power to operate and the simpler two wire reed sensors which just use the spoke-mounted magnet passing by to open/close the contacts of the sensor. Through the assistance of the forum members, it became clear that there was something wrong with the power feed to my Bafang hall sensor. This was probably caused when I shorted something as explained in my post. However, testing showed that the on/off circuit for sending the wheel revolution cadence was operable. My understanding is that nearly all of the dozens of cheap bike speedometers you can buy on the internet use the reed type sensor. So you could just order one of them.
 
Back
Top