Wiznet makers

TheoIm

Published December 18, 2025 ©

51 UCC

27 WCC

7 VAR

0 Contests

0 Followers

0 Following

Original Link

Calculating Battery Life Using the µA-Level Current Measurement Tool NRF-PPK2

Calculating Battery Life Using the µA-Level Current Measurement Tool NRF-PPK2

COMPONENTS
PROJECT DESCRIPTION

Battery Life Calculator: Precision IoT System Design with NRF-PPK2

Project Overview: Why Precision Current Measurement Matters

For IoT sensor systems deployed in the field, especially in hard-to-reach environments like underwater pressure sensors, the critical question is: "How long will the battery last?" Traditional rule-of-thumb calculations fall short because:

  • Actual current consumption ≠ Datasheet specifications
  • Sleep mode leakage currents are overlooked
  • Wake-up peak currents are missed

NRF-PPK2 (Power Profiler Kit 2) is Nordic Semiconductor's current measurement tool that measures from nA (nano-ampere) to over 1A in real-time and automatically calculates charge consumption (mC).


System Architecture: Underwater Pressure Sensor + LoRa + MQTT Gateway

Overall System Design

 
[Underwater Environment]
    │
    ▼
────────────┐
│  Underwater Module       │
│  ──────────  │
│  • ATmega328P (→88)    │
│  • MS5837 Pressure         │
│  • RS485 TX                       │
│  • Battery: 3xAA                │
└────┬──────┘
            │ RS485
            ▼
┌──────────┐
│  LoRa TX Module          │
│  ────────     │
│  • ATmega324PA         │
│  • MS5837 (Barometer)│
│  • LoRa 930MHz, 10mW │
│  • TPL5110 Timer          │
│  • Battery: 12xAA          │
└────┬──────┘
            │ LoRa (Wireless)
            ▼
┌────────────┐
│  Control Room Gateway    │
│  ──────────     │
│  • ESP32 (ESP-NOW)         │
│  • W5500 (Ethernet)           │
│  • LoRa RX                           │
│  • MQTT Broker Link          │
└────────────┘

 

 

Operation Cycle:

  1. TPL5110 timer wakes system every 6min 15sec (standby: tens of nA)
  2. LoRa module powers on underwater module
  3. Underwater module measures pressure/temp → RS485 transmission
  4. LoRa module measures barometric pressure + integrates data → LoRa TX
  5. Immediately enters sleep mode

ESP32 + W5500 MQTT Gateway Board

The developer designed a custom slot card expansion board for stable IoT gateway operation.

Hardware Configuration

Design Features

1. Power Management Improvement

  • Initial: 12V direct supply → 7805 overheating
  • Improved: DC-DC step-down to 8V then 7805 → minimal heat

2. W5500 Heat Mitigation

  • Problem: 2x W5500 on single AMS1117-3.3V → 60°C
  • Solution: Added 9×9×12mm aluminum heatsinks

3. Firmware Update Simplification

Rear header on slot card:
[GND] [VCC] [TX] [RX]
    ↓
Connect FT232RL USB-Serial
    ↓
Hold Prog button → Press Reset → Programming mode

4. Expandability

  • Standalone use: External W5500 via slot pins
  • LoRa module: E-byte LoRa mountable on each card
    • M0, M1 pins: Tied to GND (pre-configuration required)
    • Aux pin: For transmission feedback (5sec timeout without)

Measurement Results Analysis

1. Wake-up Cycle Charge Consumption

Measured Values:

Window Selection: Wake-up period only (~2 seconds)
Total Charge: 19.02 mC (milli-coulombs)
 Window Selection: Full cycle (6min 15sec)
Total Charge: 19.02 mC (same!)

Meaning: Negligible charge consumption during sleep (thanks to TPL5110's tens-of-nA standby)

2. Sleep Mode Average Current

Average Current: 0.17 µA (micro-ampere)

Comparison:

  • ESP32 Deep Sleep: ~10 µA
  • ATmega328P Power-down: ~0.1 µA
  • TPL5110 Standby: Tens of nA

→ This system's sleep current is nearly perfect


Battery Life Calculation

Formulas

1. Average Current:
   I_avg = Q_cycle / T_cycle
 2. Battery Life:
   T_survive = C_bat / I_avg

Actual Calculation 

Input Values:

Q_cycle = 19.02 mC (charge per cycle)
T_cycle = 6min 15sec = 375 seconds
C_bat = 1,300 mAh × 4 banks = 5,200 mAh

ChatGPT Result:

Step 1: Average Current
I_avg = 19.02 mC / 375 sec
     = 0.0507 mC/s
     = 0.0507 mA
     = 50.7 µA
 Step 2: Battery Lifetime
T_survive = 5,200 mAh / 0.0507 mA
          = 102,564 hours
          = 4,273 days
          = 11.7 years

Conclusion: 12x AA batteries (4 banks) enable approximately 11.7 years of operation!


Practical Tips: Using NRF-PPK2

1. Measurement Mode Selection

Source Meter Mode (Power Supply + Measurement)

  • Voltage range: 0.8V ~ 5V
  • Max current: 1A
  • Advantage: No external battery needed

Ampere Meter Mode (Measurement Only)

  • External battery required
  • Voltage range: 0.8V ~ 5.5V
  • Advantage: Reflects actual battery characteristics

2. Window Setup (Charge Calculation)

PPK2 Software:
1. Start data collection
2. Mouse drag to select measurement range
3. Auto-calculation:
   - Average Current
   - Max Current
   - Total Charge (mC)

3. Important Considerations

Voltage Drop Check:

  • Initial battery voltage vs end-of-life voltage
  • Verify system minimum operating voltage

Environmental Variables:

  • Temperature: Battery capacity varies (drops sharply below 0°C)
  • Aging: Consider 20% capacity reduction in real operation

Circuit Design Reference

Underwater Measurement Module

ATmega328P (→ Switching to ATmega88)
    │
    ├─ I2C → MS5837 (Pressure/Temperature)
    ├─ UART → RS485 Transceiver (MAX485)
    └─ Power → 3xAA Series
 Critical: Epoxy molding inside PVC pipe required!

LoRa Transmission Module

ATmega324PA (2x Hardware UART)
    │
    ├─ I2C → MS5837 (Barometric pressure)
    ├─ UART1 → RS485 RX (underwater module)
    ├─ UART2 → LoRa Module (E-byte E32)
    └─ EN → TPL5110 Done Pin
 TPL5110 (Timer)
    │
    ├─ DRV → System Power MOSFET Gate
    ├─ DELAY → Resistor sets period (6min 15sec)
    └─ DONE ← ATmega completion signal

Final System Specifications

Power Consumption:

  • Wake-up: 19.02 mC (2 seconds)
  • Sleep: 0.17 µA
  • Average: 50.7 µA

Battery Life:

  • 12xAA (5,200mAh): 11.7 years
  • 18xAA (7,800mAh): 17.5 years

Communication Range:

  • LoRa 930MHz: ~1-3km (with obstacles)
  • MQTT via Ethernet: Unlimited (with internet)
Documents
Comments Write