Why power decides the design

A server gets as much power as it asks for. An IoT device often does not. A sensor in a garden, on a pipe or in a meter cupboard may have no socket nearby, and replacing batteries in hundreds of devices costs more than the devices themselves. So the first design question for many devices is not "which chip?" but "where does the energy come from, and how long must it last?"

There are three answers. Mains or a fixed supply: power is not the problem, heat and safety are. Batteries: every microampere counts, and the device must sleep almost all the time. Harvesting: the device collects its own energy from light, heat or movement and must survive the times when there is none.

Lotte Kortenhoeve, a Kestrel Energy customer in Utrecht, has both kinds at home. Her P1 reader, an ESP32 board on her smart meter, takes its power from the meter's P1 port and can stay awake all the time. The temperature sensor she wants in her garden shed has no power at all and must live on a battery. This page works through both.

Supply voltages and regulators

Chips need one exact voltage. The ESP32, the Raspberry Pi Pico and the Raspberry Pi's GPIO pins all work at 3.3 V; classic Arduino boards at 5 V. Power sources rarely match: USB and the P1 port deliver 5 V, a lithium-ion cell anywhere from about 4.2 V when full to around 3 V when empty, two AA cells 3 V falling to about 2 V.

A voltage regulator is the circuit that turns such an input into a steady output voltage, whatever the input does within its range and however much current the load draws. Two kinds are common:

  • Linear regulators lower the voltage by acting as an adjustable resistor. They are cheap, small and electrically quiet, but the difference between input and output voltage, multiplied by the current, becomes heat.
  • Switching regulators (buck converters to lower the voltage, boost converters to raise it) switch the input on and off very fast and smooth the result with a coil and capacitors. They waste much less energy, especially when the voltage difference is large, but are more complex and add electrical noise.

Low-dropout regulators

A low-dropout regulator (LDO) is a linear regulator that keeps working when the input is only slightly above the output. The minimum difference it needs is its dropout voltage, given in its data sheet: the input must be at least the output voltage plus the dropout. Below that, the output follows the input down and the device may reset or behave strangely.

Most ESP32 development boards have an LDO that makes 3.3 V from the 5 V of the USB port. The example shows what that costs at a load of 100 mA, and when an LDO fed by a lithium-ion cell stops regulating (the dropout of 0.2 V is an assumed value; real parts differ):

V_IN, V_OUT, CURRENT_A = 5.0, 3.3, 0.100   # P1 or USB 5 V in, 3.3 V out, 100 mA load

heat_w = (V_IN - V_OUT) * CURRENT_A         # a linear regulator burns the difference
delivered_w = V_OUT * CURRENT_A
print(f"delivered to the board: {delivered_w:.2f} W")
print(f"turned into heat:       {heat_w:.2f} W")
print(f"efficiency:             {V_OUT / V_IN:.0%}")

DROPOUT_V = 0.2                              # assumed; read it from the LDO's datasheet
print(f"lowest input that still gives 3.3 V: {V_OUT + DROPOUT_V:.1f} V")
for cell_v in (4.2, 3.7, 3.6, 3.4):          # a Li-ion cell as it discharges
    ok = "regulates" if cell_v >= V_OUT + DROPOUT_V else "drops out"
    print(f"  cell at {cell_v:.1f} V: {ok}")
delivered to the board: 0.33 W
turned into heat:       0.17 W
efficiency:             66%
lowest input that still gives 3.3 V: 3.5 V
  cell at 4.2 V: regulates
  cell at 3.7 V: regulates
  cell at 3.6 V: regulates
  cell at 3.4 V: drops out

A third of the power heats the regulator. For a device on USB that is acceptable; on a battery, it is a third of the battery. That is why battery-powered designs either pick a source whose voltage is close to the output, or use a switching regulator.

The power path of a typical ESP32 development board. 5 volts from the P1 port or USB goes into a low-dropout regulator, which supplies 3.3 volts to the ESP32 module. The regulator turns the voltage difference times the current into heat, 0.17 watt at 100 milliamperes. Other parts on the board, such as the USB-to-serial chip and a power LED, also draw current, also while the ESP32 sleeps. P1 port or USB 5 V LDO regulator quiescent current 3.3 V ESP32 module sleeps at µA heat: (5 − 3.3 V) × 0.1 A = 0.17 W USB chip, LED: always on
On a development board, the regulator and the other parts draw current even when the ESP32 itself sleeps.

Power from USB and the P1 port

