LECTURE 04

Energy Consumption in Embedded Systems

Duration: 120 min of teaching Level: undergraduate, year III - recommended after Lecture 03 Course: Embedded Systems Associated laboratory: Laboratory 01 PDF: download the notes RO versiunea română

For most embedded systems, the energy available - not the speed of the processor - is the resource that decides whether the project works or not. This lecture gathers the minimum mathematical tools for thinking rigorously about consumption: power, energy and electric charge, the energy profile of a real system, the metrics suited to each type of device, estimating autonomy on a battery, the components of CMOS consumption and the hardware and software techniques that reduce them.

1The subject and structure of the lecture6 min

Lectures 2 and 3 explained what a processor looks like and how its performance is measured. Today we change the axis of analysis: instead of "how fast", we ask "at what energy cost" - the central question for any battery-powered system, from an agricultural sensor to a pacemaker.

Recap of the previous lectures
  • Low energy consumption is one of the four fundamental characteristics of embedded systems (Lecture 01)
  • A higher frequency does not automatically mean "better" - the performance equation shows the trade-off (Lecture 02)
  • The operating modes and the interrupt mechanism of the ARM architecture are exactly the tools on which the low-power techniques discussed today are built (Lecture 03)

Learning outcomes

  • To distinguish correctly between power, energy and electric charge, with their units
  • To read the energy profile of a periodic system and compute the average power
  • To choose the right metric (per operation, per bit, per packet) for a given system
  • To estimate the autonomy of a battery-powered device, starting from a consumption profile
  • To explain the components of CMOS power and the effect of voltage/frequency scaling (DVFS)
  • To recognize the hardware and software techniques for reducing consumption and their limits

2Energy constraints and design objectives8 min

Numerous embedded systems - IoT nodes in places that are hard to reach, portable or implantable medical devices, industrial sensors - must work for years with no human intervention. For these, the energy available directly limits operation, so consumption must be treated as a design requirement from the first stages, not as a last-minute optimization.

Four factors tie the design decision, in practice, to concrete constraints:

  1. Autonomy - the indicator perceived directly by the user. A sensor that needs a new battery every month may cost more in maintenance than it is worth; an autonomy of 5-10 years makes the same solution economically viable.
  2. Thermal limits - the power drawn turns into heat, and a high temperature reduces the lifetime of the components and may force the processor to reduce its frequency. Compact embedded systems, with no fan, have to control the temperature through low consumption and passive dissipation.
  3. Reliability and maintenance - lower consumption means less thermal stress and fewer charging cycles, hence rarer maintenance - essential when thousands of nodes of a network would require individual attention.
  4. Impact at large scale - a negligible saving on a single device becomes important multiplied by millions of units: operating costs, cooling requirements, batteries produced and replaced. Energy efficiency is at once a technical, an economic and an ecological objective.
To remember Energy optimization does not mean merely choosing the component with the lowest instantaneous consumption, but analysing the whole operating profile. Raising the frequency reduces the execution time, but raises the power - the net effect on total energy depends on the duration, the voltage and how quickly the system can get back into a low-power mode. We return to exactly this computation in the section on DVFS.

3Power, energy and electric charge10 min

Energy analysis demands that we clearly distinguish three quantities often used, incorrectly, as synonyms.

QuantitySymbolUnitMeaning
VoltageVvolt (V)the potential difference applied to the circuit
CurrentIampere (A)the rate of transfer of electric charge
Electric chargeQcoulomb (C); Ahthe total quantity of charge transferred
PowerPwatt (W)the rate at which energy is consumed/transferred
EnergyEjoule (J); Whthe total quantity consumed or stored
The fundamental relations
P = V · I (instantaneous power)
E = P · T (energy, at constant power; in general, the integral of power over time)
Q = I · T (charge, at constant current)
E ≈ V · Q (nominal energy, from voltage and charge)
Example - why mAh is not the same unit as energy

