%%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#2C3E50', 'primaryTextColor': '#fff', 'primaryBorderColor': '#2C3E50', 'lineColor': '#16A085', 'secondaryColor': '#E67E22', 'tertiaryColor': '#7F8C8D'}}}%%
stateDiagram-v2
[*] --> DeepSleep
DeepSleep --> LightSleep: Timer/Interrupt
LightSleep --> Active: Wake Complete
Active --> Sensing: Start Measurement
Sensing --> Processing: Data Ready
Processing --> Transmitting: Send Data
Transmitting --> LightSleep: TX Complete
LightSleep --> DeepSleep: Extended Idle
note right of DeepSleep: 1-100 µA
note right of LightSleep: 0.1-1 mA
note right of Active: 10-50 mA
note right of Sensing: 5-50 mA
note right of Processing: 20-80 mA
note right of Transmitting: 100-300 mA
1603 Power Consumption Analysis
1603.1 Learning Objectives
By the end of this chapter, you will be able to:
- Analyze power consumption across different device operating states
- Calculate average current for duty-cycled IoT devices
- Identify and quantify power consumption components
- Understand radio power states and their impact on energy consumption
- Create accurate power budgets for IoT system design
1603.2 Power Consumption Analysis
Understanding power consumption requires analyzing all device states and their duration. Most IoT devices cycle through multiple power modes:
1603.2.1 Power State Definitions
| State | Current Range | Wake Time | What’s Active |
|---|---|---|---|
| Deep Sleep | 1-100 µA | 100-500 µs | RTC only, RAM retained |
| Light Sleep | 0.1-1 mA | 10-100 µs | RTC + limited peripherals |
| Idle | 1-10 mA | Immediate | CPU idle, peripherals on |
| Active | 10-50 mA | N/A | CPU running, no radio |
| Sensing | 5-50 mA | N/A | Sensors powered and sampling |
| Processing | 20-80 mA | N/A | CPU compute-intensive |
| TX/RX | 100-300 mA | N/A | Radio transmitting/receiving |
1603.2.2 The Idle Power Myth: Radio Idle ≈ Radio Receive
Many developers assume a radio in “idle” mode consumes minimal power. This is FALSE for most wireless protocols:
| Protocol | TX Power | RX Power | Idle Power | Deep Sleep |
|---|---|---|---|---|
| Wi-Fi | 160-300 mA | 80-120 mA | 50-80 mA | 10-20 µA |
| BLE | 10-20 mA | 10-15 mA | 1-5 mA | <1 µA |
| LoRa | 40-120 mA | 10-15 mA | 1-5 mA | 0.2-1 µA |
| Zigbee | 15-30 mA | 15-25 mA | 1-5 mA | <1 µA |
Key insight: For Wi-Fi, idle mode (50-80 mA) is nearly as expensive as receiving (80-120 mA). The only way to save power is complete radio shutdown with deep sleep (10-20 µA).
For BLE and LoRa, idle is better than active but still consumes 1,000× more than deep sleep. Always completely disable radios when not in use.
1603.2.3 Average Current Calculation
For duty-cycled devices, average current determines battery life:
\[I_{avg} = \sum_{i=1}^{n} \frac{I_i \times T_i}{T_{total}}\]
Where:
- \(I_i\) = Current in state i
- \(T_i\) = Time in state i
- \(T_{total}\) = Total cycle time
Example: Environmental Sensor (1-hour cycle)
| State | Current | Duration | Energy (mAs) |
|---|---|---|---|
| Deep Sleep | 10 µA | 3595 s | 35.95 |
| Wake + Init | 20 mA | 0.5 s | 10 |
| Sensor Read | 5 mA | 2 s | 10 |
| Process Data | 30 mA | 0.5 s | 15 |
| Wi-Fi Connect | 160 mA | 1.5 s | 240 |
| Wi-Fi TX | 200 mA | 0.3 s | 60 |
| Wi-Fi Shutdown | 80 mA | 0.2 s | 16 |
| Total | 3600 s | 386.95 |
\[I_{avg} = \frac{386.95 \text{ mAs}}{3600 \text{ s}} = 0.107 \text{ mA} = 107 \text{ µA}\]
Battery life with 2000 mAh capacity:
\[Life = \frac{2000 \text{ mAh}}{0.107 \text{ mA}} = 18,692 \text{ hours} = 2.13 \text{ years}\]
1603.2.4 Radio Power States as Energy Multipliers
%%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#2C3E50', 'primaryTextColor': '#fff', 'primaryBorderColor': '#2C3E50', 'lineColor': '#16A085', 'secondaryColor': '#E67E22', 'tertiaryColor': '#7F8C8D'}}}%%
graph TB
subgraph Radio["Radio Power States (ESP32 Wi-Fi)"]
R1["TX (200 mA)<br/>20,000× deep sleep"]
R2["RX (100 mA)<br/>10,000× deep sleep"]
R3["Idle (70 mA)<br/>7,000× deep sleep"]
R4["Modem Sleep (20 mA)<br/>2,000× deep sleep"]
R5["Light Sleep (0.8 mA)<br/>80× deep sleep"]
R6["Deep Sleep (10 µA)<br/>Baseline"]
end
R1 --> R2
R2 --> R3
R3 --> R4
R4 --> R5
R5 --> R6
style R1 fill:#E74C3C,stroke:#2C3E50
style R2 fill:#E67E22,stroke:#2C3E50
style R3 fill:#F1C40F,stroke:#2C3E50
style R4 fill:#27AE60,stroke:#2C3E50
style R5 fill:#16A085,stroke:#2C3E50
style R6 fill:#2C3E50,stroke:#2C3E50
1603.2.5 Protocol Energy Comparison
Different protocols have vastly different energy costs per transmission:
| Protocol | Typical TX Time | TX Current | Energy per TX |
|---|---|---|---|
| BLE (1 packet) | 1-3 ms | 15 mA | 15-45 µJ |
| Zigbee | 5-10 ms | 20 mA | 100-200 µJ |
| LoRa SF7 | 50 ms | 40 mA | 2,000 µJ |
| LoRa SF12 | 1,500 ms | 40 mA | 60,000 µJ |
| Wi-Fi (short) | 100 ms | 180 mA | 18,000 µJ |
| Wi-Fi (incl. connect) | 3,000 ms | 160 mA | 480,000 µJ |
| LTE-M | 500 ms | 220 mA | 110,000 µJ |
| NB-IoT | 1,000 ms | 200 mA | 200,000 µJ |
Key observation: BLE is 100-1,000× more efficient than Wi-Fi per transmission. Choose protocols carefully based on range and data requirements.
1603.3 Power Budget Worked Examples
1603.3.1 Worked Example: Optimizing Power Budget for a Wildlife Tracking Collar
Scenario: You are designing a GPS tracking collar for deer monitoring in a wildlife research project. The collar must last 2 years on a single battery, transmit location every 4 hours, and weigh under 100g (including battery).
Given:
- GPS module: L96 (acquisition 26mA × 30s cold start, 22mA × 1s hot start)
- Radio: LoRa SX1276 (40mA TX @ +14dBm)
- MCU: STM32L4 (8mA active, 1µA deep sleep)
- Battery constraint: <50g → 2× CR2450 = 1,200 mAh total
- Transmission: 50-byte location packet every 4 hours
Steps:
Calculate GPS energy per acquisition:
Cold start (first fix after power cycle): E_cold = 26mA × 30s = 780 mAs = 0.217 mAh Hot start (subsequent fixes with ephemeris): E_hot = 22mA × 1s = 22 mAs = 0.006 mAh Average (assuming 1 cold start per day, 5 hot starts): E_gps_day = 780 + (5 × 22) = 890 mAs/day = 0.247 mAh/dayCalculate LoRa transmission energy:
TX time for 50 bytes @ SF7: 70ms E_tx = 40mA × 0.07s = 2.8 mAs per transmission 6 transmissions/day = 16.8 mAs/day = 0.0047 mAh/dayCalculate MCU energy:
Active time per cycle: 2s (wake, process, initiate GPS/radio) Active energy: 8mA × 2s × 6 = 96 mAs/day = 0.027 mAh/day Sleep time: 24h - (6 × 32s) = 86,208s Sleep energy: 1µA × 86,208s = 86.2 mAs/day = 0.024 mAh/dayTotal daily consumption:
GPS: 0.247 mAh/day LoRa: 0.005 mAh/day MCU Act: 0.027 mAh/day MCU Slp: 0.024 mAh/day Total: 0.303 mAh/dayCalculate battery life:
Theoretical: 1,200 mAh / 0.303 mAh/day = 3,960 days = 10.8 years With 70% efficiency factor: 3,960 × 0.7 = 2,772 days = 7.6 years
Result: The design significantly exceeds the 2-year requirement. This margin can be used to:
- Increase transmission frequency (every 2 hours → still 3.8 years)
- Add activity detection with accelerometer
- Use smaller/lighter battery (600 mAh still gives 3.8 years)
Key Insight: GPS acquisition dominates the power budget (82%). Optimizations should focus on keeping GPS in hot-start mode (preserve ephemeris data) or using A-GPS for faster acquisition.
1603.3.2 Worked Example: Comparing Protocol Energy Costs for a Smart Agriculture Sensor
Scenario: A soil moisture sensor transmits 100-byte readings every 30 minutes. Compare Wi-Fi, BLE, and LoRa for a 2-year battery life target.
Given:
- Sensor reading: 5mA × 0.5s = 2.5 mAs per reading
- MCU (nRF52840): 5.5mA active, 1.5µA deep sleep
- Processing: 10ms per reading
- Readings per day: 48
Protocol Comparison:
| Protocol | Connection Time | TX Time | Total Energy/TX |
|---|---|---|---|
| Wi-Fi | 3s @ 160mA = 480 mAs | 100ms @ 200mA = 20 mAs | 500 mAs |
| BLE | 0ms (advertising) | 5ms @ 15mA = 0.075 mAs | 0.075 mAs |
| LoRa SF7 | 0ms | 100ms @ 40mA = 4 mAs | 4 mAs |
Daily Energy Consumption:
| Component | Wi-Fi | BLE | LoRa |
|---|---|---|---|
| Radio (48 TX) | 24,000 mAs | 3.6 mAs | 192 mAs |
| Sensor | 120 mAs | 120 mAs | 120 mAs |
| MCU Active | 26.4 mAs | 26.4 mAs | 26.4 mAs |
| MCU Sleep | 130 mAs | 130 mAs | 130 mAs |
| Daily Total | 24,276 mAs | 280 mAs | 468 mAs |
Battery Life (2000 mAh @ 70% efficiency):
| Protocol | Daily (mAh) | Life (days) | Life (years) |
|---|---|---|---|
| Wi-Fi | 6.74 | 208 | 0.57 |
| BLE | 0.078 | 17,949 | 49.2 |
| LoRa | 0.130 | 10,769 | 29.5 |
Conclusion: Wi-Fi gives only 7 months of battery life, making it unsuitable without energy harvesting. BLE achieves 49 years (theoretical), allowing for smaller batteries or higher transmission rates. LoRa provides excellent range with 29 years life. For this application, BLE is optimal for short-range or LoRa for long-range.
1603.4 Real-World Example: Smart Agriculture Deployment
A practical deployment of 100 soil moisture sensors across a vineyard:
Initial Design Choices:
- ESP8266 with Wi-Fi (familiar technology)
- 4× AA batteries (6V, 2000mAh effective)
- Transmit every 15 minutes
Measured Power Profile:
| State | Current | Duration | Energy |
|---|---|---|---|
| Wi-Fi Connect | 160 mA | 5 s | 800 mAs |
| Wi-Fi TX | 200 mA | 0.5 s | 100 mAs |
| Idle (no sleep) | 15 mA | 894.5 s | 13,418 mAs |
| Per cycle | 900 s | 14,318 mAs |
Average current: 14,318 / 900 = 15.9 mA
Battery life: 2000 mAh / 15.9 mA = 126 hours = 5 days
Problem: Sensors died after one week. Replacement labor cost: 100 sensors × 30 min × $20/hr = $1,000 per cycle = $52,000/year
1603.4.1 Optimized Redesign
Changes Made:
- ESP32 with deep sleep (10 µA vs 15 mA idle)
- LoRa radio (40 mA TX, no connection overhead)
- Transmit every 30 minutes (reduced from 15)
- Static network configuration
Optimized Power Profile:
| State | Current | Duration | Energy |
|---|---|---|---|
| Wake | 20 mA | 0.1 s | 2 mAs |
| Sensor Read | 5 mA | 0.5 s | 2.5 mAs |
| LoRa TX | 40 mA | 0.1 s | 4 mAs |
| Deep Sleep | 10 µA | 1799.3 s | 18 mAs |
| Per cycle | 1800 s | 26.5 mAs |
Average current: 26.5 / 1800 = 0.0147 mA = 14.7 µA
Battery life: 2000 mAh / 0.0147 mA = 136,054 hours = 15.5 years
Result: Battery life improved from 5 days to 15+ years—a 1,000× improvement.
1603.5 Common Power Budget Mistakes
1. Ignoring Radio Idle Current
WRONG: "Radio off = 0 mA"
RIGHT: Check datasheet - many radios have 50-80 mA idle current!
2. Underestimating Wi-Fi Connection Time
WRONG: "Wi-Fi TX takes 100ms"
RIGHT: Connection + negotiation + TX can take 2-10 seconds
3. Forgetting Pull-up Resistors
10kΩ pull-up at 3.3V = 330 µA CONTINUOUS
This alone consumes 3× more than ESP32 deep sleep!
4. Assuming Datasheet Sleep Current
Datasheet: "10 µA deep sleep"
Reality: Add peripherals, pull-ups, LEDs = 100+ µA
ALWAYS MEASURE on actual hardware!
5. Ignoring Voltage Regulator Quiescent Current
LDO quiescent: 30-100 µA typical
Can exceed MCU deep sleep current!
Choose low-IQ regulators for battery designs.
6. Not Accounting for Peak Currents
Battery voltage drops under load
Brown-out resets cause device failure
Solution: Add bulk capacitor or choose battery with low ESR
1603.6 Power Budget Calculator
Use this interactive calculator to estimate your device’s battery life:
1603.6.1 Understanding the Calculation
The calculator uses the duty cycle formula:
\[I_{avg} = \frac{I_{active} \times T_{active} + I_{sleep} \times T_{sleep}}{T_{total}}\]
And battery life formula with efficiency factor:
\[Life = \frac{Capacity \times Efficiency}{I_{avg}}\]
The efficiency factor (default 0.7) accounts for:
- Temperature effects on battery capacity
- Voltage cutoff (can’t use full capacity)
- Self-discharge over deployment lifetime
- Battery aging/degradation
- Non-ideal DC-DC converter efficiency
1603.7 Knowledge Check
Question 1: Your ESP32 IoT device shows these measured currents: Active (Wi-Fi TX) = 120mA for 5s every 15 minutes, Idle (no sleep) = 80mA rest of time. What optimization provides the GREATEST battery life improvement?
Current calculation: I_avg = (120×5 + 80×895)/900 = 80.2mA with idle. With deep sleep: I_avg = (120×5 + 0.01×895)/900 = 0.678mA. That’s a 118× reduction! The idle current at 80mA for 99.4% of the time completely dominates the power budget. Deep sleep reduces this by ~8,000×, making it by far the most impactful single change.
Question 2: A 10kΩ pull-up resistor at 3.3V on an unused GPIO pin continuously draws current. What is the current draw, and why is it a problem?
Using Ohm’s law: I = V/R = 3.3V / 10,000Ω = 330µA. For a device targeting 55µA average (5-year battery life), this single pull-up exceeds the entire power budget by 6×! This continuous draw never sleeps, negating all other optimizations. Fix: configure unused pins as outputs or use higher resistance (100kΩ) where timing permits.
1603.8 Summary
Key takeaways from power consumption analysis:
- Sleep Dominates: For duty-cycled devices, sleep current × time often exceeds active consumption
- Radio Idle is Expensive: Radio idle mode can consume 1,000-10,000× more than deep sleep
- Calculate Average Current: Use the duty cycle formula to determine realistic battery life
- Watch for Hidden Drains: Pull-ups, LEDs, debug interfaces, and regulators all consume power
- Measure Real Hardware: Datasheet values are best-case; always measure actual consumption
1603.9 What’s Next
Continue to Energy Cost of Common Operations to understand how individual operations contribute to energy consumption.