A USB 2.0 port supplies 5 V and up to 500 mA, more with USB-C (see USB power). The P1 port of a Dutch smart meter also supplies 5 V: under DSMR 5.0.2 at most 250 mA continuously, under the older DSMR 4.2.2 at most 100 mA. A Wi-Fi radio draws short peaks of current when it transmits, so whether a reader can live on the P1 port depends on the module's peak current (in its data sheet) and on the meter version; many designs add a capacitor that supplies the peaks. Under DSMR 5.0.2, the energy a device draws from the P1 port is not counted in the meter's registers. Pin-out and details are on Smart Meters and the P1 Port.

Kestrel Energy's Kestrel Home pilot, which started in September 2026, faced exactly this choice for its own-brand P1 dongle, a small ESP32-C3 board: on DSMR 5 meters it runs from the P1 port; for households with an older DSMR 4 meter, the pilot supplies a USB power adapter.

Battery capacity

Battery capacity is the amount of charge a battery delivers from full to a stated cut-off voltage, given in milliampere-hours (mAh): 2,000 mAh means 2 mA for 1,000 hours or 200 mA for 10 hours, in theory. Capacity alone does not say how much energy is stored; for that you also need the voltage. The conversion to watt-hours is on Laptops and Mobile Devices: Wh = mAh × V / 1000.

Battery Nominal voltage Typical capacity Notes
CR2032 lithium coin cell 3.0 V about 225–235 mAh (to 2.0 V) self-discharge about 1% per year; made for small currents
AA alkaline 1.5 V roughly 2,000–3,000 mAh capacity falls sharply under heavy load and in the cold
Lithium-ion cell (such as an 18650) about 3.6 V a few thousand mAh rechargeable; 4.2 V full; needs protection and a proper charger

The label is a best case. Real capacity depends on:

  • The load. A battery gives less of its charge at high current. A coin cell is meant for microamperes and short, small peaks; a Wi-Fi transmission is far beyond what it is made for.
  • Temperature. Cold reduces the available capacity, sometimes dramatically, which matters for a sensor in an unheated shed in January.
  • The cut-off voltage. The device stops working when the voltage falls below what its regulator needs, which may be well before the battery is "empty" by the label's definition.
  • Self-discharge and age. A battery loses charge on the shelf and in the device. Over a five-year design life, that adds up.

See Lithium-ion batteries for charging, swelling and safe handling of rechargeable cells.

Sleep modes

A microcontroller that runs its processor and radio continuously draws tens of milliamperes or more; a 2,000 mAh battery would last days. The way out is to switch almost everything off between measurements. Microcontrollers offer several sleep modes, each switching off more of the chip.

In deep sleep the processor, the radio and most of the memory are powered down, and only a small always-on part keeps running: a real-time clock timer that wakes the chip, and a little memory that survives. The figures for the original ESP32, from its data sheet:

ESP32 mode (chip only) What still runs Current
Light sleep processor paused, memory kept; wakes quickly where it stopped 0.8 mA
Deep sleep, ultra-low-power coprocessor on a tiny coprocessor that can read sensors 150 µA
Deep sleep, RTC timer and RTC memory wake-up timer and a small memory 10 µA
Hibernation wake-up timer only 5 µA
Power off nothing; the chip-enable pin is held low 1 µA

Newer family members do better in deep sleep: the data sheets give 7 µA for the ESP32-S3 and 5 µA for the ESP32-C3. Waking from deep sleep is like a restart: the program starts again from the beginning, and everything in normal memory is gone. In MicroPython (not run here; the 10-second sleep is an example):

import machine

if machine.reset_cause() == machine.DEEPSLEEP_RESET:
    print("woke from deep sleep")

# ... measure, send ...
machine.deepsleep(10000)    # sleep 10 s; the program then starts again

The board, not the chip

The sleep current is the current a complete device draws while it sleeps, and it is the number that matters for battery life. The 10 µA above is the chip. A development board adds a regulator with its own quiescent current, a USB-to-serial chip, a power LED and resistors, which keep drawing current while the chip sleeps. Depending on the board, that can be ten times the chip's figure or far worse. Battery-powered products therefore use a bare module on their own board, with a regulator chosen for low quiescent current and no LED that is always on.

Duty cycling

Duty cycling is the practice of keeping a device or radio switched on for only a small fraction of the time: wake, measure, send, sleep, and repeat. The fraction of time awake is the duty cycle. A sensor that is awake for 2 seconds every 15 minutes has a duty cycle of 2/900, about 0.2%.