Two 2000 mAh batteries (the same charge, Q = 2 Ah): a NiMH battery at 1.2 V stores E ≈ 1.2 × 2 = 2.4 Wh; a Li-Ion battery at 3.7 V stores E ≈ 3.7 × 2 = 7.4 Wh - more than three times as much energy, although the capacity in Ah is identical. Capacity in Ah describes charge, not energy - the voltage matters too.

A useful convention to remember: 1 Wh = 3600 J and 1 mAh = 3.6 C. A 10 Wh battery can ideally give 1 W for 10 hours, or 10 W for one hour - the total energy stays the same, only the rate of consumption differs.

Instantaneous power vs. total energy

A microcontroller at 3.3 V drawing 12 mA in active mode has a power of P = 3.3 × 0.012 = 39.6 mW - an instantaneous value, which says nothing about autonomy until we know how long it stays in that regime. A radio module consuming 100 mW for 10 seconds has used E = 0.1 × 10 = 1 J ≈ 0.278 mWh - energy always depends on duration, not merely on peak power.

4The energy profile of an embedded system10 min

The consumption of an embedded system is not, in general, constant - the processor, the sensors and the communication interfaces are activated only when needed. An energy profile describes this variation of power/current over time and allows the states that dominate the total consumption to be identified.

Sleep Wake-up Measurement Processing Transmission Sleep (the rest of the cycle) consumption peak low consumption
Fig. 1 - The simplified energy profile of an IoT node that wakes up periodically, measures, processes and transmits a packet, then goes back to sleep.
The duty cycle
D = t_active / T. For a system with two states: P_average = D · P_active + (1 - D) · P_sleep
A worked exercise

A device operates periodically, with a period of 1 second: 8 mA for 20 ms, then 10 µA for the remaining 980 ms. What is the average current, and why is it so small compared with 8 mA?

See the solution

I_average = (8 mA × 0.020 s + 0.010 mA × 0.980 s) / 1 s = 0.1698 mA ≈ 169.8 µA

At 3.3 V, the average power is P_average = 3.3 × 0.1698 mA ≈ 0.560 mW. Although the active current is 8 mA, the average is far lower thanks to a duty cycle of only 2% - a system can have large current peaks and still have good autonomy, if it spends the rest of the time in deep rest.

Careful Reducing the duty cycle does not automatically guarantee a reduction in energy: starting the oscillators, initializing the sensors and stabilizing the communication have a fixed cost. If the system wakes up too often, the energy of the transitions becomes significant in itself - we return to this trade-off when we deal with the low-power modes.
The energy profile of a measurement cycle: put the phases in order

5Energy metrics and estimating autonomy12 min

One measurement cycle, phase by phase

There is no single metric suited to every embedded system - the choice depends on the function of the device.

MetricRelationUse
Average powerP_average = E / Testimating autonomy
Peak powerP_max = max P(t)sizing the supply/converter
Energy per cycleE_cycle = Σ Pᵢtᵢperiodic systems, IoT nodes
Energy per operationE_op = E_total / N_opcomparing processors/algorithms
Energy per bitE_bit = E_total / N_bitcomparing communication technologies

A frequently used combined metric is the energy-delay product: EDP = E × T_execution - a low value indicates a favourable compromise, but EDP is not universal: a device running for years on a battery may prioritize pure energy, while a real-time control system may strictly prioritize meeting the deadline, whatever the EDP.

Estimating autonomy

Ideal vs. estimated autonomy
T_ideal = E_nominal / P_average (assumes 100% of the energy is usable, with no losses)
T_estimated = E_nominal × k_usage × η_supply × ... / P_average (more realistic, with efficiency and usage factors)
The battery autonomy calculator
A completely worked exercise

The device of the previous section (8 mA/20 ms active, 10 µA/980 ms sleep, 3.3 V), with a Li-Ion 3.7 V / 2000 mAh battery, a converter efficiency of 90%, usable energy 80%. What is the estimated autonomy?

See the solution

E_nominal = 3.7 V × 2 Ah = 7.4 Wh

E_usable = 7.4 × 0.8 × 0.9 = 5.328 Wh

