Automatic switch anti-spark for JBD BMS -- very cheap, DIY, OpenSource

casainho

10 GW
Joined
Feb 14, 2011
Messages
6,045
What: a small DIY board that automatically switches ON the popular JBD BMS, effectively switching ON the EBike/EScooter, when there is motion / vibration. Automatically switches OFF the BMS after a timeout without motion, like 20 minutes (configured).

Avoids the need to install a mechanical switch and also adds the safe timeout that automatically switchs OFF the EBike/EScooter.

Project page repository with all information: GitHub - OpenSourceEBike/Automatic_Switch_Anti_spark_JBD_BMS: A modular DIY automatic switch anti-spark using JBD BMS

Features​

  • Switch ON the EBike/EScooter by shaking: JBD BMS switchs ON when there is motion of the EBike/EScooter.
  • Automatic switch OFF the EBike/EScooter: JBD BMS switchs OFF after a custom timeout like 30 minutes, when there is no more motion.
  • Ultra low power: espected to use only 0.007 watts when JBD BMS is switched OFF (will take 8 years to discharge a 500Wh battery).
  • Cheap and easy to DIY: costs 5€ in materials and needs only soldering 8 wires.
  • Wireless communication with other boards (planned, optional): an EBike/EScooter main board can communicate by wireless and switch OFF immediatly the JBD BMS.

1682030034478.jpeg

1682030070725.png

1682030003919.png
 

Attachments

  • 1681902643962.png
    1681902643962.png
    303.2 KB · Views: 15
  • 1682030032308.png
    1682030032308.png
    9.1 MB · Views: 1
  • 1682030030053.png
    1682030030053.png
    9.1 MB · Views: 2
Last edited:
I updated the Automatic switch anti-spark for JBD BMS board (OpenSource, download for free), on my Fiido Q1S.
I had to improve the firmware, mainly to add the option to turn off the BMS by sending a command by wireless from the display. This is how it works:

What: a small DIY board that automatically switches on the popular JBD BMS, effectively switching on the EBike/EScooter, when there is motion / vibration.
A timeout of 2 minutes, if no motion is detected, will automatically switch off. Also, a wireless communication accepts a command (for instance, sent from a display) to switch off.

Avoids the need to install a mechanical switch and also adds the safe timeout that automatically switches off the EBike/EScooter.


I also decided to improve the DIY board. As I received the relay with a 3.3V coil, so no need for an extra mosfet nor a extra DC-DC, as I had before. I also removed the buzzer, as after putting the battery protected with tape and inside a box, the buzzer is not audible - maybe I will add the buzzer instead to the display, ro simple not use it at all.

This is the very simple schematic:
1688392775709.png

This is the final DIY board:
1688392800255.jpeg


Understand the firmware​


The main firmware:

  • Starts by turn the relay switch pins to high state / 3.3 volts, as needed to switch on the relay, that in turn will switch the BMS.
  • Initialize the ADXL345 and enable the motion detection. The ADXL345 will change the INT1 pin when it detects motion.
  • A PinAlarm is created, this will wakeup the ESP32-S2 everytime the ADXL345 INT1 pin changes.
  • The code inside the while True will run continuously until the timeout happens (no motion detected during timeout_minutes_to_disable_relay minutes - 2 minutes) or the wireless command to switch off the relay is received.
  • Next code switches off the BMS by turning the relay switch pins to logic 0 / 0 volts.
  • Finally, ESP32-S2 enters in deep sleep mode (ultra low power), keeping the relay switch pins in the state to keep the BMS switched off. The motion alarm will be active meaning the ESP32-S2 will then wake up when detection motion, and the firmware will run again starting from the begin.
 

Attachments

  • 1688392798618.png
    1688392798618.png
    6.7 MB · Views: 2
  • 1688392793271.png
    1688392793271.png
    6.7 MB · Views: 1
This switch is working perfectly as expected, on my micro EScooter Fiido Q1S:

Here is a video of me showing the system turning on/off:

 
Back
Top