One thing that eBikes really lack is the ability to act as connected devices (IoT) and a decent battery management system (BMS). I mean, we have seen hundreds of projects attempting to solve the first part (temperature and environment sensing), and this project does not miss that point. The second challenge is to have a bike that really takes care of the battery.
LiIon batteries have a relatively short lifespan, which in most cases is further shortened by incorrect use. Long disposal times affect lifespan total capacity depending on temperature and charge level. Considering the actual cost of a new battery pack, a better optimization may be worth.
Following the recommendations of these tables, the cells should be kept at a voltage greater than 4.15V only for a very limited amount of time.
When not using a battery for long periods of time (winter) it is important that it is kept at half charge and at low temperatures.
My battery management system is based on the new BLE board produced by ON-Semiconductors, the RSL1-SENSE-GEVK. It allows to create a good monitoring system at low cost and low energy consumption, integrating some useful sensors, LEDs, push-buttns and some interface pins. The measurement of battery voltage is done by an ADS1115 chip, mounted on a custom PCB that integrates also voltage regulation, a voltage divider and battery discharge circuit. The last is composed of a transistor controlling two (or one) resistors that gradually discharge the battery.
- RSL10-SENSE-GEVK-DB kit;
- ADS1115 module;
- voltage regulator with input voltage >=42V;
- diode (generic);
- NPN transistor (generic);
- 2x 10uF capacitors (or similar);
- 330Ohm resistor;
- 1MOhm resistor;
- 2x 100kOhm resistors;
- 2x 5W 22Ohm resistors (or similar);
- 8-pin DIP socket;
- 2.54mm strip pin (male and female);
- PCB base;
- PCB connector;
- Android/IOS Smartphone.
- Atmosphere IoT account;
HARDWARE SETUP AND SCHEMATICS:
Wire up everything as shown below. You can use a perfboard or a etched/milled PCB. I had troubles with my CNC3018 so I had to do a dirty perfboard.
Notes: I am using a PCB connector with screws, it is possible to use any type of connector. I also preferred to connect ADS1115 and RSL10 with strip pins and socket, because it is easier to disconnect them and use both in other projects. R5 and R6 are >1W and require more space. Please don't act like me and place a 16V capacitor on battery side!
I have prepared a 3D-printable box in order to house the project. Put everything in the box and place a small switch on the side. I had no black filament so I have covered everything with black tape to match the bike colour.
Software was developed using Atmosphere IoT, which is a fast and easy way to create proof of concepts or even commercial solutions. I made a driver for ADS115, available in my blog. The embedded components of the project (the firmware of RSL10) captures environmental parameters (temperature, air quality), communicates with ADS1115 and manages the onboard LEDs. This data is then sent to the mobile app and displayed in a user-friendly manner.
1) Download and install J-LINK software and documentation pack from SEGGER website;
2) Download and install Atmosphere IoT Agent on the same computer, then add to environment PATH the JLink directory. Follow the tutorial available at the download page of Atmosphere;
3) Connect the J-LINK Lite debugger/programmer to the programming connector of RSL10-SENSE-GEVK and plug the USB connector to the PC. Don't forget that RSL10 need to be externally powered! (battery/power supply);
4) Open Atmosphere IoT Platform from any web browser. Login or register, then click over "Import Project" and select the code available below. Project should be already compiled, anyway press "Compile" button at the top of the page and wait about thirty seconds. When compilation finishes navigate to embedded project view and click the programming icon. Once process has finished, unplug USB and programming cables.
5) Take an Android/IOS smartphone and install Atmosphere IoT App. Login with the same account used for the platform. Launch the app just installed and navigate to "Devices". Click over "Add device" and select your RSL10. The app should now connect and start to display data. If not, reset button is your friend.