This study implements an Adaptive Extended Kalman Filter (AEKF) for real-time state of charge (SoC) estimation to support charge–discharge regulation in a LiFePO₄ battery system integrated with photovoltaic (PV) generation. Due to the variability of PV output, accurate and stable SoC estimation is essential for ensuring reliable battery operation. A first-order equivalent circuit model (1RC ECM) is employed to represent battery dynamics based on measured current and terminal voltage. The proposed AEKF algorithm is implemented on a Raspberry Pi 5 to enable real-time computation, and the estimated SoC is directly used as the control variable in a dual-relay switching mechanism to regulate charging and discharging processes. Experimental results show that the proposed method achieves a Mean Absolute Error (MAE) of 1.24% and a Root Mean Square Error (RMSE) of 1.58%, which are both below the 5% target specified in the system design. The system successfully maintains the battery within a safe SoC range of 57.5% to 85.2%, while ensuring stable relay operation without chattering under dynamic load and charging conditions. These results demonstrate that the proposed AEKF-based approach provides accurate, stable, and practical SoC estimation, making it suitable for real-time battery management in small-scale energy storage applications.
Copyrights © 2026