T_estimated = 5.328 Wh / 0.560 mW ≈ 9514 h ≈ 396 days

The result does not include the self-discharge of the battery, the consumption of the protection circuits or the reduction of capacity at low temperatures - the real autonomy measured will almost always be lower than the one computed. Check with the widget above how the autonomy changes if you raise the sleep current from 10 to 50 µA - a difference that looks small, but matters enormously in the long run.

To remember For systems that must run for years, the quiescent current of the regulator and the self-discharge of the battery can become comparable with the consumption of the microcontroller itself - a large battery does not guarantee a long autonomy if the rest of the supply chain consumes permanently. Theoretical computations must always be validated by real measurements, over a representative cycle.

6The main consumers and CMOS power12 min

Before discussing techniques for reducing consumption, we have to know where the consumption of a processor comes from. Most modern microcontrollers are made in CMOS technology, and their total consumption divides into four components:

Total CMOS power
P_total = P_dynamic + P_short-circuit + P_static + P_analogue
ComponentSourceDominates in...
Dynamiccharging/discharging the internal capacitances on switchingthe active regime
Short-circuitbrief simultaneous conduction, during the logic transitionusually minor
Staticleakage currents, even with no switchingprolonged rest
Analogueoscillators, PLL, ADC, references, regulatorsdepends on which domain is active
Do not forget the "invisible" blocks

An "inactive" microcontroller may still consume if the main oscillator, the PLL loop, the ADC reference, the brown-out detector, the watchdog, the SRAM or the debug interfaces remain active. A genuinely minimal consumption requires analysing every functional domain, not just the CPU core - a frequent source of unpleasant surprises when the real consumption is measured.

The main consumers of energy in a typical embedded system, in approximate order: the processor (above all in sustained active regimes), the memory (repeated Flash/RAM accesses), the analogue peripherals (ADC, comparators), and - often the largest consumer of all - the wireless communication interface, the subject of a dedicated section below.

CMOS dynamic power: P = a C V^2 f

7Dynamic power, static power and DVFS10 min

Dynamic power
P_dynamic ≈ α · C_eff · V² · f, where α = the activity factor, C_eff = the equivalent switched capacitance, V = the voltage, f = the frequency.

The relation shows something essential: dynamic power varies linearly with frequency, but quadratically with voltage. Reducing the voltage brings far greater savings than reducing the frequency, at the same activity.

Explore voltage/frequency scaling (DVFS)
A worked exercise - where the real DVFS savings come from

A processor carries out the same work in two configurations: (1) V=1.2 V, f=100 MHz; (2) V=0.9 V, f=70 MHz. How do the power, the execution time and the total energy change?

See the solution

P₂/P₁ = (0.9/1.2)² × (70/100) = 0.5625 × 0.7 ≈ 0.394 - the power falls by ~60.6%.

T₂/T₁ = 100/70 ≈ 1.43 - the execution time grows by 43%, because we are working more slowly.

E₂/E₁ = 0.394 × 1.43 ≈ 0.563 - the total energy falls by ~43.8%.

The central observation: at a fixed number of cycles and constant voltage, reducing the frequency alone leaves the dynamic energy almost unchanged (the time grows by exactly as much as the power falls). The real savings come from lowering the voltage - which is why DVFS always scales the voltage and the frequency together, not one separately from the other.

Static power
P_static = V · I_leakage - leakage currents present even with no switching, dependent on the technology, the temperature and the internal state of the circuit.

A higher temperature increases the leakage, which increases the power (hence the temperature) - a positive feedback which, in modern manufacturing technologies, can make static power an important part of the total consumption, above all in modes with reduced switching activity.

8Hardware techniques for reducing consumption10 min

Hardware techniques aim to reduce the voltage, the switching activity, the active capacitance or the leakage currents - applicable at the level of the processor, of the peripherals or of the whole system.

