3. Embedded AI — Battery State of Charge using Machine Learning

David Such
11 min readJun 30, 2024

Battery State of Charge (SOC) indicates the remaining charge of a battery as a percentage of its total capacity. This information is vital for the energy management of embedded devices. Accurately estimating SOC is challenging due to the complex behavior of Li-ion batteries, which is influenced by factors such as temperature, battery health, and SOC itself. Traditional methods for estimating SOC, like electrochemical models, demand precise parameters and an in-depth understanding of the battery’s composition and physical characteristics. Alternatively, a machine learning model offers a data-driven approach that simplifies SOC estimation by requiring less detailed knowledge about the battery’s behavior, making it suitable for implementation in embedded systems.

Image Created using Midjourney

The Machine Learning Process

In Part 1 of our series on embedded AI, we explained the process we follow when we use ML to predict values (Figure 1).

Figure 1. The ML Process Flowchart

As illustrated in Part 2, Figure 2, the battery discharge curve is almost linear over most of its usable range. That being the case, we could use the linear regression model that we explained in…

--

--

David Such

Reefwing Software · Embedded Systems Engineer · iOS & AI Development · Robotics · Drones · Arduino · Raspberry Pi · Flight Control