Loading...
Loading...
Analyzes KiCad PCB files to identify power nets by looking up component datasheets via AI. Use when you need to determine which nets are power/ground nets and what track widths to use, especially when KiCad pintype annotations are missing or unreliable.
npx skill4agent add drandyhaas/kicadroutingtools analyze-power-netsfrom analyze_power_paths import (
analyze_pcb, get_components_needing_analysis, classify_component,
trace_power_paths, get_power_net_recommendations, format_analysis_report,
ComponentRole
)
components, pcb_data = analyze_pcb("path/to/file.kicad_pcb")
unknown = get_components_needing_analysis(components)| Prefix | Role | Reason |
|---|---|---|
| R (resistor) | SHUNT | Pull-ups, voltage dividers |
| C (capacitor) | SHUNT | Decoupling caps |
| L (inductor) | PASS_THROUGH | Series filter element |
| FB (ferrite bead) | PASS_THROUGH | Series filter element |
| F (fuse) | PASS_THROUGH | Series protection |
| LED | CURRENT_SINK | Consumes current |
| SW (switch) | PASS_THROUGH | Power switching |
unknownWebSearch: "<part_value> <footprint_hint> datasheet""DB9 connector pinout""1N4004 diode datasheet""3906 transistor datasheet""LT1129 regulator datasheet""MCF5213 power consumption"| Role | Criteria |
|---|---|
| POWER_SOURCE | Supplies current to the board: power jacks, battery connectors, regulator outputs, USB power inputs |
| CURRENT_SINK | Consumes significant current: ICs, MCUs, CPLDs, FPGAs, motor drivers, high-power LEDs |
| PASS_THROUGH | Current flows through it: power switches, transistors used as switches, protection diodes in series |
| SHUNT | Branches off the power path: ESD protection diodes, TVS diodes, signal connectors |
classify_component(components, 'J201', ComponentRole.POWER_SOURCE,
current_rating_ma=1000,
notes="DC barrel jack - main power input")paths = trace_power_paths(pcb_data, components)
recommendations = get_power_net_recommendations(pcb_data, components, paths)print(format_analysis_report(pcb_data, components, paths, recommendations))--power-nets## Power Net Analysis for board.kicad_pcb
### AI-Classified Components
| Ref | Value | Role | Current | Notes |
|-----|-------|------|---------|-------|
| J201 | JACK_2P | POWER_SOURCE | 1000mA | DC power input |
| U102 | MCF5213 | CURRENT_SINK | 200mA | ColdFire MCU |
### Power Paths Traced
TB201 (power input) → SW_ONOFF201 → F201 → VR201 → +3.3V → U102 (MCU)
### Recommended Power Nets
| Net | Width | Reason |
|-----|-------|--------|
| Net-(TB201-P1) | 0.5mm | Power input path |
| Net-(F201-Pad1) | 0.5mm | After fuse |
| +3.3V | 0.5mm | Main rail, 500mA total |
| /VDDPLL | 0.3mm | PLL supply, 10mA |
### Routing Command
--power-nets "GND" "+3.3V" "/VDDPLL" "/VCCA" "Net-(TB201-P1)" --power-nets-widths 0.5 0.5 0.3 0.3 0.5