Most chargers used for eBikes, eScooters, mobile phones, etc., charge battery cells to 4.2V to maximize capacity. However, this is not optimal for battery longevity.
By charging them only to 4.1V per cell, you can prolong the battery's lifetime by up to 100%.
In numerical terms: a lithium-ion cell charged to 4.20V/cell typically delivers 300–500 cycles. If charged to only 4.10V/cell, the life can be prolonged to 600–1,000 cycles.
You might ask why manufacturers opt for a higher voltage. The answer is simple: consumers demand optimal range and runtime, and a shorter battery lifespan encourages more frequent purchases. For instance, a replacement battery for the Cowboy 4 eBike costs around 500 USD.
This open-source solution enables charging your battery to 4.10V, striking a balance between longevity and range/runtime.
- A Shelly Plus PlugS
- 5 minutes for setup
The setup guide is provided at the end of this document.
Note: Ensure you have a Shelly Plus PlugS model, not the previous model.
A set-and-forget solution. Simply plug in the Shelly and the charger, and you're done. Use it to charge while you're on the go, in the office, or at home. No additional hardware or network is needed.
This idea was conceived in a large international eScooter forum for enthusiasts. Special shoutouts to Pedalheld56, ScooterFreak, FrankA, and Dennis who conducted endless tests with different battery models. Ultimately, thousands of measurements were analyzed, leading to a relatively simple algorithm that supports nearly every type of battery.
To help more individuals contribute to the planet and save on expenses, this open-source project has found a new home here on GitHub.
Before running this script, make sure you have the following:
- A Shelly Plus Plug S device
- The Shelly Plus Plug S API documentation: Shelly Plus Plug S API
You can purchase the Shelly Plus Plug S device from the official Shelly store or other authorized retailers:
- Official Shelly Store: Shelly Plus Plug S
To install and run the script, follow these steps:
- Download the script file from the repository.
- Ensure you have the necessary dependencies installed, including the Shelly Plus Plug S API library.
- Configure the constants in the script according to your requirements:
timer_resolution
: Set the interval (in milliseconds) for calling the state machine.stop_charge_percentage
: Set the battery charge percentage at which the charging process should stop.
- Save the changes to the script file.
To use the script, follow these instructions:
- Connect your Shelly Plus Plug S device to your power source and battery.
- Ensure your device is connected to the network and accessible.
- Run the script on a device with the necessary dependencies installed.
- The script will execute the charging process automatically, monitoring the power consumption of the plug and adjusting the charging state accordingly.
- The LED color on the Shelly Plus Plug S device will indicate the current state of the state machine:
- Blue: Setup state
- Yellow: Learning state
- Green: Charging state
- Red: Shutdown state
- 2023-05-18: Improved the learning of the power consumption of the plug.
- 2023-05-14: Added LED color to indicate the state of the state machine.
- 2023-05-13: Initial release.
- Irmo Ebel
- Date: 2023-05-13
// Your setup guide goes here
* Based on information from Battery University.