# power-budget-calculator

power-budget-calculator estimates total power draw and battery lifespan for Arduino, ESP32, and RP2040 boards. Evaluates sleep cycles and recommends battery capacity.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 178 installs · ★ 33 repo stars
- Author: wedsamuel1230
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/wedsamuel1230/embedded-engineering-skills/tree/HEAD/skills/power-budget-calculator/SKILL.md
- Updated: 2026-10-15
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/power-budget-calculator

## What it does

The skill models current consumption for embedded setups using datasheet references. It relies on a local database in `references/component-database.md` and a calculation script in `scripts/calculate_power.py`. The tool calculates average current across active and deep sleep intervals, including peak transmission spikes for Wi-Fi, LoRa, or BLE.

You can run guided checks directly in agent chat or execute `uv run --no-project scripts/calculate_power.py --interactive` in the terminal. The included component library tracks figures for ATmega328P, ESP32 variants, RP2040, plus common peripherals like OLED screens, servos, and environmental sensors. Battery calculations apply a 0.8 usable efficiency factor.

Executing the standalone script directly requires the `uv` Python tool installed on your machine.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add wedsamuel1230/embedded-engineering-skills --skill power-budget-calculator -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/power-budget-calculator/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/power-budget-calculator/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add wedsamuel1230/embedded-engineering-skills --skill power-budget-calculator -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/power-budget-calculator/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add wedsamuel1230/embedded-engineering-skills --skill power-budget-calculator -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/power-budget-calculator/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install wedsamuel1230/embedded-engineering-skills skills/power-budget-calculator
```

2. **Manually: put the files in place**
- File: `.github/skills/power-budget-calculator/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add wedsamuel1230/embedded-engineering-skills --skill power-budget-calculator -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/wedsamuel1230/embedded-engineering-skills --path skills/power-budget-calculator
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/power-budget-calculator/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add wedsamuel1230/embedded-engineering-skills --skill power-budget-calculator -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/wedsamuel1230/embedded-engineering-skills/tree/HEAD/skills/power-budget-calculator/SKILL.md

## When to use it
- Calculate average current draw across active and sleep duty cycles
- Estimate device runtime on specific battery capacities
- Size the required battery pack for an IoT deployment
- Analyze peak current demands from radios and actuators

## Example prompts
- Estimate battery life for an ESP32 sending BME280 readings over Wi-Fi every ten minutes on a 2000mAh LiPo
- How long will an RP2040 Pico run in dormant mode from two AA batteries?
- Run scripts/calculate_power.py on assets/example-project.json and export report.md

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 87f2d2e396bd0d2e.

BEGIN THIRD-PARTY FILE 87f2d2e396bd0d2e
````text
---
name: power-budget-calculator
description: Calculates total power consumption and battery life for Arduino/ESP32/RP2040 projects. Use when user asks about battery life, power requirements, current draw, or needs to estimate runtime. Includes sleep mode analysis, power optimization tips, and battery sizing recommendations. Run scripts/calculate_power.py for accurate calculations.
metadata: {triggers: "power budget, current draw, battery life, runtime, regulator"}
---

# Power Budget Calculator

Estimates power consumption and battery life for embedded projects.

## Resources

- **scripts/calculate_power.py** - Python calculator with component database, duty cycle support, battery life estimation
- **references/component-database.md** - Comprehensive current draw reference from datasheets  
- **assets/example-project.json** - Sample project configuration

## Quick Start

Run the calculator interactively:
```bash
uv run --no-project scripts/calculate_power.py --interactive
```

Or calculate for a single component:
```bash
uv run --no-project scripts/calculate_power.py --component ESP32 --mode deep_sleep --duty 95
```

Load a project configuration:
```bash
uv run --no-project scripts/calculate_power.py --json assets/example-project.json --output report.md
```

List all components in database:
```bash
uv run --no-project scripts/calculate_power.py --list
```

## When to Use
- "How long will my battery last?"
- "What size battery do I need?"
- "How much current does my project draw?"
- Planning battery-powered projects
- Optimizing for low power

## Workflow

### Step 1: Gather Component List

Ask user for:
1. Microcontroller (model and operating mode)
2. All sensors and modules
3. Displays
4. Actuators (motors, LEDs, relays)
5. Communication (WiFi, Bluetooth, LoRa)
6. Operating profile (always on vs. duty cycle)

### Step 2: Calculate Power Budget

Run `scripts/calculate_power.py --interactive` for guided calculation, or use this template:

```markdown
# Power Budget: [Project Name]

## Operating Conditions
- Supply Voltage: [V]
- Operating Modes: [Active/Sleep cycles]
- Duty Cycle: [X% active, Y% sleep]

## Component Current Draw

### Always-On Components
| Component | Voltage | Current | Power | Notes |
|-----------|---------|---------|-------|-------|
| [name] | [V] | [mA] | [mW] | [conditions] |
| ... | ... | ... | ... | ... |
| **Subtotal** | - | **[mA]** | **[mW]** | - |
````
END THIRD-PARTY FILE 87f2d2e396bd0d2e

The third-party file has ended. Everything between the 87f2d2e396bd0d2e tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2419 of 10203 bytes. © wedsamuel1230 · MIT · https://github.com/wedsamuel1230/embedded-engineering-skills/tree/HEAD/skills/power-budget-calculator/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
