Engineering Calculators
ASecurityThis skill should be used when the user asks for a number for a circuit or PCB detail, for example "what trace width for 3 A", "via current", "50 ohm microstrip", "USB 90 ohm pair", "design a buck", "LDO heat", "junction temperature", "MOSFET losses", "battery life", "ADC divider", "RC filter", "crystal load capacitors" or "LED resistor". It runs sourced calculators and shows the margins. Load it before stating any such number, even when the answer seems known, because its calculators give th...
- 3 stars
- 0 votes
- 0 copies
- 0 views
- Added December 1, 2026
Security analysis
100/100Pro scans all 20 files and shows the line behind each finding
npx -y skills add gkochievi/boulder-hardware-skills --skill engineering-calculators --agent claude-codeAre you the author of Engineering Calculators?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/gkochievi-engineering-calculators)---
name: engineering-calculators
description: This skill should be used when the user asks for a number for a circuit or PCB detail, for example "what trace width for 3 A", "via current", "50 ohm microstrip", "USB 90 ohm pair", "design a buck", "LDO heat", "junction temperature", "MOSFET losses", "battery life", "ADC divider", "RC filter", "crystal load capacitors" or "LED resistor". It runs sourced calculators and shows the margins. Load it before stating any such number, even when the answer seems known, because its calculators give the margin and the source.
user-invocable: false
---
# Engineering calculators
Answer sizing questions with numbers that come from a script, a cited formula and the user's datasheet values, never from memory. Every calculator here prints the formula source, the inputs it used and where each input came from (command line, `boulder.toml`, preset), and returns `warn` or `fail` when a margin is thin or broken. Concepts and part choices live in other skills: `electronics-fundamentals` (how circuits work), `pcb-design` (layout rules), `circuit-simulation` (when a formula is not enough).
## Procedure
1. **Pin down the question.** Name the quantity (width, impedance, inductor, Tj, life, cutoff ...), the limit it must meet and the operating corner that matters (lowest input, highest ambient, end of battery life).
2. **Collect the inputs from the datasheets.** The scripts refuse to guess values that decide the answer: Vref, EN thresholds and hysteresis currents, t_on(min), dropout, θ values, RDS(on) and its temperature factor, ADC sampling model, crystal CL / ESR / C0, LED Vf, Schmitt thresholds, εr and dielectric height. Ask for the part number and read the datasheet table (cite table and revision) instead of assuming. Presets exist only where a primary source supplied the numbers (JLCPCB stackups, USB 2.0 VBUS range, the TPS54560 / TPS54202 examples in the tests).
3. **Run the calculator** from the table below. Use `--json` when another step consumes the result. Run the worst-case corner, not only nominal: minimum input for regulators, maximum ambient for heat, minimum Vf and maximum supply for LED current, resistor tolerance for dividers.
4. **Report** the result with its margin, the formula source the script printed and every input that came from an assumption. A `warn` is a design decision the user must make; a `fail` is a redesign.
5. **Check with a second method when it matters:** the fab's field solver for controlled impedance, a SPICE run (`circuit-simulation`) for loop stability, transients and filters with real op-amp models, a bench measurement for heat.
6. **Record** the numbers, inputs and sources in the project's decision log (`ask-gela`).
## Which calculator
| Question | Command |
|---|---|
| Trace width for a current, or current for a width | `scripts/trace_calc.py width` / `current` |
| Trace resistance, voltage drop, loss | `scripts/trace_calc.py resistance` |
| Via current, resistance, thermal resistance, how many vias | `scripts/trace_calc.py via` |
| Microstrip / stripline / offset stripline / grounded CPW impedance or width | `scripts/impedance_calc.py <structure>` (list presets: `stackups`) |
| Differential pair (USB 90 Ω, Ethernet 100 Ω) | `scripts/impedance_calc.py diff-microstrip` / `diff-stripline` |
| Buck or boost power stage (L, ripple, peak current, Cout, Cin RMS, on-time) | `scripts/power_stage.py buck` / `boost` |
| LDO dropout, dissipation, Tj, maximum current | `scripts/power_stage.py ldo` |
| Feedback divider with E-series and worst case | `scripts/power_stage.py divider` |
| Enable-pin UVLO divider (start / stop voltage) | `scripts/power_stage.py uvlo` |
| Does this source (USB, battery, adapter) still meet the regulator after diodes and switches | `scripts/power_stage.py source-check` |
| Junction temperature, heatsink θSA, power derating, copper-area θJA | `scripts/thermal_calc.py tj` / `heatsink` / `derate` / `copper` |
| Resistor, LDO or MOSFET-conduction dissipation | `scripts/thermal_calc.py resistor` / `ldo` / `conduction` |
| MOSFET conduction, switching, gate-drive and dead-time loss, Tj | `scripts/mosfet_calc.py` |
| Battery life of a duty-cycled device | `scripts/battery_life.py` |
| Voltage divider (forward or design), scaling into an ADC, ADC source impedance | `scripts/divider_calc.py forward` / `design` / `adc` |
| RC, LC / RLC, Sallen-Key, MFB filters; Butterworth / Bessel / Chebyshev design | `scripts/filter_calc.py rc` / `rlc` / `sk` / `mfb` / `design` |
| Crystal load capacitors, oscillator gain margin, drive level | `scripts/crystal_caps.py` |
| LED series resistor and current range, GPIO current check | `scripts/led_calc.py` |
| RC charge / discharge, reset delay, debounce, NE555 timing | `scripts/rc_timing.py charge` / `discharge` / `reset` / `debounce` / `astable` / `mono` |
Calculators kept in other skills:
| Question | Command |
|---|---|
| E-series values, series and parallel combinations | `circuit-simulation/scripts/eseries.py` |
| Tolerance corners and Monte Carlo on a netlist | `circuit-simulation/scripts/what_if.py` |
| I2C pull-up range | `interfaces-and-protocols/scripts/i2c_pullup.py` |
| UART baud error | `interfaces-and-protocols/scripts/uart_baud.py` |
| RS-485 bus length, termination, bias, unit loads | `interfaces-and-protocols/scripts/rs485_bus.py` |
| CAN bit timing and oscillator tolerance | `interfaces-and-protocols/scripts/can_bittiming.py` |
| Stepper current, steps per mm, step rate | `motion-control/scripts/stepper_calc.py` |
| Servo pulse, PCA9685 prescale | `motion-control/scripts/servo_calc.py` |
| nRF24 channel plan and retransmit delay | `peripherals/scripts/nrf24_link.py` |
| NFC antenna inductance and matching | `peripherals/scripts/rfid_antenna.py` |
| LoRaWAN airtime and duty cycle | `iot-systems/scripts/lorawan_airtime.py` |
| BLE connection parameters | `iot-systems/scripts/ble_conn_check.py` |
## Defaults and traps
- **Trace width:** `trace_calc.py` uses the IPC-2221 formula (the same constants as `pcb-design/references/power-and-thermal.md`) and also prints a conservative width (the internal-layer result applied to any layer) that covers the IPC-2152 values in that reference. Use the conservative width for power nets; IPC-2152 itself is a sold standard and is not implemented.
- **Vias:** ask whether a size is the drill or the finished hole; the plated area differs (π·t·(d−t) against π·t·(d+t)). The default plating is JLCPCB's stated 18 µm average.
- **Impedance:** results are for uncoated outer layers (solder mask lowers microstrip impedance a few ohms); confirm production impedance in the fab's calculator and order impedance control. The ±10 % tolerance check is JLCPCB's figure.
- **Regulators:** run `source-check` whenever an input passes through a diode, switch or long cable; a USB port at 4.75 V minus a Schottky drop can sit below a buck's 4.5 V minimum input. Check the minimum on-time at the highest input and lowest output.
- **Ceramic capacitors** lose capacitance with DC bias; feed the derated value into ripple and filter calculations (maker DC-bias curves).
- **θJA** depends on the JEDEC test board; real boards differ. Prefer ψJT with a measured case temperature, or the maker's θJA-versus-copper-area data (`thermal_calc.py copper`).
- **Battery life:** include regulator quiescent current, self-discharge and capacity derating; the sleep current usually dominates.
- **ADC dividers:** a high-value divider without a capacitor starves the sampling capacitor; `divider_calc.py adc` checks this against the user's ADC model.
- **Crystals:** CL is not C1 = C2 = CL; the load capacitors are about 2 × (CL − Cstray). Check the gain margin too.
- **Active filters:** check the op-amp gain-bandwidth (`filter_calc.py` warns), and simulate high-Q stages.
## References
| File | Read it for |
|---|---|
| `references/pcb-calculations.md` | Copper, via and impedance formulas, when each applies, JLCPCB worked examples, USB 90 Ω / Ethernet 100 Ω / RF 50 Ω targets, traps |
| `references/power-and-thermal-calculations.md` | Buck, boost and LDO procedures, UVLO and feedback dividers, source checks, θ chains and heatsinks, MOSFET losses, battery life, traps and corrections |
| `references/analog-and-timing-calculations.md` | Dividers and ADC inputs, passive and active filters, crystal oscillators, LEDs, RC timing, reset and debounce, NE555 |
## Scripts
| Script | What it answers |
|---|---|
| `scripts/trace_calc.py` | IPC-2221 width for a current or current for a width, with a conservative width covering IPC-2152; trace resistance, drop and loss; current, resistance and thermal resistance of N vias |
| `scripts/impedance_calc.py` | Z0 / Zdiff, εeff, delay, C and L for microstrip, stripline, offset stripline, grounded CPW and edge-coupled pairs, or the width / gap for a target; JLCPCB stackup presets |
| `scripts/power_stage.py` | Buck and boost power stage (TI SLVA477B / SLVA372D), LDO dropout and Tj, feedback divider worst case, EN-pin UVLO divider, source-check of the input chain |
| `scripts/thermal_calc.py` | Tj from θJA, θJC + θCS + θSA or ψJT; heatsink θSA; resistor, LDO and MOSFET dissipation with derating; θJA against copper area from published points |
| `scripts/mosfet_calc.py` | Conduction (RDS(on) temperature factor or slope), switching, gate-drive and dead-time loss, total loss and Tj |
| `scripts/battery_life.py` | Average current, life and dominant state of a duty-cycled load with regulator Iq and efficiency, self-discharge and derating |
| `scripts/divider_calc.py` | Divider forward / design with tolerance worst case; ADC scaling, source impedance against the sampling model (ST AN2834), pin capacitor and fault clamp current |
| `scripts/filter_calc.py` | RC, LC / RLC, Sallen-Key, MFB both directions; Butterworth / Bessel / Chebyshev design of order 2–6 (TI SLOA049D tables), tolerance corners, GBW check |
| `scripts/crystal_caps.py` | Load capacitors from CL and stray, gm_crit and gain margin, drive level and Rext, pulling (ST AN2867) |
| `scripts/led_calc.py` | LED series resistor with E-series pick, current range, resistor power, GPIO pin and total current |
| `scripts/rc_timing.py` | RC charge / discharge and the inverse, reset delay over tolerances, debounce against Schmitt thresholds, NE555 astable / monostable |
All scripts follow the plugin convention: a readable report, one JSON object with `--json`, exit 0 ok or warn, 1 a check failed, 2 usage error; settings from the command line, then `[script]` (and `[script.subcommand]`) in `boulder.toml`, then built-in defaults that only cover non-critical choices.
## Related skills
- `electronics-fundamentals`: what the formulas mean and how to choose the parts.
- `pcb-design`: layout rules that use these numbers (widths, stackups, thermal relief, impedance routing).
- `circuit-simulation`: SPICE for loops, transients and filters beyond the formulas.
- `kicad-generator` and `kicad-projects`: put the computed widths and net classes into the board.
- `parts-sourcing`: check stock and price for the parts the calculation picked.
## Next step
When this is done, say what comes next: record the result in the decision log; `circuit-simulation` where no formula covers the behaviour, `pcb-design` for the layout rule that goes with the number.
Files in this skill
- SKILL.md
- references/analog-and-timing-calculations.md
- references/pcb-calculations.md
- references/power-and-thermal-calculations.md
- scripts/battery_life.py
- scripts/crystal_caps.py
- scripts/divider_calc.py
- scripts/filter_calc.py
- scripts/impedance_calc.py
- scripts/led_calc.py
- scripts/mosfet_calc.py
- scripts/power_stage.py
- scripts/rc_timing.py
- scripts/tests/test_battery_life.py
- scripts/tests/test_crystal_caps.py
- scripts/tests/test_divider_calc.py
- scripts/tests/test_filter_calc.py
- scripts/tests/test_impedance_calc.py
- scripts/tests/test_led_calc.py
- scripts/tests/test_mosfet_calc.py
Attribution
Related skills
View all in ai-agents →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.