Charter 22 · system · reserve project

The Sleepy Bug

Energy Budget Experiment

Make every awake second justify its cost, then discover whether measured energy agrees with predicted survival.

Difficulty
★★★
Prefix
sl
Zone
outdoor-1
Type
sleepy-node
Device
sl-01
Build time
10 hours

Mission

Build this

Build a measured wake–sense–publish–listen–stretch–sleep cycle whose sensor and servo are electrically off when their evidence is not needed.

One kit, one team repository.

Borrowed parts are labelled below and have a fallback. The registered device ID is fixed; sensing and behaviour decisions remain yours.

Bill of materials

Parts

SourcePartFallback
● kitPhotoresistor and 10 kΩ resistorUse another low-power kit sensor only after measuring its awake and sleeping load
● kitSG90 servo—
○ fablabApproved load-switch module, regulated pack, and current meterUse supervised USB power and compare state budgets without claiming battery runtime

Disconnect USB before rewiring. Motors, the relay, and the servo need appropriate power and a shared ground. Never drive an actuator from the ESP32 3V3 pin.

Backup assignment · your invitation

Make every awake second justify its cost

The Sleepy Bug wakes, powers one simple sensor, takes evidence, joins the garden, publishes, checks Frost Sentinel, stretches once, and returns to deep sleep. Its main product is not the light reading or the gesture. It is a measured energy budget.

This charter begins on USB or a supervised bench supply. Battery operation is earned only after the wiring, current measurement, prediction, and safe regulated source have been reviewed.

No improvised lithium battery work.

Use only the approved regulated pack and measurement setup supplied by the lab. Do not open power banks, handle bare cells, improvise chargers, or place a current meter across a battery.

The central idea

Long life is mostly the arithmetic of time

sleep___ mA × ___ s

Usually the longest state; tiny current still matters here.

sense___ mA × ___ s

Power the sensor only long enough to settle and sample.

connect + publish___ mA × ___ s

Wi-Fi often dominates the wake budget.

stretch___ mA × ___ s

A servo can briefly draw far more current than the sleeping board.

Average current ≈ total current-time across one cycle ÷ cycle duration

Predicted runtime then uses the pack’s measured usable capacity divided by average current. The result is an estimate, not a promise: regulator loss, temperature, retries, self-discharge, and power-bank auto-shutoff can all move reality away from the arithmetic.

A sleeping device is genuinely absent

It cannot listen while deep sleep has turned the radio off

1

Wake and mark the reset reason.

2

Power and sample the local sensor.

3

Connect, publish battery estimate and status.

4

Read the newest Frost Sentinel status during a short listening window.

5

Stretch, switch the servo rail off, and sleep.

A subscription is not an alarm clock.

Frost Sentinel cannot wake this device through MQTT. The Sleepy Bug learns its status only after a scheduled wake. If frost warning changes the next interval, document the worst-case delay.

Wiring

Remove sleeping loads instead of asking them to behave

The reference sensor is a photoresistor divider powered from a GPIO only while sampling. The servo uses an approved switched 5 V rail so its electronics draw no power during deep sleep.

The power rule: The sensor divider is powered briefly from GPIO 25 and draws less than one milliamp through 10 kΩ. The servo uses an approved regulated 5 V source through a reviewed load-switch module. Join all grounds.

Bench referenceOpen the exact wiring map
WiringWake-only light sample and fully switched stretch mechanism
ESP32GPIO 25Photoresistorone legGPIO 34Photoresistorother legGPIO 3410 kΩ resistorone legGND10 kΩ resistorother legregulated external 5 VApproved load-switch moduleINGPIO 26Approved load-switch moduleENGNDApproved load-switch moduleGNDGPIO 18SG90 servosignal (orange)switched 5 VSG90 servopower (red)GNDSG90 servoground (brown)
ESP32 pinPartPart markingCarries
GPIO 25Photoresistorone legDigital in/out — HIGH only while sampling
GPIO 34Photoresistorother legAnalog voltage — divider junction
GPIO 3410 kΩ resistorone legAnalog voltage — same divider junction
GND10 kΩ resistorother legGround
regulated external 5 VApproved load-switch moduleIN5V power — source must be approved for the ESP32 and servo load
GPIO 26Approved load-switch moduleENDigital in/out — HIGH only for the wake gesture
GNDApproved load-switch moduleGNDGround
GPIO 18SG90 servosignal (orange)PWM to actuator — one wake stretch
switched 5 VSG90 servopower (red)5V power — load-switch OUT
GNDSG90 servoground (brown)Ground — join all grounds

A lab supervisor must approve the source, current-meter placement, and load-switch module before battery testing. Never power the servo from ESP32 3V3 and never connect an ammeter directly across a source.

  • Digital in/out
  • Analog voltage
  • Ground
  • 5V power
  • PWM to actuator

