DEV Community

Docy
Docy

Posted on

How to Accurately Monitor LiPo Battery Life in Embedded Systems (Beyond Simple ADC Voltage Reading)

Why Battery Percentage Is Harder Than It Looks

Battery monitoring seems simple at first.

A common approach in embedded systems is:

LiPo Battery Voltage → ADC Reading → Battery Percentage
Enter fullscreen mode Exit fullscreen mode

For example:

  • 4.2V = 100%
  • 3.7V = 50%
  • 3.3V = 0%

It works well enough for a basic prototype.

But once your device becomes more complex, problems start appearing:

  • A device suddenly shuts down while showing 20% battery remaining.
  • Battery percentage jumps from 60% to 30% after turning on a motor.
  • The same battery shows different remaining capacity in different environments.
  • A robot works perfectly on the bench but resets during movement.

The reason is simple:

Battery voltage is not the same thing as remaining battery capacity.

For LiPo batteries, accurate battery monitoring requires understanding the battery behavior, the load, and the limitations of voltage-based estimation.


1. Why ADC Voltage Reading Is Not Enough

1.1 LiPo Battery Voltage Is Not Linear

A LiPo battery is usually rated at a nominal voltage of 3.7V, but its actual voltage changes during charging and discharging.

A typical single-cell LiPo battery:

  • Fully charged: 4.2V
  • Nominal voltage: 3.7V
  • Nearly empty: around 3.3V

The common mistake is assuming the voltage drops evenly with capacity.

For example:

4.2V → 100%
3.9V → 75%
3.7V → 50%
3.5V → 25%
3.3V → 0%
Enter fullscreen mode Exit fullscreen mode

This looks reasonable, but real LiPo discharge curves do not behave this way.

Most of the usable capacity is concentrated in a relatively flat voltage region.

A battery may stay around 3.7V–3.8V for a long period, then suddenly drop near the end of discharge.

This means:

  • 3.8V does not always mean 60% battery.
  • 3.6V does not always mean 20% battery.

A simple voltage-to-percentage conversion can easily give inaccurate results.

1.2 Voltage Changes Under Load

This is one of the biggest problems in robotics and high-power embedded applications.

Imagine a small robot powered by a LiPo battery.

When the robot is idle:
Battery voltage: 3.85V

The MCU reads the voltage and reports:
Battery: 70%

But when the motors start moving:

Motor startup current: 0.5A → 5A

The sudden current demand causes a temporary voltage drop: 3.85V → 3.55V

The ADC now thinks: Battery: 30%

But the battery is not actually empty.

The voltage drop is caused by:

  • Internal resistance
  • High current demand
  • Battery temperature
  • Wiring resistance

This is called voltage sag.

For devices such as:

  • robots
  • drones
  • cameras
  • wireless transmitters

voltage sag can create false battery readings or even unexpected shutdowns.

1.3 Temperature Affects Battery Performance

LiPo batteries behave differently depending on temperature.

At low temperatures:

  • Internal resistance increases.
  • Available capacity decreases.
  • Voltage drops faster under load.

At high temperatures:

  • Battery aging accelerates.
  • Cycle life decreases.

For example, the same battery may show 3.7V at room temperature.

but provide much less usable energy in a cold environment.

A reliable battery monitoring system needs to consider temperature, especially for outdoor robots and industrial devices.


2. Common Battery Monitoring Methods

There are several ways to estimate LiPo battery life. Each method has different accuracy, cost, and complexity.

Method 1: Voltage-Based Estimation

This is the simplest approach.

The system measures battery voltage using an ADC and converts it into a percentage.

Basic architecture:

LiPo Battery
      |
      |
 Voltage Divider
      |
      |
     ADC
      |
      |
 Battery Percentage
Enter fullscreen mode Exit fullscreen mode

Advantages

  • Low cost
  • Simple hardware
  • Easy to implement
  • Good enough for basic devices

Problems

However, voltage-based estimation has limitations:

  1. Poor accuracy

The relationship between voltage and capacity is not linear.

  1. Sensitive to load

A motor startup or wireless transmission can temporarily reduce voltage.

  1. Difficult near empty state

A battery may stay stable for a long time and then drop quickly.

Voltage monitoring is acceptable for simple products, but it is usually not enough for advanced embedded systems.

Method 2: Coulomb Counting

A more accurate approach is measuring the actual current flowing in and out of the battery.

This method is called coulomb counting.

Instead of asking:

"What is the battery voltage?"

It asks:

"How much energy has been consumed?"

The system tracks:

Remaining Capacity =
Initial Capacity
+ Charged Energy
- Consumed Energy
Enter fullscreen mode Exit fullscreen mode

For example:

A 3000mAh battery starts fully charged.

The system measures:

  • 500mAh consumed

