1. Introduction
At present, lead-acid batteries have become a widely used rechargeable battery technology in the world because of their good safety, low cost, and excellent recyclability [
1]. The electrolyte liquid level of the lead-acid battery is a critical state parameter of the lead-acid battery. During the long-term storage of lead-acid batteries, the batteries may fail due to reasons such as electrolyte leakage. If the liquid level of the battery electrolyte is too low, it will cause faults and even irreversible damage [
2]. In industrial applications, large groups of lead-acid batteries are commonly used. A failure in one cell of a battery group, caused by electrolyte leakage, can directly affect the charging current of other batteries in series within the same group, thereby accelerating the failure of the entire battery set. Currently, nuclear power plants and data centers mainly rely on regular inspections by staff to visually check whether the liquid levels are within the acceptable range. This method is highly inefficient. Therefore, online real-time monitoring of the electrolyte level in each individual lead-acid battery can effectively enhance the reliability of backup power systems in industrial scenarios, which is crucial for failure prevention in safety-critical applications. Current liquid level monitoring methods are mainly divided into contact type and non-contact type [
3]. For contact methods, common techniques include float level gauges [
4], conductive level sensors [
5], and pressure sensors [
6]. For non-contact methods, the main technologies include ultrasonic level sensors [
7], laser level sensors [
8], fiber optic sensors [
9], capacitive level sensors [
10], and frequency-modulated millimeter wave sensors [
11]. In industrial settings such as nuclear power plants and large data centers, contact measurement of lead-acid battery electrolyte is not permitted; online inspection systems must be capable of non-contact measurement. Among various non-contact measurement methods, ultrasonic level sensors and laser level sensors are typically installed inside the lead-acid battery container, which is destructive to battery manufacturers who usually refuse to install them. Therefore, currently only capacitive level sensors and frequency-modulated millimeter wave sensors can be retrofitted to modify existing battery pack detection systems. However, in industrial applications, lead-acid batteries are typically arranged in close proximity, with only a few millimeters of gap between individual cells. As a result, frequency-modulated millimeter wave sensors, due to their large size, cannot be effectively installed in practical application scenarios. In contrast, capacitive level sensors, with electrode thicknesses as thin as 0.1 mm, can effectively avoid the aforementioned installation issues and hold promising prospects for practical applications.
Capacitive liquid level measurement is a mature and widely used technology. Jayalaxmi and Santhosh [
12] proposed and implemented a new type of helical electrode capacitive liquid level sensor. The results showed that the helical electrode had improvements in indicators such as sensitivity and full-scale response time. Bera et al. [
13] addressed the nonlinearity and temperature dependency issues inherent in capacitance-type level sensors, especially when measuring liquids with low dielectric constants.
However, the above-mentioned capacitive liquid level measurement method usually has a large measurement error in the dynamic measurement of the liquid level of lead-acid battery electrolyte. This is mainly because the sulfuric acid electrolyte in lead-acid batteries has a high viscosity, and as the electrolyte descends, it forms a liquid film on the container wall due to adhesion. These liquid films have a higher capacitance value compared to pure air, which leads to the measured capacitance value being larger than the true value, thus affecting the accuracy of traditional capacitance-level linear models. If this situation occurs in high-safety-requirement environments such as nuclear power plants, false level alarms could trigger unnecessary safety actions, causing interruptions to industrial production processes.
In response to the above problems, some researchers have indeed noticed the phenomenon of residual liquid film adhesion layer effect in dynamic liquid level measurement and have carried out research on it. Jayalaxmi and Santhosh [
14] analyzed and compared the dynamic response characteristics and steady-state response characteristics of planar, helical, and cylindrical capacitive sensors when the liquid flowed in and out at three different rates. They found that the helical type had the fastest response time. They also found that the response times of each structure under the three different outflow rates were not the same, which was caused by the hysteresis effect resulting from the residual liquid film adhesion. But they did not analyze the reasons for the differences in response conditions among various structures under different inflow and outflow rates. Nisio [
15] designed three capacitive sensor plates with different structures and used delay times of 0 s, 5 s, and 10 s, respectively, after the liquid level stabilized to deal with the residual liquid film adhesion layer effect. But using the delay waiting method to deal with the residual liquid film adhesion layer effect not only affects the real-time performance of online measurement, but also affects the accuracy of measurement results due to the uneven migration of the liquid film.
To address this issue, this study establishes a hybrid machine learning model to resolve the dynamic measurement error caused by the residual liquid film adhesion layer effect. Experiments show that the interference of the residual liquid film on the measurement is affected by the liquid level drop rate. The liquid level drop rate is related to the capacitance change within each sampling interval. Therefore, the problem can be transformed into establishing a model with multidimensional features as input and liquid level prediction as output.
In recent years, with the rapid development of machine learning and deep learning, machine learning models such as recurrent neural networks (RNN) and long short-term memory networks (LSTM) have been widely used in data modeling and fault detection. However, in practical applications, neural networks such as RNN and LSTM usually require a large amount of training data to fully learn effective patterns. When the amount of data is small or the features are insufficient, the neural network is prone to overfitting, resulting in poor model generalization ability [
16]. Therefore, in complex nonlinear coupling scenarios, it is usually difficult to capture some implicit nonlinear relationships between complex coupling features by using only a single neural network model [
17].
To address these issues, this study builds the Poly-LSTM model which combines LSTM (long short-term memory) with Poly (polynomial feature generation) to compensate for the deficiencies of a single neural network. Polynomial feature generation is a powerful feature engineering technique, and its core advantage lies in its ability to explicitly capture and model the hidden nonlinear relationships within the data as well as the interaction effects among different features [
18]. By using polynomial feature generation, these high-order terms and interaction terms can be automatically created, transforming these complex nonlinear patterns from an imperceptible implicit state to a clear explicit state. This enables LSTM to directly receive these pre-computed nonlinear features with greater information content, thereby significantly reducing its learning burden and allowing it to focus more efficiently on capturing the dynamic patterns of these nonlinear features over time. Ultimately, this combination not only significantly improves the model’s prediction accuracy but also provides stronger transparency and physical interpretability for the model’s decisions.
The remainder of this paper is organized as follows.
Section 2 describes the experimental setup and analyzes the effect of the residual liquid film on dynamic measurements, which demonstrates the limitations of the traditional static linear model.
Section 3 presents the proposed Poly-LSTM methodology in detail, including the multidimensional feature extraction and the architecture of the integrated learning model.
Section 4 presents the experimental results, providing a comparative analysis of the proposed model against baseline models under various and variable liquid level descent rates. Finally,
Section 5 concludes the paper and discusses future work.
2. System Design and Characterization of the Residual Film Effect
The electrolyte level of a lead-acid battery has upper and lower limits. The upper and lower limits of the liquid level are marked on the shell of the lead-acid battery, as shown in
Figure 1.
In order to achieve high-precision capture and stable measurement of minute capacitance changes, this research has designed a hardware system that integrates a microcontroller, a dedicated capacitance detection chip, and a data communication module. The aim is to provide reliable capacitance measurement data for subsequent dynamic liquid level monitoring and the verification of intelligent algorithms. The main control board of this system selects the STM32F103C8T6 microcontroller from STMicroelectronics as the main control chip of the minimal system board and uses the FDC2214 capacitance measurement chip to measure the precise capacitance value. The physical diagram of the capacitive sensor and the circuit diagram of the FDC2214 capacitive measurement chip are, respectively, shown in
Figure 2 and
Figure 3.
Figure 3 shows the implementation of the sensor front-end circuit. The core of this circuit is U9 (FDC2214), a multi-channel capacitance-to-digital converter. Its working principle is to measure the resonant frequencies of four independent LC resonant circuits. These circuits are composed of inductors L5–L8, capacitors C72–C75, and external sensing electrodes connected to P6–P9. When the target to be measured approaches the sensing electrodes, it causes a slight change in the sensor capacitance, which in turn leads to a deviation in the resonant frequency of the LC circuits. The FDC2214 chip precisely detects this frequency deviation and converts it into a digital signal. Additionally, Y2 is a 40 MHz active crystal oscillator, providing a high-precision clock reference for the FDC2214; the SCL and SDA pins and the pull-up resistors R64 and R65 form the I
2C communication interface for data transmission with the microcontroller; C76 to C79 are power bypass capacitors used to filter out noise and ensure the stable operation of the chip.
For each channel, the FDC2214 measures the oscillation frequency of an LC resonant circuit composed of an external inductor and the capacitance of the sensor to be tested, and converts this frequency into a high-resolution digital value. The relevant calculation formulas are as shown in the official technical manual of Texas Instruments [
19]:
is the oscillation frequency of this LC resonant circuit. is the reference clock frequency. is the capacitance to be measured. is 18 μH in this chip. The core function of the FDC2214 chip is to precisely measure the oscillation frequency of this LC resonant circuit. The chip will measure the ratio of the sensor frequency to the reference frequency , and then convert this ratio into a digital value for output . After the microcontroller reads this digital value from FDC2214, it can calculate the current oscillation frequency of the sensor based on the known . By combining the LC resonant frequency formula, the known inductance value and the other fixed parallel capacitance values in the circuit, the current value of the sensor capacitance can be calculated.
In this study, copper sheets were used as the electrode material. To provide insulation protection, the flexible printed circuit (FPC) technology was adopted. The capacitor plates were fabricated by covering the copper sheets with the FPC material itself. Specifically, the conductive copper foil layer of the sensor was integrated into the multi-layer structure of the FPC, and its exposed surface was protected and encapsulated by the insulating film of the FPC. The physical diagrams of the front and back sides are shown in
Figure 4. Most of the copper sheet areas were covered by the FPC insulating material, and a small part of the exposed bare copper sheet was exposed at the ends to facilitate welding with the wires. Such a design can provide excellent electrical insulation and physical protection. At the same time, the flexibility of the FPC enables it to better fit different shapes of container shells, ensuring the stability of the measurement. The size of the electrode is 235 mm in length, 50 mm in width, and 0.1 mm in thickness. The exposed part of the copper sheet is 10 mm long.
The experimental equipment layout is shown in
Figure 5.
Figure 6 shows the cooling and insulation of lead-acid batteries for the verification of the temperature robustness of the model, and
Figure 7 is the schematic diagram of the experimental equipment. The two capacitive plates attached to the vertical surface of the container served as the positive and negative electrodes of the capacitor. The capacitor plate covered the upper and lower limits of the electrolyte.
The actual industrial lead-acid batteries used for observation or operation typically have a very small top opening area. This structural feature makes it impossible to adopt the method where a floating sheet is inserted and a laser displacement sensor is used for high-precision liquid level reference measurement. To overcome these problems, this experiment uses the indirect method. The extracted electrolyte was sent into the square container. A laser distance sensor was mounted above the container and directs the laser beam onto a floating Teflon sheet on the liquid surface, measuring to an accuracy of 0.1 μm. Based on the measured level of the sulfuric acid, its volume can be accurately calculated. Then, by dividing this volume by the base area of the lead-acid battery, the electrolyte level of the lead-acid battery can be precisely determined. This indirect measurement method can achieve precise liquid level measurement without disassembling the battery. The peristaltic pump is used to precisely control the speed at which the electrolyte is extracted.
In order to rigorously evaluate the robustness of the proposed deep learning model under different thermal conditions, a dedicated temperature control system using the low-temperature cooling liquid circulation pump was constructed, as shown in
Figure 6. The cooling mechanism relies on contact heat conduction. Flexible cooling tubes are tightly wound around the casing of the lead-acid battery. 95% mass fraction ethanol was selected as the coolant to ensure stable flow and heat transfer efficiency at low temperatures. Thermocouples are used to monitor the temperature of the battery terminals in real time.
During the experiment, the cooling and circulation functions of the pump were activated, and heat was continuously extracted from the battery. To minimize heat exchange with the surrounding environment and ensure uniform cooling, the entire battery component was wrapped in polystyrene insulation material. A thermocouple firmly connected to the top terminal of the battery was used to monitor the battery temperature in real time.
During each experimental run, two primary data streams were collected simultaneously. The capacitance value was measured in pico-Farads by the capacitive sensor, and the true liquid level was measured in millimeters by the interpolation calculation method for starting and ending liquid levels. The sampling time is 200 ms. A custom data acquisition program developed in PyCharm 2020 Community Edition was used to log the data from both instruments to a host computer, and the environmental temperature was maintained at 20 °C.
Regarding the capillary action, while a meniscus is naturally formed at the liquid–wall interface, its effect is considered a systematic component of the measurement in the setup. The true liquid level was measured at the center of the container, away from the immediate wall effects. The capacitance sensor, which integrates the electric field over the entire wetted plate area, inherently includes the effect of the meniscus. As the data-driven model is trained to learn the direct mapping from the total measured capacitance which includes all systematic effects like capillarity to the true bulk level, the consistent influence of the capillary action is implicitly learned and compensated for by the model during the training process.
To build a comprehensive dataset for model training and evaluation, experiments were conducted under four distinct scenarios by changing the rotational speed of the peristaltic pump to 15, 30, 60, and 100 rpm. The experimental run performed at a very slow descent rate; 15 rpm was used to establish a quasi-static baseline. It is worth noting that the extremely fast decreasing rate corresponding to sudden structural failures such as severe shell rupture was not included in the detailed estimation analysis. Such emergency situations fall within the scope of fault safety protection logic rather than continuous liquid level tracking. This research aims to address the challenge of monitoring slow and imperceptible liquid level drops to prevent minor abnormalities from escalating into major safety accidents. The experimental runs performed at three constant descent rates were used to train and test the machine learning (ML) model. Meanwhile, this experiment also conducted variable rates experiment by changing the rotational speed of the peristaltic pump to simulate real industrial scenarios to verify the robustness of the model.
To comprehensively evaluate the robustness of the proposed model against environmental temperature variations, experiments were conducted under four distinct thermal conditions: 5 °C, 15 °C, 20 °C, and 25 °C. The standard temperature for lead-acid batteries is 20 °C. The ideal operating temperature range is 20 °C ± 5 °C [
20]. The 5 °C is set to test the robustness of the model under extreme conditions. The test temperature should not be too high or too low, because, based on the standard of 20 °C ± 5 °C, higher temperatures will shorten the lifespan of the equipment, while lower temperatures will reduce the available capacity [
20]. The dataset collected at the standard temperature for lead-acid batteries, 20 °C, was utilized for model training, hyperparameter tuning, and initial performance validation. In contrast, the datasets obtained at other temperatures (5 °C, 15 °C, and 25 °C) were kept entirely separate from the training process. These datasets served exclusively as independent test sets to assess the model’s generalization ability and to verify its stability when operating in different thermal environments.
This process resulted in a total dataset containing approximately 42,000 sample points. The detailed composition of the dataset is provided in
Table 1.
The relationship between capacitance and liquid level is as follows [
10]:
where
are the total capacitance, capacitance of the air, and capacitance of the liquid.
are the vacuum permittivity, relative permittivity of the air, and relative permittivity of the liquid.
are the area of the capacitor plates in contact with air and area of the capacitor plates in contact with liquid.
are the height of the top of the plates and height of the bottom of the plates.
is the liquid level height.
is the distance between the plates.
is the width of the plates. From Equation
it can be seen that the liquid level has a good linear relationship with capacitance. When other conditions remain constant, all parameters except
and
are constants. So, Equation
can be simplified to a linear model:
where
and
are constant. This linear relation is suitable for static measurement. This experiment controlled the peristaltic pump to run at a very slow rates of 0.06 mm/s to simulate static measurement. Since this condition represents a stable, near-linear physical relationship, this single, continuous data acquisition pass was sufficient to accurately fit the baseline static linear model. The relationship between liquid level and capacitance is shown in
Figure 8. The figure shows an approximately linear relationship between the level and capacitance. Using the least square method to fit the linear relation, the relation is as follows:
This model is applied to liquid level measurement with different descent rates, and the results are shown in
Figure 9. All the sample points during the descent process were recorded at different liquid level descent rates. Owing to the varying descent rates, the time needed to extract a liquid of the same height differs. Consequently, the scale of the time axis varies.
Figure 9 shows that the static linear model has a good prediction effect for slow descent. However, the deviation between the predicted value curve and the true value curve is larger in the case of fast descent, and the faster it descends, the greater the deviation. In order to test the effect of the static linear model from the evaluation index of the model, this study employed the evaluation indicators from study [
21], including the mean absolute error (MAE), root mean square error (RMSE), mean absolute percentage error (MAPE), and coefficient of determination (R
2). The equations of the evaluation index are given as follows:
The values of indexes are shown in
Table 2.
Table 2 shows that the MAE, RMSE, and MAPE all increase as the rotate speed increases. This is because, when rapidly descending, the liquid film hanging on the wall does not have enough time to fall, resulting in an increase in the measured capacitance value. As it shows in
Figure 10, the same capacitance corresponds to different liquid level at different rates. This error is not allowed in places with high safety requirements such as nuclear power plants. Therefore, the static linear model is not suitable for dynamic fast liquid level descent rates measurement.
5. Conclusions
This paper proposes a hybrid machine learning model (Poly-LSTM) for dynamic liquid level detection of lead-acid battery electrolyte based on a planar capacitor sensor. This model can operate stably under dynamic measurement conditions with different ambient temperatures and different liquid level change rates, and the calculation results are closer to the true liquid level value than linear models, LSTM, GBDT, MLP, and other methods. The input parameters for this model are the capacitance value and the rate of change in capacitance, both of which are easily obtained from capacitance detection of the copper sheets attached to the outer wall of the battery. The model is used as follows. Firstly, the capacitance values at different liquid level descent rates are measured. The capacitance value and capacitance change rate at each sampling interval are taken as base features. Secondly, these features are processed by a Polynomial Feature generator to create high-order and interaction features. These new features explicitly model the complex nonlinear interactions between the inputs and provide a richer, 10-dimensional feature set for the deep learning model. This feature set is then restructured into sequences and fed into an LSTM network to learn the temporal dependencies. Finally, the hidden state of the last time step, which serves as a comprehensive summary of the input sequence, is passed through a fully connected output layer to achieve accurate liquid level prediction. It is found that the MAE of Poly-LSTM algorithm is no more than 0.86 mm, RMSE is no more than 1.02 mm, and MAPE is no more than 0.22%, respectively, which is significantly better than other comparison models. This method fully combines the advantages of polynomial feature generation and LSTM, solves the measurement error caused by the residual liquid film adhesion layer effect, and improves the accuracy of dynamic measurement of lead-acid battery electrolyte level.
Although this study validates the effectiveness of the proposed dynamic measurement method, some challenges remain in applying it to real-world industrial environments such as nuclear power plants. Firstly, electromagnetic interference (EMI) in industrial environments is a problem. Although the FDC2214 chip itself adopts an anti-EMI architecture, future research still needs to include advanced digital filtering algorithms. Secondly, sensor aging due to long-term use may cause measurement drift. This can be solved by developing online self-calibration or drift compensation algorithms, such as using reference electrodes. Finally, when extending this system to multi-cell configurations, relying solely on the Bluetooth module to transmit data to the serial port debugging assistant has significant limitations. Future work will develop a corresponding software control platform to centrally manage a large number of sensors.