Sleep Modes and the Power Budget
Your device is asleep 99.9 % of the time. Design that 99.9 % first.
🎯 By the end you'll understand
What the ESP32-C3's four power modes actually do to the silicon, what survives each one, and how long each takes to wake. The duty-cycle equation that turns a sleep current and an active window into an average current, and an average current into months. How to build a power budget as a ledger you can defend line by line — Beacon's, worked to the canon's 8 µA sleep, 45 ms at 40 mA per minute, and ≈ 38 µA average. And the part nobody teaches: the leaks. A resistor divider, an LED controller, a pull-up on a stuck bus, a floating pin. You will learn which of those cost you a fifth of your battery life and which cost you nothing, and you will learn it as arithmetic rather than folklore.
KEY INSIGHTThe budget is a ledger, and it has exactly two columns
The firmware was beautiful. Deep sleep entered in 1.2 ms, woke on the accelerometer in 90, sampled and advertised in 45. The meter said 27 µA asleep. It should have said 8. Nineteen microamps were unaccounted for, and nineteen microamps is two-thirds of a year.
A battery-powered device spends its life in two states. In one it does nothing and draws microamps; in the other it does everything and draws tens of milliamps. Every design question in this stage reduces to how much charge leaves the cell in each state, and what fraction of the time each state lasts. That is not a metaphor — it is a sum with two terms, and you can write it on the back of the datasheet. What makes power budgets hard is not the arithmetic. It is that the second term is loud and visible (you can see the LED blink, you can watch the current spike on a scope) while the first term is silent, invisible, and usually where the battery actually goes.
Average current = sleep current + (charge per active window ÷ period). The first term is a current you must hunt for with a microammeter. The second is a charge — milliamp-seconds, not milliamps — and it is the only place where "make the code faster" helps. Beacon's two terms are 8 µA and 30 µA. Which one dominates depends entirely on the report period, and the answer flips somewhere around three minutes. Optimising the wrong term is the most common way to spend a week and save nothing.
HOW IT WORKSThe four power modes, and what each one switches off
The ESP32-C3 is not a chip with an on switch and an off switch. It is a set of power domains — the CPU and its SRAM, the radio and its analog front end, the peripherals, and a small always-on RTC domain — that can be clocked, gated, or powered down more or less independently. The four names in the documentation are just useful combinations of those switches.
| Mode | What is running | Order of current | Wake latency | What you keep |
|---|---|---|---|---|
| Active | CPU at up to 160 MHz, peripherals, radio when you use it | ~20–25 mA CPU only; tens of mA more with the radio transmitting | n/a | Everything |
| Modem sleep | CPU running, RF front end off between scheduled radio events | Single-digit mA, dominated by the CPU | Immediate | Everything, including an associated Wi-Fi or BLE connection |
| Light sleep | CPU clock-gated and stalled, SRAM and peripheral state retained, RTC domain alive | Order of a hundred µA on this family | ~1 ms — execution resumes, it does not restart | SRAM, register state, the call stack, peripheral configuration |
| Deep sleep | Almost everything powered down; only the RTC domain, its timer, and RTC SRAM remain | ≈ 5 µA for the module (Beacon's canon figure) | Tens of milliseconds — a full reboot through the bootloader | RTC SRAM only. Main SRAM, peripheral config, and your call stack are gone |
Current figures are in the class of Espressif's datasheet numbers for this family and are used here as orders of magnitude, not as specifications; Beacon's own measured values come from the project canon and are quoted exactly.
The gap that matters is between light sleep and deep sleep, and it is roughly a factor of twenty. Light sleep keeps your program alive: the CPU stops mid-instruction, the SRAM holds its charge, and a wake source restarts the clock so that esp_light_sleep_start() simply returns and the next line of C executes. Deep sleep throws all of that away to power down the SRAM. When the chip wakes, it boots: ROM bootloader, second-stage bootloader, app initialisation, and then app_main() from the top, with every global variable freshly initialised as if the device had just been plugged in.
The reboot is not free — it is tens of milliseconds of CPU at active current before your application does anything useful. On Beacon that boot is the single largest slice of the 45 ms wake window. It is a charge: roughly 22 ms × 22 mA ≈ 0.5 mC every time you wake. If you wake once a minute you pay it 525,600 times a year, which is 263 coulombs — about 73 mAh, or 7 % of the cell. If you wake once a second you pay it 60 times more and there is no cell large enough. The question "light sleep or deep sleep?" is really "is my period long enough to amortise a reboot?" For Beacon at 60 s, comfortably yes. For a device that wakes every 100 ms, emphatically no — that device should be in light sleep, where waking costs a millisecond and no reboot at all.
There is a subtlety worth knowing before you need it. ESP-IDF re-validates the application image on every boot by default, including boots from deep sleep, and that validation reads and hashes a megabyte of flash. The Kconfig option CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP skips it on the deep-sleep path specifically, which is worth several milliseconds of active current per wake. What you are trading is the chance to notice that flash has silently corrupted between wakes. On Beacon, where a corrupted image will fail the boot self-test anyway and where OTA rollback exists (Lesson 4.9), taking that trade is defensible. On a device with no other integrity check, it is not.
CORE CONCEPTWhat survives a deep sleep, and what wakes you from it
Deep sleep on the ESP32-C3 keeps exactly one region of memory alive: RTC SRAM, a small block in the always-on domain. Anything you want to carry across a sleep goes there, and in ESP-IDF you put it there with an attribute:
/* Survives deep sleep — lives in RTC SRAM, not main SRAM. */ RTC_DATA_ATTR static uint8_t adv_seq; // report counter → the seq byte in the payload (4.6) RTC_DATA_ATTR static uint32_t wake_count; RTC_DATA_ATTR static int16_t last_temp_c100; /* Does NOT survive: ordinary statics are re-initialised by the C runtime on every wake. */ static uint32_t boot_marker = 0xDEADBEEF; // .data — rewritten from flash every boot static uint8_t sample_ring[512]; // .bss — zeroed every boot /* Canon pin map — GPIO0–GPIO5 are the RTC-domain pins, and ADC1 is GPIO0–GPIO4. */ #define VBAT_SENSE_EN GPIO_NUM_1 // divider PMOS gate #define MOTION_INT_GPIO GPIO_NUM_3 // LIS2DH12 INT1 — RTC domain, so it can wake deep sleep #define VBAT_ADC_GPIO GPIO_NUM_4 // ADC1_CH4. NOT GPIO2: strapping pin, and the divider drags it low #define LED_PWR_EN GPIO_NUM_10 // LED rail PMOS gate, active-LOW, 100 kΩ pull-up holds it off void beacon_sleep(uint32_t seconds) { /* 1. Put the board to sleep BEFORE the MCU, or the MCU's 5 µA is irrelevant. */ gpio_set_level(LED_PWR_EN, 1); // high-side PMOS off (active-low enable) gpio_set_level(VBAT_SENSE_EN, 1); // intent: divider off. On Rev A it is not — see #beacon lis2dh12_set_lp_1hz(); // ~11 µA high-res → ~2 µA low-power /* SHT40 has no sleep command: it idles at a fraction of a µA between measurements. */ /* 2. Latch those pin states, or they revert to the pad default during sleep. */ gpio_hold_en(LED_PWR_EN); gpio_hold_en(VBAT_SENSE_EN); gpio_deep_sleep_hold_en(); /* 3. Arm the wake sources: RTC timer, and the accelerometer's INT1 line. */ esp_sleep_enable_timer_wakeup((uint64_t)seconds * 1000000ULL); esp_deep_sleep_enable_gpio_wakeup(BIT(MOTION_INT_GPIO), ESP_GPIO_WAKEUP_GPIO_HIGH); esp_deep_sleep_start(); // never returns; the next line of C is app_main() }
Three things in that listing are worth more than the API names.
The MCU is not the board
Putting the ESP32-C3 into deep sleep drops it to about 5 µA. It does nothing whatsoever to the LED, the sensors, the divider, or the pull-ups. A board whose MCU sleeps at 5 µA and whose LED controller idles at 900 µA sleeps at 905 µA. The sleep routine must switch off the board, in order, before it switches off the MCU — and every one of those switch-offs is a line item you should be able to point at on the schematic.
Pins do not hold their state by themselves
When the digital core powers down, the GPIO pads revert to their reset configuration unless you explicitly latch them. If a high-side PMOS is held off only by a GPIO driven high, and that GPIO reverts to its pad default during sleep, the switch can turn on for the whole sleep. Beacon’s LED rail does not depend on the pin alone: its gate carries a 100 kΩ pull-up that holds the PMOS off through reset and through sleep, which is the belt to the code’s braces. gpio_hold_en() per pin plus gpio_deep_sleep_hold_en() for the domain is the fix, and forgetting it produces exactly the "27 µA instead of 8" symptom in the opening — except worse, because it is usually milliamps.
Wake sources on the C3 are narrower than on its cousins
Deep-sleep wake on this part comes from the RTC timer and from the RTC-capable GPIOs (the low-numbered pins — check the pin table for your exact module revision). There is no ULP coprocessor on the ESP32-C3: unlike the original ESP32 or the S3, you cannot leave a tiny always-on core polling an ADC while the main CPU sleeps. Anything that must happen between wakes has to happen in an external part. Beacon relies on this deliberately: the LIS2DH12 does its own threshold detection in hardware at ~2 µA and pulls INT1 high, so the C3 never has to poll anything.
That last point is a design principle disguised as a chip limitation. The cheapest microamp is the one spent in a part built for the job. A 2 µA accelerometer watching for movement will always beat a 5 µA MCU waking every second to ask whether anything moved — and it beats it on latency too, which is how Beacon meets R4's two-second motion-to-report deadline (Lesson 3.4 built the interrupt path).
DEFINITIONThe duty-cycle equation, worked
Here is the whole of power budgeting, in one line:
Iavg = Isleep + (Iactive × tactive) / T
The bracketed term is a charge, measured in milliamp-seconds (millicoulombs) or microamp-hours. Dividing it by the period converts it back into an average current you can add to the floor. That conversion is where intuition usually fails, so do it slowly once with Beacon's canon numbers.
| Step | Arithmetic | Result |
|---|---|---|
| Charge per wake | 40 mA × 0.045 s | 1.8 mC = 0.50 µAh |
| Active contribution to the average | 1.8 mC ÷ 60 s | 0.030 mA = 30 µA |
| Sleep contribution | the measured floor | 8 µA |
| Average current | 8 + 30 | 38 µA |
| Life on paper | 1000 mAh ÷ 0.038 mA | 26,300 h ≈ 3.0 years |
| With the canon's 6× derating | 26,300 ÷ 6 | ≈ 4,380 h ≈ 6.0 months — meets R1 |
| Duty cycle | 0.045 ÷ 60 | 0.075 % awake |
Two observations that will save you weeks later. First, at a 60-second period the active term is four times the sleep term. Halving the sleep floor from 8 µA to 4 µA takes the average from 38 to 34 µA — an 11 % gain. Halving the wake window from 45 ms to 22 ms takes it from 38 to 23 µA — a 40 % gain. At this period, milliseconds are worth more than microamps.
Second, that ranking inverts as the period lengthens. At a ten-minute period the active term falls to 3 µA and the sleep floor is 73 % of the ledger; now the same 4 µA of sleep reduction is worth 36 % and the same 23 ms of code optimisation is worth 14 %. There is a crossover, and for Beacon's numbers it sits at a period of about 3.75 minutes — the point where 1.8 mC ÷ T equals 8 µA. Above it, hunt microamps. Below it, hunt milliseconds. Most engineers pick a side by temperament and are right about half the time.
The canon divides the paper figure by six before comparing it against the six-month requirement. That factor absorbs four separate realities: LiPo self-discharge (a couple of percent per month, and more when the cell is warm), capacity that is not 1000 mAh at Beacon's cutoff and temperature (Lesson 4.1), radio retries and motion wakes that add unscheduled active windows, and the ordinary gap between a bench measurement at 22 °C and a cupboard in a Jakarta warehouse. Six is a judgement, not a measurement — a deliberately blunt instrument chosen so that the requirement is met with room rather than met exactly. Say so out loud in your design review, because a reviewer who thinks 6× is a calculation will ask you to justify it as one.
SEE ITPower budget builder: which microamps actually matter
Before you size a budget of your own, do the technician's job for three nights. One Beacon has come back from the shop with a flat battery, and six leaks are open on it. Each night you have time for two fixes; then the tag goes back on its cart and the months run. Fix what you think drains the battery most, read the life against R1's six months, and watch what the stakeholder's request on night 2 does to your choices.
Notice what happened. On night 1 three leaks carried more than 98 % of the budget, and closing any of the other three bought nothing: a leak matters by its share of the whole average current, not by its name. On night 2 no leak had changed, but the period had. The same 1.8 mC per wake, paid every ten seconds, is 180 µA, and 7 ms off the wake window was suddenly worth more than any of the microamp leaks. Back at 60 s on night 3 the order flipped again, and a 5 µA leak was enough to decide R1. Which fix pays depends on which term of the ledger is the biggest, and the report period decides that.
The game held the wake window, the burst current and the sleep floor at Beacon's values. The builder below lets you move them, so you can size a budget of your own.
Set the duty cycle, then switch leaks on and off. The ledger below shows every line item's contribution to the average current, sorted by size, and projects battery life against R1's six months. The point of the widget is not the total — it is the ranking. Start with Beacon's canon profile, then turn on the unswitched divider and watch what a resistor pair costs. Then turn on the LED and watch what a resistor pair costs relative to a real mistake.
| Leak | Where it comes from | Cost |
|---|---|---|
| Divider not switched | 2 × 1 MΩ battery-sense divider left permanently across a 3.7 V cell: I = 3.7 / 2 MΩ | 1.85 µA |
| Accel left in high-res | LIS2DH12 in high-resolution mode instead of low-power 1 Hz (≈ 11 µA vs ≈ 2 µA, datasheet class) | 9 µA |
| Floating GPIO | An unused input with no pull, drifting through the logic threshold and switching the input buffer | ≈ 5 µA (illustrative) |
| I²C line held low | A hung sensor parking SDA low against a 4.7 kΩ pull-up: 3.3 V / 4.7 kΩ | 700 µA |
| RGB LED left powered | A WS2812B-class controller idles even when displaying black, because the controller itself is alive | ≈ 900 µA (illustrative) |
| Dev-kit USB-UART bridge | Measuring on a dev board whose bridge chip, power LED, and second regulator are all still populated | ≈ 2 mA (illustrative) |
Three experiments. First, with the canon defaults, add the unswitched divider: the average moves from 38 µA to 39.9 µA and derated life falls just below six months — a 4.6 % loss that is enough to miss the requirement, from two resistors. Second, take the period out to 900 s and add the same divider: now it costs nearly 16 %, because the sleep floor is almost the whole ledger. Third, leave the divider off and turn on the LED: 900 µA swamps everything, the chart's other bars become invisible, and the projected life is days. That visual — one bar so long that the rest vanish — is the lesson. Before you optimise a single microamp, prove you have no milliamps.
IN PRACTICEThe leak taxonomy, and how to actually measure the floor
Every unexplained microamp comes from one of six places. Learn the list and you can debug a sleep current by elimination rather than by guessing.
Something is still powered
An LED controller, a sensor in continuous mode, a level shifter, a second regulator on a dev board. Fix: a high-side PMOS load switch per subsystem, driven by a latched GPIO. Beacon does this for the RGB LED and for the battery divider.
Something is pulled through a resistor
A pull-up whose line is held low, a divider with no switch, an LED with a series resistor to a rail. These are Ohm's law, so they are the easy ones: compute V/R for every resistor that bridges two nets and add them up. If any of them exceeds a microamp, it needs a switch or a bigger value.
Something is floating
A CMOS input left undriven sits near the switching threshold and the input buffer conducts. The current is small, unpredictable, and temperature-dependent — which makes it the worst kind of bug. Fix: configure every unused pin as an input with a pull, or as a driven output, and never leave one at reset default.
Something is leaking backwards
A GPIO driven high into an unpowered chip's protection diode will power that chip through its I/O pin — badly, at a few hundred microamps, with the chip half-alive. Whenever you power-gate a subsystem, drive every signal into it low first, or use a part with true failsafe I/O.
The regulator itself
Quiescent current and light-load conversion loss, which is the whole argument of Lesson 4.2. On Beacon this is inside the canon's 8 µA and is small because the TPS62840 was chosen for it.
The board is dirty
Flux residue and human skin oils are conductive enough to matter at these currents. A few megohms across a 3.7 V rail is a microamp. If your sleep current improves after an isopropyl wash and a bake, it was never a firmware bug.
A DMM measures current by putting a shunt resistor in series and reading the voltage across it. On a microamp range that shunt is often tens or hundreds of ohms — but the meter auto-ranges, and on its milliamp range the shunt is different. Two consequences. First, burden voltage: at 40 mA through a 10 Ω shunt you lose 400 mV, which can brown out a device that was fine. Second, and worse, an auto-ranging meter takes time to switch ranges, so a device that jumps from 8 µA to 40 mA every minute will show you a number that is neither. You need an instrument that spans six decades without switching: a source-measure unit, or a purpose-built tool such as the Nordic Power Profiler Kit or a Joulescope. If you do not have one, the poor-relation method is a low-value series shunt with a scope for the burst and a separate high-side microammeter session for the floor — two measurements, never one.
One more piece of measurement discipline: measure at the battery terminals, not at the regulator's output. The number the requirement cares about is charge leaving the cell, which includes the regulator's own consumption and any conversion loss. Measuring on the 3.3 V rail flatters you by exactly the amount Lesson 4.2 spent a whole widget on. Beacon's canon 8 µA is a battery-side figure, which is why it is directly comparable to the 1000 mAh cell.
BEACONBeacon: the eight-microamp ledger, line by line
Here is the canon's sleep floor decomposed. The total is the measured number; the split is how the design justifies it.
| Line | State in deep sleep | Contribution |
|---|---|---|
| ESP32-C3-MINI-1 | Deep sleep, RTC timer armed, RTC SRAM retained | ≈ 5 µA |
| LIS2DH12 | Low-power mode, 1 Hz, interrupt threshold armed on INT1 | ≈ 2 µA |
| SHT40 | Idle between measurements — no sleep command needed | < 1 µA |
| TPS62840 | 60 nA quiescent plus light-load conversion loss | remainder |
| Battery divider | Meant to be disconnected by its PMOS switch | ≈ 0 as designed; see the Rev A defect below |
| WS2812B-2020 | Power-gated by its high-side PMOS | ≈ 0 |
| Board total, measured at the cell | ≈ 8 µA |
Add the active window — 45 ms at 40 mA once per 60 s, which is 1.8 mC or 30 µA of average — and Beacon's average is ≈ 38 µA. On a 1000 mAh cell that is about 26,000 hours, roughly three years on paper. Divided by six for the reasons above, about six months, which is R1 met with no margin to spare and none wasted.
The canon records a known Rev A defect: the battery divider leaks 1.8 µA more than planned, and the mechanism is worth more than the number. The divider PMOS switches the high side, so its source is the battery, up to 4.2 V. Rev A drives that gate straight from a 3.3 V GPIO, so the best the firmware can do is VGS = 3.3 − 4.2 = −0.9 V. That is not off; it is partially on, and the divider keeps drawing 3.7 V / 2 MΩ = 1.85 µA through sleep. The line of C that says gpio_set_level(VBAT_SENSE_EN, 1) is correct and the hardware cannot obey it. Releasing the pin to high-Z is not the fix either: the pad’s ESD diode clamps the gate near the rail and back-feeds current into it, which is using a protection structure as a circuit element. Rev B adds a small NMOS level shifter with a pull-up to VBAT so the gate rests at VBAT and VGS is exactly zero. Run the Rev A number through the equation. The sleep floor becomes 9.8 µA, the average 39.8 µA, and the paper life 25,100 hours. Derated by six, that is 4,190 hours — 5.7 months. Two one-megohm resistors and a PMOS that does not switch what it was supposed to switch, and a requirement that was met is now missed by eight days. This is why the divider is switched at all, and why it is on the Rev B change list rather than in the "acceptable" column.
Note carefully how the same leak scales. At Beacon's 60-second period it costs 4.6 % of battery life. On a device that reports hourly, where the sleep floor is essentially the entire ledger, the identical 1.8 µA costs close to 19 %. A leak's importance is not a property of the leak; it is a property of the duty cycle it sits inside.
The bench proof is the last part of the Stage 4 milestone: a 72-hour run on the real board, logging the coulombs actually delivered, with the projection extrapolated from measured data rather than datasheet arithmetic. Seventy-two hours is enough to catch a leak that only appears after the first temperature cycle or after the hundredth wake; it is not enough to catch self-discharge, which is exactly the kind of thing the 6× derating is standing in for. Lesson 6.6 turns that run into a reliability argument.
WEAKNESSWhere this bites
An engineer spends three days shaving the wake window from 45 ms to 38 ms — a real, hard-won 15 % of the active term — and the device is reporting every fifteen minutes, where the active term is 2 µA out of 10. The three days bought 3 % of battery life. The unswitched divider sitting in the same design was worth 16 %. Compute the crossover period before you start optimising: it is charge-per-wake divided by sleep current, and for Beacon's numbers it is about 3.75 minutes. On the short side of it, chase milliseconds. On the long side, chase microamps. Never chase both at once with no measurement to say which is winning.
A dev board carries a USB-to-UART bridge, a power LED, a second regulator, an auto-reset transistor pair, and often a pull-up network that has nothing to do with your design. Any one of them dwarfs your budget. A sleep-current measurement on a dev kit is not a pessimistic version of the real number; it is a measurement of a different board. Cut the power LED, remove the bridge's power, or accept that this number is only for tracking relative changes — never as evidence that a requirement is met. Beacon's 8 µA is a custom-PCB number, measured at the cell, and it could not have been obtained any other way.
esp_deep_sleep_start() puts the board to sleepIt puts the chip to sleep. Everything else on the board keeps doing whatever it was doing when the CPU stopped — including holding a GPIO in whatever state the pad reverts to, which is not necessarily the state you left it in. The two-line fix (gpio_hold_en() per pin, gpio_deep_sleep_hold_en() for the domain) is the most commonly omitted pair of calls in ESP-IDF power code, and its symptom is a sleep current in the hundreds of microamps that disappears when you probe it, because probing changes the pin's state.
KEY INSIGHTHow this connects
- Batteries: Chemistry, Capacity, and the Lies of mAh (4.1) — the 1000 mAh in the denominator is a capacity at a current, a temperature, and a cutoff. The budget tells you which current; that lesson tells you what the number really is.
- Regulators: LDO vs Buck vs Boost (4.2) — the regulator's quiescent current and light-load efficiency are line items in the sleep floor. The TPS62840 was chosen precisely so this line stays small.
- State Machines and Event-Driven Firmware (3.7) — the state machine's
SLEEP ⇄ WAKE → SAMPLE → ADVERTISEloop is the shape the budget assumes; every extra state you add is a new line in this ledger. - Charging, Protection, and USB-C (4.4) — next: the other end of the cell's life, where the charge comes back in, and the two resistors that decide whether it arrives at all.
You now have a defensible number for how long Beacon lasts. The next four lessons spend that number: on charging, on radio, and finally on updates.
GLOSSARYKey terms introduced
- Deep sleep
- The ESP32-C3's lowest-power state: everything but the RTC domain is powered down, RTC SRAM is retained, and waking is a full reboot through the bootloader. About 5 µA for the module.
- Light sleep
- A state in which the CPU is clock-gated but SRAM and peripheral state are retained, so execution resumes rather than restarts. Roughly a hundred microamps on this family, with about a millisecond of wake latency.
- RTC SRAM /
RTC_DATA_ATTR - The small always-on memory that survives deep sleep, and the ESP-IDF attribute that places a variable in it. Beacon's advertising sequence number lives here.
- Duty cycle
- The fraction of time a device spends awake: tactive / T. Beacon's is 0.075 %. It is the multiplier that converts an active current into an average one.
- Charge per wake
- Iactive × tactive, in millicoulombs or microamp-hours. The correct unit for talking about a wake window, because it is invariant to how you split the window between phases.
- Crossover period
- The report period at which the active and sleep terms are equal: charge-per-wake ÷ sleep current. Below it, optimise milliseconds; above it, optimise microamps. About 3.75 minutes for Beacon.
- Burden voltage
- The voltage dropped across a current meter's internal shunt. Large enough on a DMM's milliamp range to brown out a device under test, and the reason microamp and milliamp measurements usually need different instruments.
- GPIO hold
- Latching a pin's output state so it persists through deep sleep, via
gpio_hold_en()andgpio_deep_sleep_hold_en(). Without it, pads revert to their reset configuration and power-gating switches can turn back on.
ACTIVE RECALLCheck your understanding
Answer in your own words first, then reveal.
1Beacon reports every 60 s. Would you rather have 4 µA off the sleep floor or 20 ms off the wake window? What if the period were 15 minutes?›
At 60 s: the active term is 1.8 mC ÷ 60 s = 30 µA and the sleep term is 8 µA, so the average is 38 µA. Removing 4 µA of floor gives 34 µA (a 10.5 % gain); removing 20 ms of window drops the active term to 1.0 mC ÷ 60 s = 16.7 µA and the average to 24.7 µA (a 35 % gain). Take the milliseconds.
At 900 s: the active term is 1.8 mC ÷ 900 s = 2 µA and the average is 10 µA. Removing 4 µA of floor gives 6 µA (a 40 % gain); removing 20 ms of window gives 9.1 µA (a 9 % gain). Take the microamps. The crossover is where charge-per-wake ÷ period equals the sleep current — about 225 s for these numbers.
2Your board sleeps at 5 µA on the bench and at 640 µA once the enclosure is closed and the unit has been shipped. Name three candidate causes and how you would distinguish them.›
(1) A pin not held through sleep. A power-gating PMOS whose gate GPIO reverted to its pad default is the classic — 640 µA is squarely in the range of an LED controller or a sensor waking up. Distinguish it by adding gpio_hold_en() and re-measuring, or by probing the switched rail with the enclosure open; if probing changes the number, the pin was floating.
(2) A held bus line. A sensor that hangs and parks SDA low pulls 3.3 V / 4.7 kΩ ≈ 700 µA continuously — very close to the observed figure. Distinguish it by reading the bus levels in sleep, or by removing the pull-ups and seeing the current vanish.
(3) Contamination or mechanical. Flux residue, condensation inside a sealed enclosure, or a button held closed by the housing. Distinguish it by washing and baking the board, and by measuring the unit outside the enclosure with the same firmware. Note that "it only happens in the field" points strongly at cause 3 or at a temperature-dependent version of cause 1.
3Why can't the ESP32-C3 use a ULP coprocessor to poll the accelerometer, and how does Beacon get the same result for less current?›
The C3 simply does not have one — the ultra-low-power coprocessor is a feature of the original ESP32 and the S3, not of this RISC-V part. Beacon does not need it, because the polling is pushed into the sensor. The LIS2DH12 runs its own threshold detection in hardware at roughly 2 µA in low-power mode and asserts INT1 when the threshold is crossed; that line is a deep-sleep wake source. The MCU therefore sleeps at ~5 µA and is woken by an event rather than waking to look for one. This is both cheaper (2 µA of sensor beats any duty-cycled MCU polling) and faster (the interrupt fires immediately, which is how R4's two-second motion-to-report deadline is met).
4The canon derates the paper battery life by six. Defend that factor to a reviewer who calls it arbitrary — and say what would make you change it.›
It is a judgement, and it should be presented as one. It covers four effects that the duty-cycle equation does not model: LiPo self-discharge over a six-month deployment; the fact that "1000 mAh" is a rating at a specific current, temperature and cutoff and the usable figure at Beacon's cutoff is smaller (Lesson 4.1); unscheduled active windows from motion wakes and radio retries, which add charge the fixed 60-second period does not account for; and the difference between a 22 °C bench and an uncontrolled indoor environment. Choosing six rather than three means the requirement is met with room, which is the right posture for a first pilot where the measurement history is one 72-hour run.
What would change it: real fleet data. After the 30-day pilot in Stage 6, the derating should be replaced by measured self-discharge, a measured motion-wake rate per unit, and a measured capacity at the deployed temperature. At that point the factor becomes a calculation instead of a posture, and it will almost certainly be smaller than six — which is how you get from "six months" to a number you can put on a datasheet.