Remaining capacity: 3000mAh - 500mAh = 2500mAh

Advantages

  • More accurate during changing loads
  • Works better for dynamic devices
  • Suitable for robots and IoT devices

Limitations

  • Requires current measurement hardware
  • Needs calibration
  • Small measurement errors can accumulate over time

Method 3: Dedicated Battery Fuel Gauge IC

For professional embedded products, engineers often use dedicated fuel gauge chips.

Examples include:

  • MAX170xx series
  • BQ series
  • LC709203F

These chips can monitor:

  • Battery voltage
  • Current flow
  • Temperature
  • State of Charge (SOC)
  • Battery health

A typical architecture:

             LiPo Battery

                  |

          +---------------+
          | Fuel Gauge IC |
          +---------------+

                  |

                 MCU

                  |

        Battery Management Software
Enter fullscreen mode Exit fullscreen mode

The MCU communicates with the fuel gauge through interfaces such as I2C.

This provides much better battery estimation compared with reading voltage alone.


3. Understanding Battery Status Metrics

Battery percentage is only one part of battery monitoring.

Engineers usually work with several battery parameters.

State of Charge (SOC)

SOC represents the current available capacity.

Example: SOC = 80%

means approximately 80% of usable energy remains.

State of Health (SOH)

SOH represents battery aging.

A new battery: Capacity: 3000mAh. SOH: 100%.

After long-term use: Capacity: 2400mAh, SOH: 80%.

A battery can show 100% SOC but still have reduced total capacity because of aging.

Depth of Discharge (DOD)

DOD describes how much energy has already been used.

For example: DOD: 70% means 70% of the battery capacity has been consumed.

Understanding DOD helps optimize battery cycle life.


4. A Better Battery Monitoring Architecture for Embedded Devices

A reliable system usually combines hardware and software.

A practical design:

              LiPo Battery

                    |

          Voltage + Current Sensor

                    |

            Fuel Gauge Algorithm

                    |

                   MCU

                    |

       Battery Status / Power Control
Enter fullscreen mode Exit fullscreen mode

Instead of relying on one measurement, the system combines:

  • Voltage
  • Current
  • Temperature
  • Battery characteristics
  • Historical data

This provides a much more accurate estimation.


5. Practical Example: Battery Monitoring in a Small Robot

Consider a battery-powered robot.

The system includes:

  • Microcontroller
  • Motor driver
  • Sensors
  • Wireless module
  • LiPo battery

During idle operation: Current: 300mA
Battery voltage: 3.8V
The system estimates: Battery: 65%

Everything looks normal.
But when the robot accelerates: Motor current:300mA → 5A

The voltage drops: 3.8V → 3.5V

A simple ADC-based system may report: Battery: 20%

or trigger a low-voltage shutdown.

A better system would:

  • Measure current
  • Detect voltage sag
  • Apply filtering
  • Estimate real SOC

The result:

  • More stable operation
  • Fewer false shutdowns
  • Better user experience

6. Software Techniques to Improve Battery Estimation

Even with simple hardware, software can improve accuracy.

6.1 Voltage Filtering

Raw ADC readings can fluctuate because of:

  • Motor noise
  • Wireless transmission
  • Sudden load changes

Common solutions:

  • Moving average filter
  • Low-pass filter

Instead of: Single ADC Reading

use:

Multiple Samples
        |
        |
 Filter Algorithm
        |
        |
 Stable Battery Value
Enter fullscreen mode Exit fullscreen mode

6.2 Battery Lookup Table

Instead of using a simple formula, engineers can use a battery discharge curve.

Example:

Voltage      Estimated SOC

4.20V        100%
4.00V         80%
3.80V         50%
3.50V         20%
3.30V          0%
Enter fullscreen mode Exit fullscreen mode

The lookup table can be customized based on:

  • Battery model
  • Discharge current
  • Temperature

6.3 Load Compensation

A better algorithm considers current consumption.

Instead of: Voltage → Battery %

use:

Voltage
+
Current
+
Temperature
=
Estimated Battery State
Enter fullscreen mode Exit fullscreen mode

This is especially important for devices with changing power demands.


7. Designing Better Low-Battery Protection

Battery monitoring is not only about showing a percentage.

A smart device should respond to different battery levels.

Warning Stage

Example:

20% battery remaining:

  • Reduce screen brightness
  • Reduce wireless transmission frequency
  • Disable unnecessary functions

Critical Stage

Example:

5% battery remaining:

  • Save important data
  • Stop motors safely
  • Enter low-power mode
  • Shut down properly

This prevents:

  • Data loss
  • Unexpected resets
  • Battery damage

Discussion

How does your embedded project estimate battery life?

Do you rely on ADC voltage readings, or do you use a dedicated fuel gauge IC?

Share your experience below.

Top comments (0)