Load-switch modules differ. Treat IN, OUT, EN, and GND as functional labels and follow the supplied module’s verified wiring. The USB-only fallback may omit the switched servo and must not claim battery runtime.

Spend energy where it improves evidence

Every feature competes with another wake cycle

longer listening

Fresher shared context

More time for MQTT messages, but more radio energy on every wake.

more samples

Calmer local reading

Potentially better evidence, but sensor and CPU remain active longer.

longer stretch

More visible life

More actuator energy for no additional measurement.

Your team decides:

  • What minimum evidence makes one wake worthwhile?
  • Which interval balances freshness against energy?
  • What happens after Wi-Fi fails—retry briefly, skip, or stay awake?
  • How is battery percentage estimated, and how uncertain is that estimate?

Your energy-budget experiment

Measure states first, predict second, discharge third

  1. Measure one cycle on supervised bench power.

    Record current and duration for deep sleep, sensing, connecting, publishing, listening, and stretching.

  2. Compare at least three firmware versions.

    For example: always awake, deep sleep with servo still powered, and deep sleep with sensor and servo rails off.

  3. Calculate energy per cycle and predicted runtime.

    Use documented usable capacity and include the wake interval, retries, and load-switch current.

  4. Run a controlled timed discharge.

    With the approved pack, start from the same full condition and compare measured energy loss or operating time with the prediction.

StateCurrentDurationmA·s per cycleMeasurement setup
deep sleep___ mA___ s______
Wi-Fi + publish___ mA___ s______
servo stretch___ mA___ s______

When the budget refuses to balance

The missing energy is usually attached to an assumption

Deep-sleep current remains surprisingly high

The servo, sensor divider, regulator, indicator LED, or measurement adapter may still be powered. Remove loads one at a time and remeasure.

Wi-Fi connection time varies wildly

Signal quality and retries are part of the real budget. Record a distribution across many wakes rather than using the fastest example.

The USB power bank turns itself off

Many banks interpret low sleep current as no device. This source is unsuitable unless the lab provides a safe, documented solution; do not defeat its protection.

Battery percentage falls smoothly but runtime prediction fails

The percentage mapping or usable-capacity assumption may be wrong. State whether the estimate comes from voltage, accumulated energy, or timed discharge.

Frost warning is discovered too late

The device was asleep. Report the maximum response delay and decide whether the energy cost of more frequent waking is justified.

Choose your survival question

What kind of low-power team will you become?

The state accountants

Build the most complete current-time budget and chase the difference between calculated and measured energy.

The wake strategists

Compare fixed, frost-aware, and retry-limited schedules while making response delay part of the cost.

The load detectives

Remove sensor, servo, regulator, and indicator loads one at a time to discover what “sleeping” hardware still consumes.

A calm way through the build

Collect four small wins

  1. sl-01 says hello on USB.

    Publish once before attempting sleep or battery work.

  2. One timed wake senses, publishes, and sleeps again.

    Keep the servo disconnected and inspect reset reasons.

  3. Each operating state has measured current and duration.

    Use the supervised meter setup and calculate the first budget.

  4. The stretch rail turns fully off before sleep.

    Add the approved switch, then earn the controlled battery test.

The garden handshake

Share what you found

These names are the rigid part of the project. They let another team find your work without knowing what you called the variables in your code.

Once per wake

Estimated remaining energy

garden/outdoor-1/sleepy-node/sl-01/battery

Unit: percent

Once per wake

Wake-cycle state

garden/outdoor-1/sleepy-node/sl-01/status

Unit: enum

Listen beyond your own device.

garden/outdoor-1/frost-node/fs-01/status

The device can read Frost Sentinel only during its awake listening window. Use the newest valid status to choose a later wake interval, and report the maximum delay while asleep.

Finish line

Ready to introduce to the garden

  • sl-01 wakes, stays online long enough to publish a documented battery estimate and registered status, then returns to deep sleep.

  • The reject feed stays clear during repeated wake cycles.

  • The device reads Frost Sentinel status while awake and never claims MQTT can wake it from deep sleep.

  • The sensor and servo draw no intentional current during sleep; one wake produces one bounded stretch without blocking the publish window.

  • The build log contains current and duration for every state, three firmware budgets, usable-capacity assumptions, predicted runtime, a controlled timed discharge, prediction error, and worst-case frost-response delay.

  • The regulated source, meter placement, and load switch were approved by the lab; there are no loose cells or improvised chargers; outdoor joints and the device label are protected.

The Sleepy Bug succeeds when its runtime claim is no longer a guess. Every milliamp has a state, every state has a duration, and every missing hour has an assumption the team can inspect.

Backbone now

Live status

Updates from the same public event stream

Checking sl-01…