DEV Community

lee
lee

Posted on

Estimate Smart Ring Battery Life From PPG and BLE Events With Python

Smart ring prototype with a curved pouch cell beside an illustrative current trace showing PPG sampling and BLE reconnect events.

Your prototype lasts nearly six days on the bench. Then someone wears it for a weekend, spends a few hours away from their phone, and the ring falls short of its five-day target. The same smart ring battery can deliver different runtimes because the firmware spends more time searching for a connection.

Before specifying a custom lithium battery, check how much charge the firmware uses in a typical day. This Python example separates optical heart-rate sensing, Bluetooth sync, and reconnect activity so you can see which events push the device over budget.

Build a daily charge budget

Start with the current drawn at the device’s battery input between events. Then estimate the extra charge used by each event based on its average current above that baseline, its duration, and how often it happens.

For this example, assume a 70 µA baseline and 14.4 mAh of usable capacity before the device reaches its operating cutoff. All values below are illustrative.

Event Count per day Average current above baseline Duration
Optical heart-rate sensing (PPG) 1,440 4 mA 0.35 s
Bluetooth Low Energy (BLE) sync 48 12 mA 1.5 s
BLE reconnect attempt 0 or 120 8 mA 2.0 s

Compare a stable connection with frequent reconnects

The script assumes the same sensing and sync schedules in both scenarios. The reconnect count is the only input that changes.

BASELINE_MA = 0.070
USABLE_CAPACITY_MAH = 14.4
TARGET_DAYS = 5


def event_charge_mah(count, extra_current_ma, duration_seconds):
    return count * extra_current_ma * duration_seconds / 3600


def daily_charge_mah(reconnect_count):
    baseline = BASELINE_MA * 24
    sensing = event_charge_mah(1440, 4.0, 0.35)
    sync = event_charge_mah(48, 12.0, 1.5)
    reconnect = event_charge_mah(reconnect_count, 8.0, 2.0)
    return baseline + sensing + sync + reconnect


daily_budget = USABLE_CAPACITY_MAH / TARGET_DAYS
print(f"Daily budget: {daily_budget:.2f} mAh")

for scenario, reconnect_count in [
    ("Stable connection", 0),
    ("Frequent reconnects", 120),
]:
    daily_charge = daily_charge_mah(reconnect_count)
    runtime = USABLE_CAPACITY_MAH / daily_charge
    print(f"{scenario}: {daily_charge:.2f} mAh/day, {runtime:.2f} days")
Enter fullscreen mode Exit fullscreen mode

Illustrative smart ring charge use rises from 2.48 to 3.01 mAh per day with frequent BLE reconnects, exceeding the 2.88 mAh daily budget.

Daily budget: 2.88 mAh
Stable connection: 2.48 mAh/day, 5.81 days
Frequent reconnects: 3.01 mAh/day, 4.78 days
Enter fullscreen mode Exit fullscreen mode

The reconnect attempts add 0.53 mAh per day. That alone takes this example from above the five-day target to below it. On a real prototype, that gives the firmware team something specific to investigate before the hardware team allocates more space for a cell.

Replace the example inputs with measurements from your ring

  1. Capture a connected session and an out-of-range session. Mark PPG windows, sync events, and reconnect attempts in the firmware log. Match their timestamps to the current trace.
  2. Measure charge over each complete event. Include the work before and after radio activity if it keeps the device awake. When PPG and BLE overlap, integrate the combined window once so you count the shared activity once.
  3. Check the minimum input voltage during a burst at low charge. The daily charge budget estimates runtime. The voltage trace helps explain why a ring might reset during sync even when the budget suggests it should still be running.

If reconnects dominate the difference, compare two firmware builds under the same out-of-range conditions. Record daily charge and time to reconnect for each build. A retry schedule that saves power also has to reconnect quickly enough for the product.

AI assistance was used to draft this article. The numerical inputs are illustrative.

Top comments (0)