Current over time for a duty-cycled sensor, not to scale. The current is low, in deep sleep, for most of the time. Every 15 minutes it jumps for about 2 seconds to around 80 milliamperes while the device measures and sends over Wi-Fi, then drops back. One cycle is 900 seconds. 80 mA µA time awake 2 s deep sleep 898 s deep sleep one cycle: 900 s (15 minutes) not to scale
A duty-cycled device: short, high peaks of activity and long periods of deep sleep.

Calculating an energy budget

An energy budget is a calculation of how much energy a device uses over time, across all its states, compared with what its battery or harvester can supply; the result is the expected battery life. It differs from a PC's power budget, which checks that a power supply can deliver the peak wattage of all parts at once. A battery device cares about the average over days and months, though its peaks must still be within what the battery and regulator can deliver.

The method: work out the charge used in one cycle (current × time for each state), divide by the cycle length to get the average current, and divide the capacity by that average. The example takes Lotte's shed sensor: it wakes every 15 minutes and is awake for 2 seconds at 80 mA with Wi-Fi on. Those two numbers are assumptions for the example; measure your own device or read the radio's current table in the data sheet. The sleep currents are the ESP32's 10 µA chip figure and an assumed 150 µA for a development board. The battery is assumed to deliver 2,000 mAh.

def average_ma(period_s, awake_s, awake_ma, sleep_ma):
    """Average current over one wake-sleep cycle (charge per cycle / cycle length)."""
    sleep_s = period_s - awake_s
    return (awake_s * awake_ma + sleep_s * sleep_ma) / period_s


BATTERY_MAH = 2000      # assumed usable capacity
AWAKE_S, AWAKE_MA = 2, 80   # assumed: 2 s awake with Wi-Fi on at 80 mA

scenarios = [
    ("bare chip, every 15 min", 900, 0.010),   # 10 µA: RTC timer + RTC memory
    ("dev board, every 15 min", 900, 0.150),   # 150 µA: assumed board sleep current
    ("bare chip, every 5 min", 300, 0.010),
]
print(f"{'scenario':<24} {'average':>9} {'of which sleep':>15} {'battery life':>13}")
for name, period_s, sleep_ma in scenarios:
    avg = average_ma(period_s, AWAKE_S, AWAKE_MA, sleep_ma)
    sleep_share = (period_s - AWAKE_S) * sleep_ma / period_s / avg
    days = BATTERY_MAH / avg / 24
    print(f"{name:<24} {avg:>6.4f} mA {sleep_share:>14.0%} {days:>8.0f} days")
scenario                   average  of which sleep  battery life
bare chip, every 15 min  0.1878 mA             5%      444 days
dev board, every 15 min  0.3274 mA            46%      254 days
bare chip, every 5 min   0.5433 mA             2%      153 days

Three lessons from the numbers:

  • On the bare chip, the awake time dominates (95% of the average). Shortening those 2 seconds — reconnecting to Wi-Fi faster, sending one message instead of several — gives the most.
  • On the development board, sleep is almost half the total, and battery life drops from about 444 to 254 days. An extra 140 microamperes, around the clock, add up to almost as much as the bursts of 80 mA.
  • Waking three times as often cuts battery life to about a third. Ask how fresh the data really needs to be: a shed temperature every 15 minutes is plenty.

Treat the result as an upper limit. Self-discharge, cold, aging of the cells and the cut-off voltage all take their share, and a device that fails to connect will stay awake longer and retry. Plan with a generous margin, and let the device report its battery voltage with every message so that you see the decline long before it stops.

Energy harvesting

Energy harvesting is collecting small amounts of energy from the device's surroundings, such as light, a temperature difference, vibration or radio waves, and storing it in a small rechargeable cell or a supercapacitor to run the device. A small solar panel on a garden sensor is the most familiar example; light switches that power their radio from the press of the button exist too.

Harvesting changes the energy budget from "how long until empty?" to "does the device collect more than it uses, on average, also in the worst week?" A solar-powered sensor must survive a dark week in December on its storage. Designs therefore combine harvesting with aggressive duty cycling, store enough for the worst case, and let the device measure less often when its stored energy is low.

When power is the problem

Power problems often look like software problems. Suspect power when you see:

  • Resets when the radio starts transmitting, or "brownout" messages on the serial console: the supply cannot deliver the current peak. Use a shorter or thicker USB cable, a better power adapter, a larger capacitor near the module, or (on the P1 port) check the meter version.
  • A device that works on the desk but not on batteries: the battery voltage under load falls below what the regulator needs (dropout), especially in the cold.
  • Batteries that are empty far too soon: a sleep current much higher than planned (an LED, a sensor that is never switched off, a pin left floating) or a device that keeps retrying a failed connection.
  • A warm regulator: a large voltage difference at high current through a linear regulator.