Hardware & Firmware

Low-Power Design from Schematic to Firmware

Battery life is decided in many small places: a pull-up left powered, a regulator with high quiescent current, a timer that wakes the processor too often. This note works from the energy budget through schematic and firmware to measurement.

The numbers below are worked examples with stated assumptions. Use datasheet maximums and your own measurements for real designs.

Start with an energy budget

List every state, its current and how long the product spends there.

State (example)CurrentTime per dayCharge per day
Deep sleep8 µAabout 24 h0.192 mAh
Sensor sampling, every minute3 mA1440 × 20 ms = 28.8 s0.024 mAh
Radio report, every 15 minutes12 mA96 × 500 ms = 48 s0.160 mAh
Total0.376 mAh

A nominal 220 mAh cell would suggest about 585 days. Do not promise that. Usable capacity falls with load pulses, cold, cutoff voltage and age, and self-discharge and regulator losses must be included. The budget's real value is showing where to work: here sleep and radio dominate, and sampling barely matters.

Power tree and regulators

  • Quiescent current of regulators, supervisors and chargers runs all the time. Compare it with the sleep budget.
  • Light-load efficiency matters more than peak efficiency. Check the converter's behavior at microamps, and the ripple of its power-save mode on sensors and radio.
  • LDO or buck: an LDO is quiet and simple but wastes the voltage difference; a buck saves energy at the cost of components and noise.
  • Load switches remove power from blocks with poor sleep modes. Check their leakage, inrush and discharge behavior.
  • Battery peaks: coin cells have high internal resistance. Size bulk capacitance for transmit bursts, and count that capacitor's leakage.

Schematic leaks to hunt

LeakWhy it happensRemedy
Back-poweringA signal drives an unpowered chip through its protection diodesSet lines low or high impedance before switching off; isolate if needed
Pull resistorsA 10 kΩ pull-up held low at 3.3 V draws 330 µARaise the value, choose idle polarity, or switch it
Voltage dividersBattery sense divider conducts continuouslyGate it, or use high values with a buffer capacitor
Floating inputsInput stages draw current near mid-levelDefine every pin state
Indicator LEDsAlways onPulse briefly or remove
Debug connectionsProbe or UART bridge keeps domains activeMeasure with them disconnected

Design in measurement: series jumpers or sense resistors on each major rail make the guilty block findable. Add these to your PCB design checklist.

Firmware: sleep by default

  • Be event driven. Replace polling and busy waits with interrupts, DMA and hardware timers.
  • Let peripherals work while the core sleeps, using FIFOs and sensor-side buffering.
  • Coalesce timers so one wake does several jobs.
  • Use the RTOS tickless idle, then find what keeps blocking the deepest state.
  • Choose sleep depth by break-even: deeper states cost more energy and time to leave.
  • Gate unused clocks, and run work at the frequency and voltage that minimize energy, not just current.
for (;;) {
    wait_for_event();          /* deepest allowed sleep   */
    sensors_power(ON);
    sample_with_dma();         /* core sleeps meanwhile   */
    sensors_pins_safe();       /* avoid back-powering     */
    sensors_power(OFF);
    if (report_due())
        radio_send_batched();  /* fewer, fuller bursts    */
}

See RTOS versus bare metal and MCU selection for battery IoT.

Radio and data

  • Send less, less often: filter and aggregate on the device.
  • Tune advertising, connection or paging intervals to the real latency need.
  • Cache connection information and bound scans.
  • Back off when the network is unreachable; retry loops are a classic battery killer.

For cellular specifics, read LTE-M, NB-IoT and Cat 1 bis.

Measure, then keep measuring

  • Use a power analyzer with enough dynamic range and bandwidth to capture both microamps and bursts; a multimeter averages away the events and can drop voltage across its shunt.
  • Mark firmware states on spare GPIOs and align them with the current trace.
  • Test across temperature, battery voltage and weak signal, on several units.
  • Add a current regression check to release testing so a new feature cannot silently halve battery life.

More on method in firmware power profiling.

Review order

  1. Sleep floor: remove blocks until the measured current is explained.
  2. Wake frequency: find every source.
  3. Active duration: shorten each wake.
  4. Radio behavior in good and bad coverage.
  5. Battery behavior under real peaks and temperature.

Common questions

Can firmware alone fix a power problem?

Sometimes. Wake frequency and sleep modes are firmware matters, but leakage paths, regulator choice and unswitched loads often need a board change.

When should power be budgeted?

Before the schematic. The budget influences battery, regulators, MCU, sensors and radio.

Why does measured battery life differ from the calculation?

Usual reasons include weak radio signal, temperature, battery usable capacity, peak current, self-discharge and states the budget left out.

Can you review an existing design?

That is a common starting point: measure current by state, compare with a budget and rank the gaps by saving and cost of change.

Let's build

Battery life falling short? Tell us your target and what you measure today.