Error code 21 on new Bafang BBS01B

Discussions related to motors other than hub motors.
This includes R/C motors, botttom bracket, roller and geared drives.
Post Reply
PASJames
100 µW
100 µW
Posts: 8
Joined: Jan 31, 2018 7:29 pm

Error code 21 on new Bafang BBS01B

Post by PASJames » Jan 31, 2018 7:37 pm

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??

User avatar
Rassy
1 MW
1 MW
Posts: 1933
Joined: Apr 08, 2007 10:58 am
Location: Eugene, Oregon USA

Re: Error code 21 on new Bafang BBS01B

Post by Rassy » Jan 31, 2018 8:25 pm

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-
One Tadpole Trike equipped with a Bafang BBS02
https://endless-sphere.com/forums/viewt ... 28&t=69419
One Delta Trike equipped with a Bafang BBS02
https://endless-sphere.com/forums/viewt ... 0#p1291260

PASJames
100 µW
100 µW
Posts: 8
Joined: Jan 31, 2018 7:29 pm

Re: Error code 21 on new Bafang BBS01B

Post by PASJames » Feb 01, 2018 11:38 am

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.

PASJames
100 µW
100 µW
Posts: 8
Joined: Jan 31, 2018 7:29 pm

Re: Error code 21 on new Bafang BBS01B

Post by PASJames » Feb 01, 2018 3:19 pm

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?

User avatar
fechter
100 GW
100 GW
Posts: 12156
Joined: Dec 31, 2006 3:23 pm
Location: California Bay Area, USA

Re: Error code 21 on new Bafang BBS01B

Post by fechter » Feb 01, 2018 3:43 pm

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.
"One test is worth a thousand opinions"

PASJames
100 µW
100 µW
Posts: 8
Joined: Jan 31, 2018 7:29 pm

Re: Error code 21 on new Bafang BBS01B

Post by PASJames » Feb 01, 2018 4:52 pm

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?

User avatar
fechter
100 GW
100 GW
Posts: 12156
Joined: Dec 31, 2006 3:23 pm
Location: California Bay Area, USA

Re: Error code 21 on new Bafang BBS01B

Post by fechter » Feb 01, 2018 7:49 pm

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.
"One test is worth a thousand opinions"

PASJames
100 µW
100 µW
Posts: 8
Joined: Jan 31, 2018 7:29 pm

Re: Error code 21 on new Bafang BBS01B

Post by PASJames » Feb 02, 2018 1:09 pm

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?

PASJames
100 µW
100 µW
Posts: 8
Joined: Jan 31, 2018 7:29 pm

Re: Error code 21 on new Bafang BBS01B

Post by PASJames » Feb 02, 2018 2:20 pm

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??

User avatar
fechter
100 GW
100 GW
Posts: 12156
Joined: Dec 31, 2006 3:23 pm
Location: California Bay Area, USA

Re: Error code 21 on new Bafang BBS01B

Post by fechter » Feb 02, 2018 3:39 pm

PASJames wrote:
Feb 02, 2018 2:20 pm

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.
"One test is worth a thousand opinions"

PASJames
100 µW
100 µW
Posts: 8
Joined: Jan 31, 2018 7:29 pm

Re: Error code 21 on new Bafang BBS01B

Post by PASJames » Feb 02, 2018 6:26 pm

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?

User avatar
fechter
100 GW
100 GW
Posts: 12156
Joined: Dec 31, 2006 3:23 pm
Location: California Bay Area, USA

Re: Error code 21 on new Bafang BBS01B

Post by fechter » Feb 02, 2018 7:33 pm

PASJames wrote:
Feb 02, 2018 6:26 pm
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.
"One test is worth a thousand opinions"

PASJames
100 µW
100 µW
Posts: 8
Joined: Jan 31, 2018 7:29 pm

Re: Error code 21 on new Bafang BBS01B

Post by PASJames » Feb 03, 2018 2:12 pm

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.

User avatar
fechter
100 GW
100 GW
Posts: 12156
Joined: Dec 31, 2006 3:23 pm
Location: California Bay Area, USA

Re: Error code 21 on new Bafang BBS01B

Post by fechter » Feb 04, 2018 2:39 pm

Awesome. A reed switch works fine and doesn't need the 5v line.
"One test is worth a thousand opinions"

Post Reply