casainho
10 GW
- Joined
- Feb 14, 2011
- Messages
- 6,058
I just started to gather information and seems possible to develop our own firmware, that would be mainly based on our current OpenSource firmware for TSDZ2 and that implements FOC. This would also would mean support for the displays 850C color and SW102 Bluetooth, also running our OpenSource firmware.
The information I have and I will keep updating on this wiki page: https://github.com/OpenSource-EBike-firmware/Bafang_BBS02_BBSHB/wiki
- Does anyone knows what are the other ICs references other than the microcontroller?
- Can someone please shared more detailed pictures of the motor controller from both sides?
BBSHD motor controller
Motor controller (unpotted):
This motor controller hardware seems very similar to the TSDZ2 one, except that it has not the torque sensor part. There are power resistors to read the battery current and the microcontroller can control the 6 PWM channels that controls the power mosfets. Also there are the 3 motor hall sensors connections.
Since the microcontroller has only 32 kbytes of flash memory and the hardware is similar to the TSDZ2, the firmware for Bafang could be mostly based on our OpenSource firmware for TSDZ2 that implements FOC motor control. This would also mean that this Bafang motor would support the displays 850C color and SW102 Bluetooth, also running our OpenSource firmware.
Microcontroller
Microcontroller is the STC15W4K32S4, based on a 8051 CPU, runs at 35 MHz and has 32 kbytes of flash memory.
* Product page: https://www.stcmicro.com/STC/STC15W4K32S4.html
* Datasheet: STC15W4K32S4-en.pdf
* Available free OpenSource SDDC compiler and flasher stcgal, as also working firmware with makefile, see here: https://github.com/YaoFei509/stc_diyclock
* There is a cheap 3€ development board available on Aliexpress, search for "system board IAP15W4K58S4 core board STC15W4K56S4"
BBS02 motor controller
This motor controller seems similar to BSSHD motor controller. Probably the firmware would be the same with minor differences.
DIY torque sensor
Bafang DIY motors miss a torque sensor. Maybe a torque sensor could be added to the pedal cranks like this:
- Youtube: V3 Power Meter - Introduction to the Build and V3–Power Meter–The Complete How To
- Youtube: https://www.youtube.com/watch?v=ZZnG135o4ZQ and ESPeedo an ESP8266 Bicycle "Power" Sensor
The information I have and I will keep updating on this wiki page: https://github.com/OpenSource-EBike-firmware/Bafang_BBS02_BBSHB/wiki
- Does anyone knows what are the other ICs references other than the microcontroller?
- Can someone please shared more detailed pictures of the motor controller from both sides?
BBSHD motor controller
Motor controller (unpotted):

This motor controller hardware seems very similar to the TSDZ2 one, except that it has not the torque sensor part. There are power resistors to read the battery current and the microcontroller can control the 6 PWM channels that controls the power mosfets. Also there are the 3 motor hall sensors connections.
Since the microcontroller has only 32 kbytes of flash memory and the hardware is similar to the TSDZ2, the firmware for Bafang could be mostly based on our OpenSource firmware for TSDZ2 that implements FOC motor control. This would also mean that this Bafang motor would support the displays 850C color and SW102 Bluetooth, also running our OpenSource firmware.
Microcontroller
Microcontroller is the STC15W4K32S4, based on a 8051 CPU, runs at 35 MHz and has 32 kbytes of flash memory.
* Product page: https://www.stcmicro.com/STC/STC15W4K32S4.html
* Datasheet: STC15W4K32S4-en.pdf
* Available free OpenSource SDDC compiler and flasher stcgal, as also working firmware with makefile, see here: https://github.com/YaoFei509/stc_diyclock
* There is a cheap 3€ development board available on Aliexpress, search for "system board IAP15W4K58S4 core board STC15W4K56S4"
BBS02 motor controller
This motor controller seems similar to BSSHD motor controller. Probably the firmware would be the same with minor differences.
DIY torque sensor
Bafang DIY motors miss a torque sensor. Maybe a torque sensor could be added to the pedal cranks like this:
- Youtube: V3 Power Meter - Introduction to the Build and V3–Power Meter–The Complete How To
- Youtube: https://www.youtube.com/watch?v=ZZnG135o4ZQ and ESPeedo an ESP8266 Bicycle "Power" Sensor