1. Introduction
Today, all human activities are increasingly reliant on three essential aspects: portability, mobility, and accessibility. These elements are direct consequences of technological progress and have led to the miniaturization and enhanced efficiency of electronic devices. One of the most significant advancements in this regard is the development of portable power sources, with rechargeable batteries playing a crucial role [
1]. Among these, lithium-ion (Li-ion) batteries have emerged as the dominant energy storage solution due to their superior energy density compared to older technologies such as nickel-cadmium (Ni-Cd) or nickel-metal hydride (Ni-MH) batteries [
2,
3,
4].
Lithium-ion batteries have not only revolutionized consumer electronics but have also become the preferred choice for electric vehicles (EVs) [
5] due to their high efficiency and long lifespan [
3,
6], as well as their ability to support fast-charging processes that are generally not suitable for lead-acid technologies. With the growing push to reduce environmental pollution, the transition from internal combustion engine (ICE) vehicles to electric alternatives has accelerated [
7]. For example, the European Union plans to ban the sale of new ICE vehicles, including hybrids, by 2035 [
8]. This trend highlights the need for advancements in battery technology, especially in terms of energy density, charging efficiency, and safety. Early EVs initially used lead-acid batteries due to their low cost and availability, while later generations adopted Ni-MH cells before transitioning to lithium-ion technology for improved energy density and lifespan [
7,
8].
Although lead-acid batteries are still used in some regions due to their low cost [
9], lithium-ion technology has become the preferred option in the automotive industry [
10], offering approximately 20% more energy storage capacity, reduced weight, lower maintenance requirements, and an extended lifespan of up to 10 years [
7,
11]. However, several factors influence battery longevity, with temperature being a critical parameter [
12]. During winter, batteries require heating to maintain efficiency, while in summer, cooling mechanisms are necessary to prevent overheating.
Furthermore, charging strategies and fast-charging techniques also play a crucial role in determining the battery’s lifespan, as improper charging methods can accelerate degradation [
13,
14]. Recent studies emphasize the growing interest in fast-charging optimization [
2,
6,
12] and advanced thermal management techniques [
13] aimed at improving battery safety and extending lifespan. While many of these approaches require complex or proprietary platforms, the present work introduces a flexible and accessible system suitable for experimental validation and development.
To optimize the charging process, lithium-ion batteries employ three primary categories of charging strategies, classified based on their underlying mathematical models: model-free, empirical model-based, and electrochemical model-based approaches [
6].
1.1. Model-Free Charging Methods
Lithium-ion batteries employ various charging strategies, with the constant current/constant voltage (CC/CV) method being the most widely adopted due to its simplicity and effectiveness [
6,
14,
15]. More advanced approaches, such as pulse charging and multi-stage methods, have also been proposed to optimize performance and battery lifespan [
13,
16]. A comprehensive discussion of these strategies, including both model-free and model-based techniques, is provided in
Section 3.
1.2. Model-Based Charging Methods
Model-based charging techniques utilize mathematical models of the battery to determine the optimal charging strategy. These models integrate electrical, chemical, and thermal properties to enhance charging efficiency and extend battery life [
13,
17,
18]. Advanced control techniques such as model predictive control [
18], fuzzy logic control [
19], neural networks [
19], sliding mode observers [
20], linear quadratic control [
21], and linearized models [
22] are commonly employed to fine-tune the charging process. These methods enable adaptive charging strategies that account for battery health and environmental conditions, optimizing both efficiency and longevity.
1.3. Electrochemical Model-Based Charging Methods
Electrochemical model-based approaches rely on a deep understanding of the internal chemical processes occurring within lithium-ion cells [
23]. These methods consider battery degradation mechanisms, state of charge (SoC) [
24], and state of health (SoH) [
4,
25] to dynamically adjust charging parameters [
26]. Among the most effective techniques in this category are adaptive multi-stage CC/CV methods, which modify charging currents and voltages based on real-time battery conditions. Furthermore, hybrid approaches that combine electrochemical models with machine learning algorithms have gained attention for their ability to predict battery aging and optimize charging cycles accordingly [
27]. Research efforts continue to explore novel electrochemical-based strategies to further enhance safety, efficiency, and durability. A summarize of the above methods is presented in
Table 1.
Monitoring the state of lithium-ion batteries is of high importance due to their susceptibility to thermal runaway [
28], which can lead to fire hazards or explosions [
29]. Various factors, including state of charge (SoC) and overcharging, can contribute to these risks [
30]. Therefore, real-time battery monitoring systems are essential for ensuring safe and efficient operation [
31]. Several studies have proposed the use of Arduino-based monitoring systems for lithium-ion batteries [
7,
13,
21,
32]. These systems offer significant advantages, including low cost, wide availability, and compatibility with a diverse range of sensors. Arduino platforms provide ample input ports for both analog and digital sensors, allowing for comprehensive battery monitoring. Additionally, output ports can be utilized to implement control strategies that regulate charging and discharging processes, reducing potential safety risks [
33,
34]. A variety of Arduino boards are available, featuring microcontroller clock frequencies ranging from 16 MHz to 480 MHz. These boards can accommodate projects of different scales, from small-scale implementations using Arduino Uno or Nano to more complex systems employing Arduino GIGA. Key battery parameters that can be monitored include maximum and average currents, load and no-load voltages, temperature variations, charge–discharge cycles, and depth-of-discharge (DoD) levels [
9]. Recently, several open-source hardware designs have emerged, particularly those using Arduino platforms for lithium-ion battery charging and real-time monitoring applications [
35,
36]. These approaches offer practical and accessible solutions that complement academic research.
The logical structure of the paper is illustrated in
Figure 1. This paper presents an Arduino-based lithium-ion battery charging system that integrates a CC/CV buck converter, a relay, an LCD screen, and a current sensor. The proposed charging strategy follows a structured approach, incorporating nominal voltage regulation, cut-off detection, topping charge, preconditioning, and CC/CV methodology to ensure efficient and safe charging. The remainder of this paper is structured in a comprehensive manner to ensure a clear understanding of the proposed approach and its implementation.
Section 2 presents a detailed overview of the design and implementation of the Arduino-based charging system. This section describes the hardware components used, their specifications, and the methodology adopted to develop an efficient and safe charging system for lithium-ion batteries.
Special attention is given to the role of each component, including the Arduino Uno board, current sensor, CC/CV buck converter, relay, and LCD screen, highlighting their contributions to the overall performance of the system. Following this,
Section 3 delves into the proposed charging methodology, outlining the fundamental steps involved in the charging process. These steps include determining the cut-off voltage, implementing a topping charge phase, executing a preconditioning step to ensure battery longevity, and utilizing the CC/CV charging method for optimal efficiency. Each of these phases is analyzed in detail, emphasizing their importance in extending battery life and maintaining a stable energy supply.
Next,
Section 4 focuses on the software design, detailing the algorithms and control strategies implemented to regulate the charging process. This section explores the programming logic behind the Arduino-based system, including how data from sensors are processed, the decision-making mechanisms used to adjust charging parameters, and the safeguards incorporated to prevent overcharging or excessive heating. The section also highlights the integration of real-time monitoring techniques and potential improvements to further enhance system efficiency.
In
Section 5, the experimental results are thoroughly examined and discussed. The performance of the proposed system is evaluated through various tests, analyzing charging efficiency, temperature stability, and the impact of different charging techniques on battery health. The discussion provides valuable insights into the advantages and limitations of the proposed approach, comparing it with existing charging methods and identifying key areas where improvements can be made.
Finally,
Section 6 concludes the paper by summarizing the key findings and contributions of this research. It also discusses potential future research directions, including the integration of machine learning algorithms for predictive battery management, improvements in real-time monitoring techniques, and advancements in adaptive charging strategies that could further optimize battery lifespan and efficiency. This section emphasizes the broader implications of the study and its relevance in the context of sustainable energy storage solutions.
This paper proposes a Li-ion battery charging system based on a microcontroller that is capable of implementing and testing various charging algorithms. Unlike conventional charging systems, the proposed solution is flexible, easily modifiable, and suitable for experimental research on different charging strategies. Additionally, the system includes integrated safety measures, ensuring secure operation, and features automatic calibration for precise current measurements. Our study also explores the impact of different charging strategies on battery lifespan, providing an experimental foundation for optimizing Li-ion battery charging.
2. Design and Implementation
The proposed system is designed to be easily adaptable to various charging algorithms. The microcontroller allows software modifications to implement strategies such as adaptive charging, thermal optimized charging, or techniques that help preserve battery lifespan.
This flexibility makes the system suitable not only for commercial applications but also for advanced research on Li-ion battery charging. The schematic block of the proposed charger shown in
Figure 2 has a medium complexity, and it is based on a few components: a microcontroller development board (using an Arduino Atmega 328p microcontroller, Arduino AG, Somerville, MA, USA), an LCD with I2C communication (generic, Shenzhen, China), a 5-amp current sensor based on the ACS712 (Allegro MicroSystems, Manchester, NH, USA) IC, a CC/CV buck converter (generic, Shenzhen, China), and a relay (generic, Shenzhen, China). Arduino was selected for its simplicity, affordability, and broad ecosystem of libraries and development resources. Compared to alternatives like STM32 or Raspberry Pi, it offers a more accessible programming environment and sufficient performance for the control and monitoring requirements of this system.
Figure 3 presents the schematic of the proposed charger, highlighting the main hardware components and their logical connections. This overview helps contextualize the implementation details discussed in the following sections.
2.1. CC/CV Buck Converter
One of the key components of the proposed circuit is the CC/CV buck converter [
37], which regulates both voltage and current supplied to the lithium-ion battery. The selected module is based on the XL4015 step-down switching regulator, a highly efficient DC-DC converter capable of delivering a high power output with minimal losses. The buck converter was chosen for this design due to its efficiency, which exceeds 90%, allowing for effective power management and reduced heat dissipation [
38].
To achieve precise control over the charging process, the module is equipped with two adjustable potentiometers, one dedicated to voltage regulation and the other for current limitation. This allows the system to be configured to a specific set point, such as a 1 A charging current, ensuring that the battery is not subjected to excessive current levels that could accelerate degradation or cause overheating.
Additionally, the XL4015 module supports wide input voltage ranges, typically between 5 V and 32 V, making it adaptable for various power sources. Its integrated thermal shutdown and overcurrent protection enhance safety, ensuring stable operation even in demanding conditions. This versatility makes the converter a good choice for experimental setups, where precise adjustments and reliable operation are critical.
A simple block schematic is presented in
Figure 4 that illustrates voltage and current flow at the input and output terminals, as well as the location and role of the two adjustable potentiometers used for setting charging voltage and current limits.
In
Figure 5, the real image of the board module with all its electronic components is presented.
According to technical specifications and independent evaluations, the XL4015 buck converter can achieve efficiencies of up to 96% under ideal conditions, specifically when the difference between input and output voltage is minimal and the load current is moderate. Power efficiency was evaluated using direct measurements during both the constant current (CC) and constant voltage (CV) phases of charging. In the CC phase, with an input of 9 V at 530 mA and an output of 3.9 V at 600 mA, the system achieved an efficiency of approximately 49.1%. In the CV phase, with an input of 9 V at 510 mA and an output of 4.2 V at 420 mA, the estimated efficiency was 38.3%.
For: Input 9 V and 0.530 mAh -> Pin = 4.77 W
Output 3.9 V and 0.600 A -> P
out = 2.34 W
For: Input 9 V and 0.510 mAh -> Pin = 4.59 W
Output 3.9 V and 0.420 A -> P
out = 1.76 W
These values reflect the typical performance of the XL4015 module without active cooling and under moderate current conditions. While not optimized for energy efficiency, the system’s flexibility and low cost make it suitable for experimental applications, with future improvements expected in thermal management and regulation circuitry. In addition to power conversion efficiency, a rough estimation of coulombic efficiency was performed to assess the energy throughput of the system. For one representative test, with an input energy of approximately 10.8 Wh (9 V @ 0.6 A for 2 h) and an estimated energy stored in the cell of 6.66 Wh (3.7 V × 1.8 Ah), the coulombic efficiency was calculated at around 61.6%. This value reflects not only conversion losses but also internal resistance and thermal effects within the battery. Future tests will include discharge measurements to provide a more complete efficiency profile.
2.2. Current Sensor Module
The current sensor module is used for monitoring the real-time current flow within our circuit. This sensor operates based on the Hall Effect principle, allowing for nonintrusive and accurate current measurements.
Figure 6 presents the real image of the board module.
The module used in this system is the ACS712, a widely adopted current sensor known for its ability to measure both AC and DC currents with high precision.
The ACS712 current sensor provides an analog output proportional to the input current, with a baseline voltage of 2.5 V at zero current. To maintain accuracy over time and account for drift or noise, the software periodically performs a zero-current calibration routine every 30 s. This interval was selected based on empirical testing, balancing measurement stability with processing overhead. The sensor’s sensitivity depends on its version, typically ranging from 66 mV/A to 185 mV/A, ensuring accurate readings across different current levels.
For this particular system, the 5 A version of the ACS712 module was selected, as different variants are available for higher current ranges (like 20 A or 30 A). The calibration process ensures that even small fluctuations in current can be detected and adjusted accordingly.
Below, in
Figure 7, a small block schematic of the sensor module is provided to better illustrate its functionality.
2.3. Display Module
The LCD screen used in this system is a standard 16 × 2 character display, which provides real-time visualization of parameters related to the charging process. The display offers immediate feedback to the user, showing important information, such as charging level, real-time current consumption, and the system’s operating mode, whether in constant current (CC) or constant voltage (CV) mode. By enabling direct monitoring, this display improves usability, allowing the charging status to be quickly assessed without requiring an external interface.
One of the key advantages of this display choice is its simplicity, widespread availability, and low power consumption, making it an ideal solution for embedded systems where efficiency and ease of integration are essential. The display communicates with the microcontroller using the I2C (Inter-Integrated Circuit) protocol, which significantly reduces wiring complexity by requiring only two signal lines: Serial Data Line (SDA) and Serial Clock Line (SCL). These communication channels facilitate synchronized data transfer between the microcontroller and the display module, ensuring that the information is updated in real-time.
In the proposed system, the SDA line is connected to pin A4, while the SCL line is connected to pin A5 of the microcontroller. The SDA pin is responsible for transmitting data from the master device (microcontroller) to the slave device (LCD module), while the SCL pin generates the clock signal, ensuring that data are sent at the correct time. Since I2C supports multiple devices on the same bus, this design allows for the seamless integration of additional components, such as sensors or memory modules, without requiring additional microcontroller pins.
Another significant advantage of this system’s modular design is its scalability. If needed, other display technologies such as OLED panels, TFT touchscreens, or even wireless app-based monitoring solutions can be easily implemented without major hardware modifications. This flexibility ensures that the system can be adapted for various applications beyond battery charging, including power management systems, industrial automation, and IoT battery monitoring. By employing I2C communication, the system minimizes the number of required connections compared to traditional parallel LCD interfaces, thereby reducing circuit complexity and improving reliability. This approach not only makes the wiring cleaner and more efficient but also enhances the system’s adaptability for future upgrades, making it an ideal solution for research, prototyping, and real-world embedded applications. In
Figure 8, the display is presented.
2.4. Relay
A 9 V relay is used to control the connection between the current sensor and the output of the buck converter. It is driven by a low-power NPN transistor (BC548), which is activated by the microcontroller. A flyback diode (1N4007) is placed across the relay coil to suppress voltage spikes and protect sensitive components.
The relay ensures that the current sensor is only connected during active charging, improving measurement accuracy and allowing dynamic control over sensing. This discrete switching mechanism also provides galvanic isolation between control and power circuits, enhancing safety and robustness in experimental setups. The schematic representation is shown in
Figure 9.
2.4.1. Reverse Polarity Protection and Safety Features
To protect the circuit from reverse polarity connections, a fuse and diode (D1) are included. Under normal operation, D1 remains reverse-biased and does not conduct. In the event of incorrect battery polarity, D1 conducts, creating a short circuit that causes the fuse to blow, effectively disconnecting the battery and preventing component damage.
2.4.2. User Interface and Expandability
The designed system also includes two push buttons to enhance user control and configuration. The (MODE) button allows the user to set the battery capacity in increments of 100 mAh, ranging from 1000 to 5000 mAh. Based on the selected capacity, the Arduino calculates the charging parameters automatically. The constant current limit is set to 0.5 C, the peak current threshold to 0.7 C, and the cut-off current to 0.1 C of the chosen capacity. These values are then used by the software to control the charging process and ensure battery safety.
Charging Activation (BEGIN): This second button is used to start the charging process, giving the user full control over when the operation begins.
If required, additional push buttons can be implemented for further functionality, and the software can be modified accordingly to accommodate specific user preferences or application requirements. This flexibility makes the system adaptable for different types of lithium-ion batteries and potential future upgrades.
3. Charging Method
Research in the field of lithium-ion battery charging has established that Li-ion (3.7 V) and Li-polymer cells require a precise and controlled charging procedure to ensure safety and longevity. Unlike other battery chemistries, lithium-ion cells are highly sensitive to overvoltage and excessive charging currents, making it critical to follow strict charging parameters [
39]. Improper handling can lead to permanent cell degradation, reduced lifespan, and, in extreme cases, thermal runaway or explosion [
40].
The key parameters that must be carefully controlled during charging are as follows [
41]:
Cell Voltage—Ensuring that the applied voltage does not exceed safe limits.
Charging Current—Determining the appropriate current based on battery capacity.
Cut-off Current—Identifying when the charging process should be terminated.
3.1. Charging Voltage Considerations
For a standard 3.7 V Li-ion or Li-polymer cell, the nominal charging voltage is 4.20 V with a permissible tolerance of ±50 mV. Taking as an example the widely used 18,650 Li-ion cell, its maximum charging voltage is 4.20 V, with an acceptable range of 4.15 V to 4.25 V. It is critical that the charging voltage never exceeds 4.25 V, as going beyond this threshold can lead to irreversible battery damage, overheating, or safety hazards. As a precautionary measure, an external temperature sensor was used during some experimental sessions to manually monitor the battery temperature. However, this sensor was not integrated into the charging system design, and no thermal data were logged during the tests. In future versions, the inclusion of an internal temperature sensor and automated thermal management routines is planned to improve charging safety and enable dynamic parameter adjustment based on temperature feedback.
To reduce potential risks, the charging system must be designed with precise voltage regulation. In this design, the maximum charging voltage is limited to 4.20 V ± 50 mV, which balances battery safety and performance. Tolerances beyond this range can lead to either overcharging (if too high) or incomplete charging (if too low), both of which impact lifespan and efficiency.
3.2. Charging Current Determination
Because the proposed system allows the user to select a target battery capacity, it is essential to determine appropriate current levels using standard C-rate principles. The following section presents practical examples and context to justify the current settings implemented in the software logic.
Charging current is another key factor that directly affects charging efficiency, battery health, and longevity.
In lithium-ion battery specifications, the charging current is commonly expressed as a multiple of the battery’s C-rate, where C is the battery capacity in Ah.
The charging current is typically chosen within the following range:
where 0.5 C represents a moderate charge rate (enhancing battery lifespan), while 1 C provides a faster charge time but may cause increased stress on the cell.
For practical examples:
If an 18,650 Li-ion cell is used and has a capacity of 2000 mAh, then the cell C rating will be 2, meaning that the cell can be charged at the following:
Also, we can consider the following two examples for a 1000 mAh cell and a 3000 mAh cell:
and
However, it is important to note that not all lithium-ion batteries support a 1 C charging rate. Manufacturers specify different safe charging limits, with some cells supporting a maximum charge rate of 0.7 C, 0.8 C, or 1 C, depending on the materials and manufacturing process used. Higher-quality batteries, often found in premium applications such as electric vehicles or high-performance electronics, can sustain higher charge rates due to optimized internal chemistry and better heat dissipation mechanisms.
3.3. Impact of Charging Current on Battery Longevity
Numerous studies in the literature highlight the impact of charging current on lithium-ion battery lifespan [
42,
43,
44]. Charging at a current higher than the manufacturer’s recommendation leads to accelerated capacity loss, excessive heat generation, and potential safety risks. Charging below the recommended current does not harm the battery and can, in fact, prolong its operational life by reducing stress on the internal chemical components.
These principles are widely applied in the automotive industry, where lithium-ion cells are extensively used in electric vehicle (EV) battery packs. EV manufacturers optimize charging rates to balance fast charging capabilities with long-term battery durability, ensuring that cells degrade at a controlled rate over time.
3.4. Implemented Charging Strategy in the Proposed System
The designed charger is built to support multiple charging rates, allowing users to charge different battery types with varying maximum current ratings. After evaluating various charge rates during testing, the most optimal and safe strategy implemented in this system is 0.5 C, as it provides a balanced approach between charging speed and battery longevity. This decision was based on practical observations that showed stable current regulation, reduced heat buildup, and consistent voltage behavior at this rate. In contrast, higher rates such as 1 C caused a noticeable thermal increase and steeper voltage rise, which may negatively impact long-term battery health. This flexible charging configuration ensures that the system can adapt to different lithium-ion cells, making it suitable for research applications, prototype testing, and general-purpose charging solutions.
3.5. What Is Cut-Off?
The cut-off phase represents the final step of the lithium-ion battery charging process, where the battery is safely disconnected from the charger to prevent overcharging and ensure long-term stability [
45].
A full charge is achieved when the Li-ion cell reaches its maximum charging voltage of 4.20 V and the charging current drops below 0.1C, which represents 10% of the battery’s rated capacity.
To illustrate this principle, consider the following examples: In the first case, a 1000 mAh battery reaches full charge when its voltage stabilizes at 4.20 V, and the charging current decreases to 100 mA (0.1 × 1000 mAh). In the next scenario, a 3000 mAh battery has reached full charge at 4.20 V and a final charging current of 300 mA (0.1 × 3000 mAh).
3.6. The Importance of Current-Based Cut-Off
A common misconception in lithium-ion battery charging is that voltage alone determines the state of charge (SoC). While it is true that a fully charged Li-ion cell has a nominal voltage of 4.20 V, reaching this voltage does not necessarily mean the battery is fully charged. In many cases, a cell can reach 4.20 V while being only around 70% charged.
The true indicator of a full charge is the charging current, which naturally decreases as the battery approaches full capacity. This is why the cut-off condition is determined by both voltage (4.20 V) and the drop in charging current to 0.1 C.
3.7. Post-Charging Voltage Drop—A Normal Behavior
After a lithium-ion battery has been fully charged and removed from the charger, some cells exhibit a natural voltage drop from 4.20 V to around 4.0 V over time. This phenomenon is completely normal and does not indicate self-discharge or capacity loss. Instead, it is a characteristic of the electrochemical reactions inside the cell, where the voltage slightly stabilizes after reaching peak charge.
Different battery manufacturers design their cells with slightly varying chemistries, which can influence how much the voltage drops after a full charge. However, as long as the battery remains within its specified operational voltage range, this behavior does not affect performance and should not be mistaken for a fault.
3.8. Float Charge or Topping Charge
The float charge is a well-known technique commonly used in lead-acid battery charging, where a small current is continuously supplied to compensate for the self-discharge rate, keeping the battery at its maximum voltage level without overcharging. This method is effective for lead-acid batteries, as they can sustain a constant trickle charge without suffering from degradation [
46,
47].
However, lithium-ion batteries do not accept float charging due to their chemical composition and charging characteristics. Unlike lead-acid batteries, Li-ion cells cannot tolerate a continuous charge without experiencing internal stress, overheating, and potential long-term damage. For this reason, once a Li-ion cell reaches its full charge (4.20 V), it must be disconnected from the charger to prevent overcharging.
Instead of applying a float charge, lithium-ion battery management systems can implement a process known as topping charge [
48]. This method involves monitoring the battery voltage after it has been fully charged and resuming the charging process only when the voltage drops below a predefined threshold. This approach ensures that the battery remains fully charged without being subjected to continuous overcharging, thereby maximizing battery lifespan and safety. The topping charge strategy is widely used in commercial lithium-ion battery chargers. Consumer electronics such as smartphones and laptops implement a controlled constant voltage topping phase to complete the charge cycle without overcharging. Even industrial applications, including electric vehicle battery management systems (BMS), utilize topping charge logic as part of their safety and optimization routines.
3.9. Preconditioning Step and CC/CV Method
The preconditioning phase, also known as trickle charging, involves applying a low current (typically 0.1 C or 10% of the battery’s capacity) to the cell until its voltage reaches a safe threshold (above 3 V). Once the battery reaches this level, it can safely transition to the full recommended charging current without the risk of overheating or degradation.
This step is widely implemented in the automotive industry, particularly in high-performance electric vehicles (EVs). In such systems, preconditioning is combined with an active battery cooling system, which ensures that the battery pack remains within an optimal temperature range during fast charging.
In EVs with large battery capacities, the preconditioning current may be set higher than 0.1 C to reduce total charging time while still maintaining safe charging conditions.
After the preconditioning step, the charging process transitions to the CC/CV (constant current/constant voltage) method, which is the standard approach for lithium-ion battery charging. This method consists of two main phases. To further clarify these charging steps, the following graphical representation (
Figure 10) illustrates the preconditioning step, constant current phase, and constant voltage phase, showing how they work together to achieve safe and efficient lithium-ion battery charging.
3.10. CC Method
After connecting a discharged battery cell to the charger, the steps will be as follows:
The cell will draw the maximum current limited by the charger.
During the charging process, the current will remain constant at that level, and the voltage will slowly rise.
This is what is called the CC method or the CC stage.
3.11. CV Method
During the CV stage, the voltage at cell terminals remains constant, and the charging current begins to drop. This process usually starts when the cell reaches ~4.20 V and continues until the Li-ion cell is completely charged. In conclusion, the current (A) can be used to differentiate between the two modes: when the current is at its maximum given by the charger, the CC mode is used, and when the current is less than the maximum given by the charger and continues to drop, then the CV mode is used.
3.12. Battery Chemistry Compatibility
While the proposed charger was tested using standard Li-ion cells (e.g., an 18,650 format with NMC chemistry), future implementations may also support lithium iron phosphate (LiFePO4) batteries, which are increasingly used in energy storage and electric vehicle applications due to their thermal stability and long cycle life.
Key differences include a lower nominal voltage (~3.2 V vs. 3.7 V) and a lower maximum charging voltage (3.6–3.65 V for LiFePO4 compared to 4.2 V for standard Li-ion). These differences require firmware adjustments to charging thresholds and safety routines.
The flexibility of the Arduino-based design makes it feasible to adapt the system for multiple chemistries by modifying the voltage setpoints and monitoring parameters accordingly.
4. Software Design
The software implementation for the Li-ion battery charging system is written in Arduino C++ and is designed to regulate the charging process by continuously monitoring current and voltage levels while ensuring safety through built-in protection mechanisms. The code controls the relay, manages user inputs via push buttons, processes real-time current sensor data, and updates information on the LCD screen. A simplified organogram of the code is presented in
Figure 11.
The more detailed explanation of the charging algorithm is presented below:
When the microcontroller starts, the system:
Initializes the relay, buttons, LCD screen, and current sensor module (ACS712).
Retrieves the battery capacity stored in the EEPROM (if the capacity is below 1000 mAh, it is set to a default value of 1000 mAh).
Displays a user interface that allows the user to set the battery capacity using push buttons.
Calculates charging current limits based on the selected battery capacity:
Peak Current Limit (0.7 C)—used for overcharge protection.
Cut-off Current (0.1 C)—used to determine when the charging process is complete.
- 2.
Current Sensor Calibration
Before starting the charging process, the current sensor is auto-calibrated to ensure accurate measurements. This is completed in the current_calib() function, which follows these steps:
Reads the sensor’s baseline current value.
Performs recalibration if the detected offset is greater than 0.02 A, ensuring precise readings.
Begin Sensor Calibration
Display “Calibrating Current Sensor” on the LCD
Call sensor.calibrate()
Read currentReading
If (currentReading) > 0.02 A:
Repeat calibration after a delay
If still > 0.02 A:
Retry calibration recursively
End Calibration
- 3.
Charging Process Execution (CC/CV Method)
Once initialized, the system enters the charging phase, applying the CC/CV (constant current/constant voltage) charging method. This is managed in the CC/CV (function), which follows these steps:
Activates the relay to start charging.
Analyzes the initial current readings to detect potential errors.
Checks for reverse current (if detected, charging is halted to prevent damage).
Determines the transition point from CC to CV mode, setting a reference value (CV current = 0.8 ∗ Initial Current).
During charging, the microcontroller continuously:
Reads current sensor data every 100 ms.
Determines whether the charger is operating in CC (high current) or CV (low current) mode.
Displays real-time charging data on the LCD screen.
Begin Charging Process
If battery voltage < 3.0 V:
Enter preconditioning (low current)
Else:
Activate relay (charging ON)
Measure current
If current < CV_threshold:
Mode = CV (Constant Voltage)
Else:
Mode = CC (Constant Current)
Display mode and current on LCD
If current < cut_off for two consecutive checks:
Stop charging
Display "Battery Fully Charged"
If current > max_threshold:
Calibrate sensor again
Retry charging
If current is still too high:
Stop charging permanently
Display overcurrent warning
- 4.
Cut-Off and Full Charge Detection
To ensure the safe termination of the charging process:
The system monitors the charging current. If the current falls below the cut-off threshold (0.1 C) for 10 consecutive readings, charging is automatically stopped, and a “Battery Fully Charged” message is displayed.
If the current exceeds the peak threshold (0.7 C), the relay is turned off immediately, and an “Overcharging Detected” warning is shown, prompting the user to manually reset the system.
- 5.
Time-Based Safety Cut-Off
To prevent overcharging in case of sensor failure or incorrect readings, the software implements a charging timeout mechanism (timer() function), which follows these steps:
Tracks elapsed time using hours, minutes, and seconds counters.
If the charging process exceeds the predefined timeout period (default: 4 h, 20 min), charging is stopped, and a timeout warning is displayed on the LCD.
- 6.
Periodic Recalibration and Sensor Stability
To maintain sensor accuracy, the re_calib() function:
Recalibrates the current sensor every 10 min during charging.
Temporarily disables charging, performs a recalibration cycle, and resumes operation.
- 7.
User Interface and LCD Screen Updates
Throughout the charging process, the LCD screen continuously updates the user with the following:
Charging Mode: Displays “MODE: CC” or “MODE: CV” depending on the current state.
Real-Time Current Readings: Shows current consumption in amperes (A).
Warnings and Status Messages: Alerts the user in case of overcurrent, reverse polarity, or timeout errors.
- 8.
Safety Mechanisms and Error Handling
The code includes multiple layers of protection mechanisms, such as the following:
Relay-based disconnection if unsafe current levels are detected.
Automatic shutdown on overcurrent (>0.7 C), reverse current detection, or timeout.
Recalibration routines to ensure stable current readings.
The software follows a structured loop execution, ensuring continuous monitoring, adaptive charging regulation, and built-in safety features. The combination of CC/CV control, user input handling, sensor calibration, and protection mechanisms makes this charging system a robust, adaptable, and reliable solution for lithium-ion battery management.
5. Results and Discussion
Several experimental tests were conducted to evaluate the charging performance of the proposed circuit and to identify potential limitations or areas for improvement. The collected data were carefully analyzed and visualized through the following charts, which illustrate the system’s behavior under different charging conditions. To ensure a comprehensive evaluation, various Li-ion cells with different capacities and from different manufacturers were tested.
A comparative chart showing the charging time for new, aged, and degraded cells is presented in
Figure 12. As expected, the degraded cell required significantly less time to charge, which correlates with its lower effective capacity due to aging and increased internal resistance.
Among the multiple experiments performed, we selected the most representative results, shown in
Table 2, which provide valuable insights into the efficiency and stability of the charging process. To validate the results, each experiment was repeated three times under the same experimental conditions. Differences between measurements were analyzed to assess the consistency of the results.
5.1. Case1: Charging an Aged 18,650 Li-Ion Cell
One of the test scenarios involved charging an older 18,650 Li-ion cell with an estimated capacity of 1000 mAh. Based on the standard 0.5 C charging rate, the expected maximum charging current was the following:
At the beginning of the experiment, the cell’s initial voltage was measured at 3.53 V, which was considered near depletion, as the previous electronic device using the battery had already indicated a low charge level. Once charging was initiated, the system correctly applied the constant current (CC) mode, supplying a steady current of 500 mA until the battery voltage approached 4.15 V. At this point, the charger automatically transitioned into the constant voltage (CV) mode, where the current gradually decreased as the battery approached full charge.
Due to the age and degradation of the cell, the voltage profile exhibited minor fluctuations during the CV phase, with a gradual and slower rise towards 4.20 V. This behavior is expected in older batteries, where internal resistance and chemical wear impact the charging efficiency and voltage stability. The following
Figure 13,
Figure 14 and
Figure 15 illustrate the charging profile of the tested 18,650 cell, showing the transition between CC and CV phases and the corresponding variations in voltage and current throughout the process.
5.2. Case2: Charging a 2000 mAh Li-Ion Cell
For this charging experiment, a 2000 mAh Li-ion cell was selected, with the corresponding 0.5C charging rate set to the following:
Unlike the previous test, this cell was discharged to a critically low level of 2.5 V, which is below the typical cut-off threshold of 3 V for most consumer electronics. At this deep discharge state, many devices would consider the battery completely depleted and unusable.
5.2.1. Preconditioning Step for Deeply Discharged Cells
Since charging a Li-ion cell below 3 V with a high current can cause thermal stress and potential damage, the preconditioning step was automatically applied by the charger. This phase involved supplying a low current (typically 0.1 C) until the cell voltage gradually increased above 3 V, ensuring a safe transition to standard charging. The effectiveness of this step is illustrated in the next few charts, showing the slow recovery phase before full charging commenced.
5.2.2. Constant Current and Constant Voltage Phases
Once the battery voltage exceeded 3 V, the charger switched to CC mode, applying the calculated maximum charge current of 1000 mA. During this phase, the voltage increased steadily as the battery stored energy.
After approximately 140 min, the voltage reached ~4.15 V, signaling the transition to the constant voltage (CV) phase. At this stage, the current gradually decreased as the battery approached full charge. This phase continued until the charging current dropped below 10% of the battery’s rated capacity (0.1 C), at which point the charger disconnected the battery, marking the end of the charging cycle.
Figure 16,
Figure 17 and
Figure 18 illustrate the charging profile of the 2000 mAh cell, highlighting the preconditioning step, CC phase, and CV phase, as well as the charging time progression.
5.3. Case3: Charging a 2400 mAh Degraded Li-Ion Cell
For this experiment, a 2400 mAh Li-ion cell was selected, with its nominal 0.5 C charging current calculated as follows:
However, this particular cell was highly degraded, allowing for a comparative analysis between newer, well-maintained batteries and an aged, deteriorated one.
5.3.1. Unexpected Behavior in Constant Current (CC) Mode
During the initial charging attempt, the battery began to overheat, which posed a potential safety risk. To prevent thermal runaway and further degradation, the charging current was limited to a maximum of 1000 mA, reducing stress on the aged cell. As shown in the charging graphs, the first 20 min of charging exhibited unusual behavior. The charging current did not immediately reach the expected value set by the charger. Instead, the current gradually increased before stabilizing at the 1000 mA limit. This irregularity suggests that the internal resistance of the degraded cell was significantly higher, likely due to the following reasons:
Electrochemical wear and reduced conductivity;
Lithium plating or separator degradation, impacting charge acceptance;
Increased impedance, causing inconsistent current flow.
Despite these initial irregularities, once the current stabilized, the charging process proceeded normally, transitioning smoothly into constant voltage (CV) mode as the battery approached full charge.
5.3.2. Impact of Battery Degradation on Charging Performance
One significant observation from this experiment was that the charging duration was notably shorter compared to healthier cells of similar capacity. This suggests that the actual usable capacity of the aged battery was far lower than the 2400 mAh rating indicated on its label. As lithium-ion cells degrade over time, their ability to store and retain charge diminishes, reducing their effective capacity and increasing charge resistance.
Additionally, the preconditioning stage was not required for this cell, as its initial voltage was above 3 V, meeting the basic condition to begin direct CC charging. However, the higher heat generation and irregular current behavior highlight the challenges associated with charging aged lithium-ion cells, reinforcing the importance of battery health monitoring and proper charge management.
Figure 19,
Figure 20 and
Figure 21 provide a detailed charging profile of the degraded 2400 mAh cell, showing the delayed CC phase stabilization, increased internal resistance effects, and overall charge time reduction compared to healthier batteries. The degraded cell, originally rated at 2400 mAh, was charged from 3.6 V over a 120-min period. During the first 50 min, the charging current reached up to 1000 mA in the constant current phase, followed by a constant voltage phase with an average current of approximately 300 mA. Based on these values, the estimated effective capacity recovered was approximately 1180 mAh, corresponding to a 50.8% loss relative to the nominal specification.
50 min of charging CC with a current of ~1000 mAh
70 min (until 120 total) of charging CV with a current ~300 mAh
Total capacity estimation:
A summary of the charging parameters and observations for 10 Li-ion battery tests is provided in
Table 3. These test cases illustrate the charger’s ability to adapt to different battery capacities and states, confirming its flexibility and robustness across a wide range of real-world conditions.
The tests presented in this study reflect representative charging behavior for new, aged, and degraded cells. Due to time and equipment constraints, each condition was tested with a single trial, and statistical error bars were not included. However, the system demonstrated consistent behavior during repeated informal tests, and future work will include extended test campaigns to provide repeatability metrics and statistical analysis.
The proposed Li-ion battery charger integrates several essential safety and automation features, ensuring a reliable and efficient charging process. The system incorporates battery detection and automatic cut-off, which prevents overcharging, as well as a time-based charging termination mechanism that ensures protection against prolonged charging cycles. Additionally, the system includes overcharging protection, which disables charging if unsafe current levels are detected, and an automatic current sensor calibration function that improves measurement accuracy over time. Real-time current consumption is displayed on the LCD screen, allowing users to monitor the charging process, while clear CC/CV mode indicators provide further insight into the charging stages. The system also features reverse polarity detection for the current sensor, ensuring correct readings, and reverse polarity protection for the battery, preventing damage in case of incorrect connections. Through these features, the charger successfully supports batteries ranging from 1 Ah to 5 Ah. However, the circuit can be further optimized to accommodate both lower- and higher-capacity batteries, making it more versatile for a wider range of applications.
5.4. Future Research Directions
This project lays the groundwork for a safe, modular, and transparent lithium-ion battery charging platform. One of its key strengths is that it is built entirely on an open-source Arduino microcontroller, using widely available components and a customizable software framework. This makes the system highly adaptable for a wide range of research directions related to charging strategies, battery monitoring, and energy optimization.
Because it is not a fixed-function commercial device, the platform can easily be modified to implement and test different control algorithms, charging profiles, and sensing techniques. This flexibility is especially valuable for academic, industry, or experimental environments where custom setups are often needed.
Future work could focus on optimizing the charging process based on real-time measurements of internal battery resistance. By studying how resistance varies across battery age and condition, adaptive charging algorithms could be developed to dynamically adjust current and voltage for better efficiency and safety.
Another promising direction involves integrating a temperature sensor directly near the battery. This would allow the system to monitor heat generation during charging and adjust charging parameters accordingly to avoid overheating. This type of thermal feedback would be particularly useful when exploring faster or higher-current charging scenarios. More advanced versions could also include active cooling elements for thermal regulation. The platform also provides a foundation for implementing battery state of health (SoH) estimation features. Internal resistance measurements, combined with voltage and current trends, could be used to predict battery aging in real time. Machine learning methods trained with these variables could enhance the system’s intelligence, making it capable of condition-based control and longer-term diagnostics.
Additionally, the charger can be adapted to work with other lithium-based chemistries, such as LiFePO4, and different cell formats, like pouch cells. This would expand its applicability and allow researchers to assess the performance of various battery types under controlled, customizable conditions.
In summary, the system’s openness, modular design, and low-cost hardware make it a solid candidate for further research in smart charging, battery health monitoring, and experimental energy management.
The current version of the system was assembled on a breadboard and housed in a protective enclosure to ensure safe operation and facilitate rapid testing. Future iterations will migrate to a modular printed circuit board (PCB) design to enhance electrical reliability, minimize signal interference, and improve mechanical stability, making the system more suitable for long-term testing and deployment.
While this platform is currently designed for conventional lithium-based chemistries, its modular and open-source nature could support future adaptations for unconventional energy storage systems, including batteries with active media or electromagnetic interaction mechanisms [
49,
50]. Although these systems may have specialized requirements, the hardware and firmware can be modified to explore such advanced technologies in research settings.
Beyond its technical flexibility, the platform’s open-source architecture allows researchers to explore unconventional charging strategies that may be difficult to implement on commercial devices. Its transparency and modularity make it ideal for iterative testing, algorithm prototyping, and experimental analysis in academic settings. While cost and accessibility are addressed in the conclusions, it is important to emphasize that the system bridges the gap between rigid commercial chargers and custom research tools, enabling the development of innovative energy management techniques.
5.5. Failure Case Handling
The system includes several basic safety mechanisms to handle failure scenarios. When a battery with extremely low voltage is connected (e.g., below 3.0 V), the charger enters a preconditioning mode with a reduced current. If the voltage is below a critical threshold (e.g., 2.0 V), charging is disabled to avoid stressing a potentially damaged cell. The charger also monitors current consumption via the ACS712 sensor. If a shorted or highly resistive cell is connected, the system detects abnormal current behavior and stops the charging cycle after a defined timeout. Reverse polarity protection is implemented both at the battery connection and the current sensor, preventing incorrect readings and physical damage. These safety features contribute to protecting the system against typical user errors or battery faults while remaining suitable for further experimental development.
5.6. Scalability
While the current version of the charging system is designed for single-cell operation, the underlying architecture is flexible and can be extended to support multiple cells in parallel. For multi-cell series packs (e.g., 2S–4S), additional circuitry and per-cell voltage monitoring would be required to ensure balanced and safe charging. The open-source, modular nature of the system allows for such future expansions, potentially including integration with external BMS modules and switching logic to handle sequential cell control. These enhancements would enable safe and scalable charging of small to medium battery packs.
6. Conclusions
This study presents the design and implementation of a flexible, microcontroller-based Li-ion battery charging system that incorporates real-time monitoring, adaptive charging strategies, and multiple safety mechanisms. The system successfully regulates the charging process using the CC/CV method while also integrating features such as automatic current sensor calibration, overcharging protection, and reverse polarity detection. Unlike traditional fixed charging circuits, the proposed system offers modularity and adaptability, allowing for different battery capacities and charging profiles to be implemented with minimal hardware modifications. Various charging conditions were handled effectively, and specific behaviors are discussed in detail in the experimental section. The integration of an LCD screen and user interface further enhances usability by providing real-time feedback on current, voltage, and charging modes.
Beyond its practical applications, the system offers a research-oriented platform for testing and optimizing battery charging techniques. Future work will focus on integrating advanced algorithms to improve charge regulation, including adaptive current control based on internal resistance and thermal feedback mechanisms. Additionally, the use of machine learning for predictive battery health analysis could provide new insights into optimizing battery lifespan and efficiency. By offering a cost-effective, scalable, and customizable charging solution, this research contributes to the broader field of energy storage management and can be further developed for applications in electric vehicles, renewable energy storage, and portable electronics. The adaptability of the system makes it a valuable tool for both experimental studies and real-world implementations, supporting the ongoing development of safer and more efficient battery technologies. Compared to standard commercial chargers, which typically operate using fixed firmware and lack visibility into the charging process, the proposed system provides full transparency and control. It allows researchers to modify charging parameters, test new algorithms, and integrate safety features at both software and hardware levels. Moreover, its low cost and ease of implementation on widely available platforms like Arduino make it a highly accessible alternative for academic and experimental use.