Bafang is a big (chinese) manufacturer for mid-drive ebike motors. One downside is: they do not care if their product comply with local laws of the countries their customers are based in.
This box is a little circuit, that sits in between controller and display. It forwards each message, between controller and display, but is capable of reacting to specific events. The box has a small hall sensor+magnet, which reprograms the controller in case you remove the magnet on the outside. If you're getting pulled over, you can seamlessly remove the magnet and thumb throttle will be disabled and also the maximum speed will be limited to 25km/h.
At first I tried to adapt the display, but since it is waterproof and not too many developers work on it, I rather looked for other solutions. During my research I came across this thread (viewtopic.php?t=94850). MCC did a great job and my code is completely based on his findings. All credits to him! What I additionally did was to design a waterproof 3D-printed housing and connect brake-light, front-light, turn-lights, handlebar switches.
I extended the code of MCC, to fit my needs and was able to read light- and brake-states, through the corresponding HEX-values. Light control is now event-based (button, state-change). It took me quite a while, to figure out how to place the components, cables and which parts to use, to make it waterproof. I've pretty advanced Fusion 360 skills, which speeded up, the designing-progress, but still took me a few iterations (prototype images) to make it perfectly fit onto my ebike frame. (I'm also working on a HEVO)
To me the schematics MCC made were quite confusing and I redesigned it using Fritzing. This version shouldn't have any flaws, since I used it to build my own version.
Schematics for ExtensionBox (without lightsystem):
Schematics for ExtensionBox:
For a clean wiring setup, I used a dupont connector + pin-header system. Cable ties are used to mount it to the frame.
To cleanly distribute the power, I made a small power strip:
I replaced the surface mounted Micro-USB with an flexible female Micro-USB cable. I applied hot-glue to the surface of the curved piece, to prevent it from sliding down the frame: