Estimation of Battery State-of-Charge using
Feedforward Neural Networks
1st Omer Ali
School of Electrical and Electronic Engineering
Universiti Sains Malaysia (USM)
Pulau Pinang, Malaysia
omerali@gmail.com
2nd Mohamad Khairi Ishak
School of Electrical and Electronic Engineering
Universiti Sains Malaysia (USM)
Pulau Pinang, Malaysia
khairiishak@usm.my
3rd Furqan Memon
Department of Electrical Engineering
NFC Institute of Engineering & Technology (NFC IET)
Multan, Pakistan
furqan@nfciet.edu.pk
4th Mohd Shahrimie Mohd Asaari
School of Electrical and Electronic Engineering
Universiti Sains Malaysia (USM)
Pulau Pinang, Malaysia
mohdshahrimie@usm.my
Abstract—Wireless sensor networks (WSNs) are constrained
devices that run on small batteries. The battery energy availabil-
ity, device drive cycles, and climatic factors all affect the node
lifetime. The state of charge (SoC) of the batteries is an important
factor in determining how much energy is available, that is crucial
for predicting device lifetime and ensuring safe device operation.
This work presents feedforward neural networks to estimate the
adaptive SoC of various battery types. The training data for three
different batteries: lithium-ion, nickel-metal hydride, and lithium
polymer was used. To calculate the SoC, battery data such as
voltage, capacity, and temperature were directly mapped. For
each battery parameter, the model was trained at temperatures
ranging from 5°C to 45°C. The performance measures Mean
Squared Error (MSE) of (2.72%) and Root Mean Squared Error
(RMSE) of (1.65%) resulted in an estimation accuracy of (97%)
on average. Finally, the model was implemented on ARM Cortex
M4-based micro-controllers, allowing for precise estimation of
real-time on-line SoC on WSN nodes.
Index Terms—battery, state-of-charge, machine learning, arti-
ficial neural networks.
I. INT ROD UC TI ON
The Internet of Things (IoT) has become one of the most
investigated technology topics in the previous decade. Wire-
less Sensor Networks (WSN) are the backbone of most IoT
implementations. Typically, these nodes are battery-powered,
limiting their function and lifespan. Thus accurate available
energy estimation is critical to predicting device longevity.
This data is needed to create energy-efficient algorithms that
improve device performance and lifespan [1], [2]. However,
estimating the battery lifetime in WSN nodes is challenging
because of multiple factors influencing their operation (For
instance, battery electrochemical characteristics, device oper-
ating temperature, and even load current.
The performance of a battery is determined by operational
and environmental factors. A battery’s state of charge (SoC) is
This research was sponsored by Universiti Sains Malaysia, Research Grant
(FRGS - Grant No: FRGS/1/2020/TK0/USM/02/1)
used to determine its remaining capacity. WSN, on the other
hand, necessitate SoC information to conduct device lifespan
prediction due to limited available energy and the lack of bat-
tery charging capabilities [3]–[7]. Therefore, battery capacity
prediction for WSN must incorporate dynamic application-
specific loads and environmental circumstances for accurate
SoC measurement.
In the laboratory setting, Open Circuit Voltage (OCV) is
the most common method for estimating SoC. This method
uses the steady state open circuit voltages of the batteries to
estimate remaining capacity. At any temperature, the one to
one SoC-OCV maps the mathematical relation between battery
capacity and available voltage. However, the lengthy relaxation
time required to reach steady state makes it unsuitable for
real-time SoC estimation [8]–[10]. The Ampere-hour (Ah)
integration method, on the other hand, averages the discharge
current of the batteries over time. The (Ah) method is the
simplest and most efficient. It requires sensitive sensors to
measure the battery’s charge flow and a precise initial battery
capacity. The SoC estimation accuracy decreases due to initial
capacity estimation errors and battery charge flow deviations.
Techniques based on Equivalent Circuit Models (ECM) com-
pute state equations to model battery behavior under specific
loads and conditions. The models map mathematical relations
to electrochemical behavior within the battery. These models
require a lot of parameter extraction due to the large num-
ber of complex battery parameters, dynamic electrochemical
processes, and environmental conditions.
To circumvent such shortcomings, filter-based strategies
derive ECM models. Unlike ECM models that use offline
calculations, filter-based approaches use adaptive filters to
do online computations. Common adaptive-filters for SoC
estimation include sliding mode observers, particle filters, and
extended Kalman Filters (EKF). These filters can estimate
SoCs with excellent accuracy but are particularly sensitive to
system noise. Data-driven approaches require a huge dataset to
978-1-6654-8584-5/22/$31.00 ©2022 IEEE
2022 19th International Conference on Electrical Engineering/Electronics, Computer, Telecommunications and Information Technology (ECTI-CON)
identify, map, and predict systems [11], [12]. Some examples
include fuzzy logic, support vector machines, neural networks,
process regressions, and extreme learning machines (ELM),
requiring a very large dataset for training and validation
purposes. Smart batteries in electronic devices (such as smart-
phones, laptops, and cameras) provide online battery behavior
measurements. However, using hardware may considerably
increase the cost of a WSN node. So software-based data-
driven solutions are regarded viable for WSN applications
[14].
This research focused on Feed forward neural networks
(FFNN) for real-time online SoC estimate for constrained
devices is proposed to overcome these restrictions. Any contin-
uously differentiable function can be approximated with FFNN
and is a major benefit of neural networks in particular. A
succession of FFNN can also run independently with a small
intermediary to maintain moderation. Furthermore, a neural
network can readily handle and process non-linear input. Fi-
nally, the implementation is not difficult and can be done on an
embedded platform. The battery parameters (voltage, capacity,
and temperature) were observed for the temperatures and used
for model training and validation. In this research (Ah) method
was used to measure battery discharge characteristics under
varying loads (IEEE 802.15.4 protocol based transceiver drive
profile) [7], [15]. The model’s accuracy and predictability were
extensively tested on the recorded dataset. Finally, the trained
model was deployed on COTS low-power devices. The model
estimation accuracy was also examined on an ARM Cortex-
M4 platform for real-time on-line SoC estimation.
II. ME TH OD S AN D MATER IA LS
Non-linear battery parameters recorded and mapped for fea-
ture extraction. Only the optimized trained version is deployed
after they have been trained offline on a larger dataset. Fig. 1
illustrates the process flow methodology for the proposed
scheme.
A. Battery Characterization
Three batteries were observed according to the methods
described in [15]. This required: (i) a climate chamber to
maintain temperatures during battery discharge experiments
(ii) charging, resting, and temperature equalization before
experiments.
B. Network Structure and Model Deployment
The network structure included (i) Model generation
(ii) Training and validation of models using drive cycled
dataset (iii) Model testing using augmented data.The battery
chemistries that were used in this research are presented in
Table I. These tests used 30mA, 50mA, and 100mA discharge
currents corresponding to 0.03C, 0.05C, and 0.1C discharges.
A discharge pulse every 15 seconds enabled the load, which
was then recorded by the micro-controller. Each battery needed
15 drive cycles at various loads and temperatures to train
and validate the models. Three extra drive cycles were used
to enhance the effect of noisy measurements. An additive
Fig. 1. Flowchart for FFNN ML model for SoC estimation.
Gaussian noise with a mean of 0 and a standard deviation
of 1 to 2 percent was applied to voltage and temperature
measurements in this case.
TABLE I
BATTE RY SPE CI FICATI ON S USE D FO R CHA RAC TER IZ ATIO N IN TH E ST UDY
[16].
Manufacturer Model Type Capacity (mAh)
Powerizer MH-
AAA1000APZ
[17]
Ni-MH 1000
Data Power
Technology
DTP603450 [18] Li-Po 1000
Panasonic UF553443ZU
[19]
Li-Ion 1000
The flat discharge region, where minor voltage variations
can reflect large changes in SoC, becomes the most diffi-
cult to estimate SoC and capacity. The performance of ML
models is heavily influenced by feature selection, correlation,
distribution, and variance. Therefore, data normalization and
2022 19th International Conference on Electrical Engineering/Electronics, Computer, Telecommunications and Information Technology (ECTI-CON)
Fig. 2. An illustration of feedforward neural network architecture.
transformations were performed on the feature set. This not
only speeds up ML model training but also improves accuracy.
The proposed FFNN was designed using a single layer ML
model as illustrated by Fig. 2, where inputs are matched to
extracted features, and are multiplied by weights and bias for
parameter modeling. The output value is usually 1 if the sum
of the values is above a certain threshold, and -1 if the sum
is below the threshold.
III. RES ULTS A ND DI SC US SI ON S
It was observed that the model converged very quickly and
the predicted responses for estimated SoC were found to be
very close to the actual values. The model residuals provide
a detailed insights to observe the findings and are reported in
Fig. 3.
Fig. 3. Residual histogram for ANN feedforward network.
The model fully converged after 9 epochs and success-
fully estimated SoC for various battery chemistry. The MSE,
RMSE, and R2 values were calculated to report the model
accuracy that are given in Table II. It was also noticed
TABLE II
ANN FEE DF ORWARD MO DE L RESP ON SE FO R SE VER AL BATT ER IES .
Battery Type MSE RMSE R2
Li-Ion 2.722 1.65 0.99
Li-Po 2.815 1.678 0.99
Ni-MH 1.852 1.361 1
that Ni-MH batteries provided the closest fit with minimum
residuals, due to its longer flat region. The flat region in Ni-
MH corresponds to its lower internal resistance that remain
very low and consistent at lower discharge rates.
As evident, the model fits closely for higher SoC (mostly
from 100% to 80% region) with fewer residuals. It is due to
the fact that the voltage variations in the flat regions remain
very small and a slight change may result in a large SoC
shift, affecting the SoC estimation accuracy in the flat region.
Furthermore, a large number of residuals appear near the end
of battery capacity (that can be observed from 30% region and
below). It was observed that during this stage the battery loses
its internal chemical transport reactions, resulting in voltage
losses. The analysis concludes that model fitting requires
additional perceptron for back propagation resulting in better
estimation. It was also observed that the similar model can
be applied to the dataset from all three batteries. However,
Li-Ion battery requires further data processing to increase
estimation accuracy and reduce the number of residuals in
its linear region. In this regard, the model was further tuned
and a significant improvement in SoC estimation accuracy was
observed, as given by Fig. 4.
IV. CON CL US IO N
This research proposed an adaptive FFNN to estimate SoC
for several battery types at various operating conditions. The
model provided over 98% accuracy for all datasets with high
predictability for future dataset validation. The model required
a fewer number of layers and with fast convergence, made
it suitable for real-time embedded SoC measurement. In the
2022 19th International Conference on Electrical Engineering/Electronics, Computer, Telecommunications and Information Technology (ECTI-CON)
Fig. 4. Optimized fitting function response for feed forward neural network.
case of Li-Po batteries, however, a two-layer FFNN was
found to outperform a single layer architecture. On the other
hand, increasing the number of layers and neurons per layer
had no discernible effect on model accuracy. NiMH behaved
differently, with a decrease in RMSE and convergence time
as the number of neurons increased. The model’s accuracy
improved as the number of layers increased. It is highly
unlikely that a model can be tuned to perform well for all
batteries across the entire dataset. A close-enough model can
be trained to accurately estimate SoC due to the similarity
of the battery discharge profiles; however, model inaccuracies
cannot be avoided.
ACK NOW LE DG ME NT
The authors would like to thank Universiti Sains Malaysia
(USM) and Ministry of Higher Education Malaysia for provid-
ing the research grant, Fundamental Research Grant Scheme
(FRGS - Grant No: FRGS/1/2020/TK0/USM/02/1).
REF ER EN CE S
[1] S. Jabbar, A. A. Minhas, M. Imran, S. Khalid, and K. Saleem, “En-
ergy efficient strategy for throughput improvement in wireless sensor
networks,” Sensors, vol. 15, no. 2, pp. 2473–2495, 2015.
[2] A. S. K. Mammu, U. Hernandez-Jayo, N. Sainz, and I. De la Iglesia,
“Cross-layer cluster-based energy-efficient protocol for wireless sensor
networks,” Sensors, vol. 15, no. 4, pp. 8314–8336, 2015.
[3] H. A. Nguyen, A. F¨
orster, D. Puccinelli, and S. Giordano, “Sensor node
lifetime: An experimental study,” in 2011 IEEE International Conference
on Pervasive Computing and Communications Workshops (PERCOM
Workshops). IEEE, 2011, pp. 202–207.
[4] W. Rukpakavong, I. Phillips, and L. Guan, “Lifetime estimation of
sensor device with aa nimh batteries,” in Proc. ICICM, 2012, pp. 98–
102.
[5] O. Ali, M. K. Ishak, M. A. M. Zawawi, M. T. A. Seman, M. K. L.
Bhatti, and Z. Y. M. Yusoff, “A mac protocol for energy efficient wireless
communication leveraging wake-up estimations on sender data,” in 2020
17th International Conference on Electrical Engineering/Electronics,
Computer, Telecommunications and Information Technology (ECTI-
CON). IEEE, 2020, pp. 45–50.
[6] O. Ali, M. K. Ishak, and M. K. L. Bhatti, “Adaptive clear channel
assessment (a-cca): energy efficient method to improve wireless sensor
networks (wsns) operations,” AEU-International Journal of Electronics
and Communications, vol. 131, p. 153603, 2021.
[7] O. Ali, M. K. Ishak, C. A. Ooi, and M. K. L. Bhatti, “Battery
characterization for wireless sensor network applications to investigate
the effect of load on surface temperatures,” Royal Society Open Science,
vol. 9, no. 2, p. 210870, 2022.
[8] M. Gholizadeh and F. R. Salmasi, “Estimation of state of charge,
unknown nonlinearities, and state of health of a lithium-ion battery
based on a comprehensive unobservable model,” IEEE Transactions on
Industrial Electronics, vol. 61, no. 3, pp. 1335–1344, 2013.
[9] H. Chaoui and S. Mandalapu, “Comparative study of online open circuit
voltage estimation techniques for state of charge estimation of lithium-
ion batteries,” Batteries, vol. 3, no. 2, p. 12, 2017.
[10] Z. Liu, X. Dang, and B. Jing, “A novel open circuit voltage based state
of charge estimation for lithium-ion battery by multi-innovation kalman
filter,” IEEE Access, vol. 7, pp. 49 432–49 447, 2019.
[11] B. Buchli, D. Aschwanden, and J. Beutel, “Battery state-of-charge
approximation for energy harvesting embedded systems,” in European
Conference on Wireless Sensor Networks. Springer, 2013, pp. 179–196.
[12] X. Hu, F. Feng, K. Liu, L. Zhang, J. Xie, and B. Liu, “State estimation
for advanced battery management: Key challenges and future trends,”
Renewable and Sustainable Energy Reviews, vol. 114, p. 109334, 2019.
[13] Y. Zhang, R. Xiong, H. He, and W. Shen, “Lithium-ion battery pack state
of charge and state of energy estimation algorithms using a hardware-in-
the-loop validation,” IEEE Transactions on Power Electronics, vol. 32,
no. 6, pp. 4421–4431, 2016.
[14] Y. Wang, D. Yang, X. Zhang, and Z. Chen, “Probability based remain-
ing capacity estimation using data-driven and neural network model,”
Journal of Power Sources, vol. 315, pp. 199–208, 2016.
[15] O. Ali, M. K. Ishak, A. B. Ahmed, M. F. M. Salleh,
C. A. Ooi, M. F. A. J. Khan, and I. Khan, “On-line wsn
soc estimation using gaussian process regression: An adaptive
machine learning approach,” Alexandria Engineering Journal,
vol. 61, no. 12, pp. 9831–9848, 2022. [Online]. Available:
https://www.sciencedirect.com/science/article/pii/S1110016822001636
[16] O. Ali, M. K. Ishak, A. O. Chia, and M. K. L. Bhatti, “Battery
discharge characteristics for ieee 802.15.4 based radio load profile,”
Dryad, 5 2021. [Online]. Available: https://zenodo.org/record/4876563
[17] A.P.P and Corporation, “Ni-mh rechargeable battery specifications,”
APP Corporation, Tech. Rep., 2015. [Online]. Available:
https://www.batteryspace.com/prod-specs/174-MH-AAA1000APZ.pdf
[18] D.P.T. and Limited, “Polymer li-ion rechargeable battery,”
Data Power Technology, Tech. Rep., 2015. [Online].
Available: https://cdn.sparkfun.com/assets/5/6/e/1/5/SPE-DTP603450-
1000mah-3.7V-En-1.0V.pdf
[19] Panasonic, “Lithium-ion prismatic rechargeable bat-
tery,” Panasonic, Tech. Rep., 2007. [On-
line]. Available: https://industrial.panasonic.com/cdbs/www-
data/pdf/ACA4000/ACA4000PE3.pdf
2022 19th International Conference on Electrical Engineering/Electronics, Computer, Telecommunications and Information Technology (ECTI-CON)