TechniqueThe component reducedAdvantageLimitation
DVFSdynamic powerlarge savings from lowering the voltagelower performance, transition cost
Clock gatingswitching activityfast wake-up, preserves the statedoes not eliminate static power
Power gatingdynamic and static powervery low consumption of the block switched offloss of state, reactivation latency
Independent domainsselective consumption of the subsystemsswitching off only the unused blocksadditional hardware complexity
Hardware acceleratorsenergy per unit of workfast, specialized executionreduced flexibility, additional area
DMA and local memoriesthe transfers and the CPU activityfewer wake-ups and external accessesconfiguration cost
Clock gating Stops the clock signal for unused blocks. The registers keep their state (they do not switch), but stay powered - the leakage currents continue to exist. Suited to peripherals that have to be reactivated quickly (a timer, SPI).
Power gating Disconnects the supply of a block entirely - it reduces the static power as well, not merely the dynamic one. The price: the internal state is lost (without dedicated retention registers), and coming back requires re-powering, stabilization and reinitialization - greater latency and transition cost.

Software complements the hardware techniques through: energy profiling of the code (in order to identify the sections that dominate consumption), algorithms that minimize accesses to external memory (slower and more energy-costly than registers or on-chip memory), grouping operations so as to allow longer periods of rest between them, and explicit use of the power-management APIs offered by the manufacturer of the microcontroller or by the RTOS in order to choose correctly the low-power mode suited to each pause in the execution.

9The low-power modes10 min

Modern processors offer several energy states. The names differ between manufacturers, but the principle is common: the lower the consumption, the less of the context is kept alive, and the greater the latency of coming back.

StateActive elementsPreservation of the contextWake-up latency
ActiveCPU, memories, selected peripheralscompleteno wake-up needed
Idlememory + most peripheralscompletevery low
Sleepselected domains and wake-up sourcesusually completelow/medium
Deep Sleepminimal domain + retention memorypartial/completemedium/high
Standby/Shutdownminimal wake-up logiclimitedhigh; possibly a reset

The possible wake-up sources differ on every platform: a real-time timer, an external pin, a watchdog, a low-power comparator, a communication interface, a sensor event. If the wake-up requires a peripheral to be kept active, the consumption of the resting state grows - the designer has to identify the minimum mechanism needed for each application.

The break-even time of a transition Entering and leaving a low-power mode themselves require energy (restarting the oscillators, stabilizing the voltage, possible reinitialization). A "deep" mode is advantageous only if the time spent in it exceeds a certain threshold - for very short pauses, the transition into and out of Deep Sleep may consume more energy than Idle mode would have saved, being less deep but far quicker to enter and leave.
Match the power state with the right scenario

10The energy cost of wireless communication10 min

Wireless communication allows data to be transmitted without a physical connection, but introduces an energy cost that can dominate the whole budget of an IoT node. A radio transceiver does not consume energy only when transmitting: switching on the oscillators, synthesizing the carrier frequency, amplifying the signal and processing the protocol cost energy even during reception - reception may have a consumption comparable with transmission.

The energy of a communication
E_radio = E_start-up + E_listening + E_transmission + E_reception + E_protocol + E_retransmissions

A typical transceiver has several states: shutdown (minimum consumption, complete reinitialization on waking), sleep (some settings preserved, faster return), standby (oscillators already active, fast transition to RX/TX), reception and transmission. Contrary to intuition, continuously listening to the channel may be more costly than periodically transmitting short packets.

Why the size and the number of packets matter

The energy of a packet: E_packet = E_fixed + P_TX × T_packet, where E_fixed includes switching on and stabilizing the transceiver. For short messages, this fixed energy may dominate the total cost entirely - which is why grouping several measurements into a single packet (instead of one packet per measurement) reduces consumption significantly, even if each grouped packet is a little longer.

Example - the cost of retransmissions

If the probability of a packet being delivered successfully is p, the average number of attempts is 1/p, and the average energy needed for delivery is E_delivery = E_attempt / p. For p = 0.5 (half the packets are lost), two attempts are needed on average - the energy doubles compared with a lossless link. A poor radio link does not merely delay the system, it also makes it consume visibly more energy.

