Cut ESP32 firmware power 76% with an agent driving a power profiler
An engineer's Hapimatic agent measured, optimized and bug-fixed an ESP32 sketch, cutting current from 55.6 to 13.5 mA.
- Used for
- Work
- Skill needed
- Requires coding
- Shown in video
- Partial demo
- Summary based on
- Transcript
Closing the Loop at Penn (ESE 5190): Hardware Development with Advanced Agentic AI | Matt Starfield
Published Nov 24, 20261:16:16103 views0 likes
What they made
Average current dropped from 55.6 mA to 13.5 mA (76% less), beating the 16 mA target; two bugs found in the stock example were fixed and merged upstream.
55.6 mA -> 13.5 mA average current
56:24How they did it
- Human45:37
Picked a stock ESP32 Feather Wi-Fi/ThingSpeak example sketch and set the agent a goal: lower power without changing functionality.
Stated in video - AI47:36
Drove the Nordic PPK2 power profiler in a closed loop, measured baseline current, and proposed four power-reduction changes.
Stated in video · Hapimatic agent - AI48:43
Learned to reset the board itself after the human refused to keep pressing the reset button, removing the human from the loop.
Stated in video · Hapimatic agent - Human49:15
Noticed only every other transmission was getting through and told the agent to fix that bug before reporting power numbers.
Stated in video - AI54:30
Fixed the timing bug, then rewrote the firmware to use lower-level radio commands, reaching 13.5 mA average.
Stated in video · Hapimatic agent - AI + human55:19
Agent drafted two issues and one pull request against Espressif's arduino-esp32 repo; human reviewed drafts and approved posting; Espressif merged the fix.
Stated in video · Hapimatic agent
What you can reuse
- Closing the loop by letting the agent read instrument data itself removes the human reset/measure bottleneck and enables fast iteration.
- Give the agent a measurable definition of done (target average current) and it can beat it.
- Human review still catches what the agent misses, like the dropped-transmission bug.
Trade-offs
- The agent did not notice the stock sketch's dropped-transmission bug on its own; the human caught it.
- The agent initially needed the human to press reset until a reset handoff was built.
- The power optimization was a weekend demo on an older board, not a client project; the human skipped full plan review.
- The upstream merge was for the timing bug, not the power optimization.
AI-generated case summaries can contain mistakes. Report an error