There is no wireless technology that offers at the same time maximum range, maximum throughput, minimum latency and minimum consumption - the choice (BLE, Wi-Fi, LoRaWAN, Zigbee and so on) is always a compromise along those four axes, according to the requirements of the application.

11Local processing versus transmitting the data4 min

A design decision with a direct energy impact: do we process the data locally (on the device) or send it raw to a server? The practical rule: if the energy needed to transmit the raw data exceeds the energy needed to process it locally in order to extract only the relevant information, local processing (Edge Computing, discussed conceptually in Lecture 01) wins outright.

A conceptual example

A vibration sensor can send 1000 raw samples per second (costly on the radio), or it can run locally a simple algorithm that detects only the anomalies and sends a single "alert/no alert" bit every few minutes. The second variant demands more computing energy, but far less transmission energy - and the radio is almost always the dominant consumer.

12Frequent mistakes5 min

  • "The capacity of the battery in mAh tells me everything I need to know about the energy available." False - mAh is a quantity of charge, not of energy. The same capacity at different voltages means completely different energies (see the NiMH vs. Li-Ion example). Always convert to watt-hours (Wh) before comparing two batteries.
  • "If I reduce the frequency of the processor, I automatically reduce the energy consumed." False, or at least incomplete - at constant voltage, reducing the frequency reduces the power, but increases the execution time proportionally, and the dynamic energy stays almost unchanged. The real savings come from reducing the voltage, not merely the frequency. Check whether the technique applied (full DVFS, or only frequency scaling) really reduces the energy, not merely the instantaneous power.
  • "An ultra-low-power mode (Deep Sleep) is always the best choice." Not if the pauses are very short - the energy cost of the transition may exceed the saving, and the long wake-up latency may cause important events to be missed. Choose the low-power mode on the basis of the typical duration of the pause, not merely of the nominal consumption of the state.

13Summary and glossary5 min

Energy, power and electric charge are distinct quantities, with different units - confusing them leads directly to wrong estimates of autonomy. The energy profile of a periodic system, combined with the duty cycle, allows the real average power to be computed, often very different from the peak power. CMOS consumption divides into dynamic power (∝V²f) and static power, and DVFS exploits exactly the quadratic dependence on voltage. The hardware techniques (clock/power gating, independent domains) and the software ones (profiling, grouping operations, correctly chosen power modes) work together, not in isolation. And for connected systems, wireless communication is often the dominant consumer - which is why local processing and packet grouping matter so much.

Duty cycle (D)
the fraction of the period in which the system is active.
DVFS
Dynamic Voltage and Frequency Scaling - voltage/frequency scaling.
Clock gating
stopping the clock of an unused block, without unpowering it.
Power gating
disconnecting the supply of a block entirely.
EDP
Energy-Delay Product - a combined metric, energy × execution time.
E_bit
the average energy consumed for transmitting one bit.
Edge Computing
local processing, in order to reduce the data that must be transmitted.

14Self-check questions6 min

  1. What is the difference between power, energy and electric charge? What units do they have?
  2. What is the duty cycle and how does it influence the average power?
  3. Why does reducing only the frequency of the processor not automatically reduce the dynamic energy?
  4. What are the components of the total CMOS power?
  5. List three hardware techniques for reducing consumption and the limitation of each.
  6. Why can continuously listening to a radio channel cost more than transmitting?
  7. A device has P_average = 2 mW and a 3 Wh battery. What is the ideal autonomy?

15Where to go next2 min

The next lecture continues directly along this thread: now that we understand where the consumption comes from and how it is computed, we move on to concrete software techniques of energy optimization - algorithms, data structures and programming patterns that reduce consumption measurably, not merely theoretically.

All the concepts of this lecture (energy profile, duty cycle, DVFS, battery autonomy) are applied directly in Laboratory 01 and Laboratory 02, where you measure them on real hardware - a Raspberry Pi 5 and an ESP32-C6 node.