# AI-PCB-Generator **Repository Path**: RexHuang936/AI-PCB-Generator ## Basic Information - **Project Name**: AI-PCB-Generator - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-06-29 - **Last Updated**: 2026-06-29 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README

AI PCB Generator Logo

๐Ÿš€ AI PCB Generator

The world's first fully AI-powered, open-source PCB design suite.
From natural language to production-ready PCBs โ€” in minutes, not weeks.

Describe your circuit in plain English or Turkish โ†’ AI generates the full schematic โ†’ auto-places components โ†’ routes traces โ†’ simulates the circuit โ†’ runs DFM analysis โ†’ exports Gerber files โ†’ orders from JLCPCB with one click.

![Python](https://img.shields.io/badge/Python-3.10+-3776AB?logo=python&logoColor=white) ![License](https://img.shields.io/badge/License-MIT-green) ![Qt](https://img.shields.io/badge/GUI-PySide6%2FQt6-41CD52?logo=qt&logoColor=white) ![KiCad](https://img.shields.io/badge/KiCad-9.0-314CB0) ![NgSpice](https://img.shields.io/badge/SPICE-NgSpice%2046-orange) ![Platform](https://img.shields.io/badge/Platform-Windows%20%7C%20macOS%20%7C%20Linux-lightgrey) [![Buy Me A Coffee](https://img.shields.io/badge/Buy%20Me%20A%20Coffee-Support-FFDD00?logo=buymeacoffee&logoColor=black)](https://buymeacoffee.com/otis21)

--- ## ๐ŸŒŸ Why AI PCB Generator? Traditional PCB design takes **days or weeks** โ€” you need to learn complex EDA tools, manually draw schematics, place components, route traces, run checks, and generate manufacturing files. **AI PCB Generator does all of this in under 5 minutes.** Just describe what you want in plain text, and the AI handles everything from circuit design to production-ready output. > ๐Ÿ’ฌ *"Design a motor driver board with L298N, 12V input, 5V regulator, PWM headers, and flyback diodes"* > > โšก **Result:** Complete schematic + PCB layout + 3D view + SPICE simulation + DFM analysis + Gerber ZIP โ€” ready to order. --- ## โœจ Key Features ### ๐Ÿง  AI-Powered Circuit Design Type a description in **natural language** and the AI generates a complete circuit specification โ€” components, pin connections, net assignments, footprints, and placement. Supports **OpenAI GPT-4o**, **Google Gemini**, **Anthropic Claude**, or any OpenAI-compatible API. ### ๐Ÿ“ Interactive Drag & Drop Schematic Editor Full-featured schematic editor with **drag-and-drop** component placement, **real-time wire drawing**, undo/redo, and a searchable component palette with 18+ categories. Edit AI-generated designs or build from scratch. ### ๐Ÿค– AI Co-Pilot with ERC Engine Built-in **Electrical Rules Check** with 8 automated rules โ€” unconnected power pins, missing resistors on LEDs, no ground, multiple output conflicts, missing decoupling capacitors, and more. Smart **pin alias matching** (VINโ†”IN, GNDโ†”VSS) eliminates false positives. ### โšก Real-Time SPICE Simulation Simulate your circuit **before manufacturing** with integrated **NgSpice 46** support: - **DC Operating Point** โ€” Node voltages and branch currents - **Transient Analysis** โ€” Time-domain waveforms - **AC Frequency Sweep** โ€” Bode plots and frequency response - **DC Sweep** โ€” Transfer characteristics Built-in **MNA (Modified Nodal Analysis) solver** works even without NgSpice installed โ€” no external tools required for basic simulations. ### ๐Ÿ” AI Design Review & DFM Analysis **12 manufacturing-focused checks** powered by industry standards (IPC-2221): | Check | Description | |-------|-------------| | DFM-001 | Power trace current capacity validation | | DFM-002 | Annular ring verification (via & pad) | | DFM-003 | Acid trap detection (acute-angle junctions) | | DFM-004 | Thermal relief recommendations | | DFM-005 | Silkscreen over pad detection | | DFM-006 | Component spacing for pick-and-place | | DFM-007 | Board dimension validation | | DFM-008 | Via aspect ratio check | | DFM-009 | Copper balance analysis | | DFM-010 | Solder bridge risk detection | | DFM-011 | Minimum drill size verification | | DFM-012 | Differential pair length mismatch | Each issue comes with a **0-100 manufacturability score**, severity rating (Critical/Warning/Info), and actionable **fix recommendations**. ### ๐Ÿญ One-Click PCB Manufacturing Go from design to **production order** with a single click: - **Manufacturer Profiles** โ€” JLCPCB, PCBWay, OSH Park with real capability limits - **Live Cost Estimation** โ€” PCB cost + SMT assembly breakdown, updated as you change quantity - **Production Package** โ€” Generates everything you need: - ๐Ÿ“ฆ **Gerber ZIP** โ€” Ready to upload to any manufacturer - ๐Ÿ“‹ **BOM CSV** โ€” JLCPCB-compatible Bill of Materials - ๐Ÿ“ **Pick & Place CPL** โ€” Component placement for SMT assembly - ๐Ÿ”ง **KiCad PCB** โ€” For further editing in KiCad - **Lead Time Display** โ€” Know exactly when your boards will arrive - **Capability Validation** โ€” Warns if your design exceeds manufacturer limits ### ๐Ÿ–ฅ๏ธ Professional 3D PCB Viewer Realistic isometric **3D visualization** with: - KiCad `.wrl` 3D model loading (VRML 2.0 parser) - 18+ built-in component models (resistors, capacitors, ICs, connectors, LEDs...) - Layer toggles (copper, silkscreen, 3D models, wires) - Smooth rotation, pan, and zoom controls ### ๐Ÿ”ง PCB Layout Engine - KiCad-quality **EDA-style** layout rendering - Grid-based auto-placement with intelligent grouping - **Freerouting** integration for automatic trace routing - Layer support (F.Cu, B.Cu, inner layers) - Real-time **DRC** (Design Rule Check) with pad clearance, trace width, via drill validation ### ๐Ÿ“ฆ Multi-Format Export - **KiCad** `.kicad_pcb` โ€” Open directly in KiCad 9.0 - **Gerber** RS-274X + Excellon drill โ€” Standard manufacturing format - **SVG** โ€” High-quality vector graphics - **JSON** โ€” Full circuit data for automation > Export fix (March 17, 2026): Gerber silkscreen export now derives component body bounds from pad geometry, resolving the `'PlacedComponent' object has no attribute 'width_mm'` crash seen during exports such as Arduino Uno Shield. ### ๐Ÿ› ๏ธ Bundled Vendor Tools All critical tools come **pre-bundled** โ€” no separate installation needed: > Freerouting fix (March 17, 2026): Production file generation now falls back to the internal A* router when Freerouting fails or produces no SES output, instead of aborting the manufacturing/export workflow. | Tool | Version | Status | |------|---------|--------| | NgSpice | 46 | โœ… Bundled in `vendor/` | | Freerouting | 2.1.0 | โœ… Bundled in `vendor/` | | KiCad | 9.0 | ๐Ÿ” Auto-detected | Run `python setup_vendor.py` to download vendor tools automatically. ### ๐ŸŒ Multi-Language & Theming - Full **Turkish** and **English** UI - **Dark** and **Light** themes - Live language switching โ€” no restart needed --- ## ๐Ÿ— Architecture ``` User Input (Natural Language) โ”‚ โ–ผ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ AI Engine โ”‚ GPT-4o / Gemini / Claude / Any LLM โ”‚ (OpenAI API) โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ CircuitSpec (Pydantic JSON) โ–ผ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Schematic โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚ AI Co-Pilot โ”‚ โ”‚ Editor โ”‚ โ”‚ (8 ERC Rules) โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ–ผ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ PCB Generator โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚ DRC Engine โ”‚ โ”‚ + Auto-Router โ”‚ โ”‚ (6 Checks) โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ–ผ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ SPICE Simulator โ”‚ โ”‚ DFM Analysis โ”‚ โ”‚ (NgSpice/MNA) โ”‚ โ”‚ (12 Checks) โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ โ–ผ โ–ผ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Production Output โ”‚ โ”‚ Gerber ZIP โ”‚ BOM CSV โ”‚ CPL โ”‚ KiCad PCB โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ–ผ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ One-Click Manufacturing โ”‚ โ”‚ JLCPCB โ”‚ PCBWay โ”‚ OSH Park โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ ``` --- ## ๐Ÿ“‹ Requirements | Software | Version | Required? | Description | |----------|---------|-----------|-------------| | **Python** | 3.10+ | โœ… Required | Core runtime | | **AI API Key** | โ€” | โœ… Required | OpenAI, Gemini, Claude, or compatible | | **KiCad** | 9.0+ | โšก Recommended | 3D models & advanced export | | **Java** | 11+ | ๐Ÿ”ง Optional | For Freerouting auto-routing | | **NgSpice** | 45+ | ๐Ÿ“ฆ Bundled | SPICE simulation (auto-downloaded) | | **Freerouting** | 2.1+ | ๐Ÿ“ฆ Bundled | Auto-routing (auto-downloaded) | --- ## ๐Ÿš€ Installation ### 1. Clone the repository ```bash git clone https://github.com/22507260/AI-PCB-Generator.git cd AI-PCB-Generator ``` ### 2. Create virtual environment & install ```bash python -m venv venv # Windows venv\Scripts\activate # macOS/Linux source venv/bin/activate pip install -r requirements.txt ``` ### 3. Download vendor tools (NgSpice + Freerouting) ```bash python setup_vendor.py ``` ### 4. Configure API Key ```bash copy .env.example .env # Windows # cp .env.example .env # macOS/Linux # Edit .env and add your AI API key: # OPENAI_API_KEY=sk-... ``` ### 5. Launch ```bash python main.py ``` --- ## ๐Ÿ“– Usage ### โšก Quick Start (5-Step Workflow) 1. **Describe** โ€” Type your circuit in the left panel: ``` Design a sensor board with USB-C 5V input, 3.3V LDO regulator, 3 status LEDs and I2C header. ``` 2. **Generate** โ€” Click **โšก Design** โ†’ AI creates the full schematic 3. **Simulate** โ€” Switch to **โšก Simulation** tab โ†’ Run DC/Transient/AC analysis 4. **Review** โ€” Check the **๐Ÿ” Design Review** tab โ†’ Fix any DFM issues 5. **Manufacture** โ€” Click **๐Ÿญ Manufacture** โ†’ Generate Gerber ZIP + BOM + CPL โ†’ Order ### ๐ŸŽฏ Built-in Templates | Template | Description | |----------|-------------| | ๐Ÿ’ก LED Circuit | Simple LED + current-limiting resistor | | ๐Ÿ”‹ Voltage Regulator | 12V โ†’ 5V โ†’ 3.3V with bypass capacitors | | ๐ŸŽฎ Arduino Shield | 2 buttons + 3 LEDs + I2C + potentiometer | | ๐ŸŒก๏ธ Sensor Module | I2C temperature/humidity + 3.3V regulator | | โš™๏ธ Motor Driver | L298N dual H-bridge + PWM + flyback diodes | | ๐Ÿ”Œ USB-C Power | USB-C input + ESD + polarity protection | ### โŒจ๏ธ Keyboard Shortcuts | Shortcut | Action | |----------|--------| | `Ctrl+N` | New Project | | `Ctrl+O` | Open Project | | `Ctrl+S` | Save Project | | `Ctrl+E` | Export (KiCad/Gerber/SVG/JSON) | | `Ctrl+M` | One-Click Manufacture | | `Ctrl+Z` | Undo | | `Ctrl+Y` | Redo | | `Ctrl+,` | Settings | --- ## ๐Ÿ“ Project Structure ``` AI-PCB-Generator/ โ”œโ”€โ”€ main.py # Application entry point โ”œโ”€โ”€ setup_vendor.py # Vendor tool downloader (NgSpice, Freerouting) โ”œโ”€โ”€ requirements.txt # Python dependencies โ”œโ”€โ”€ src/ โ”‚ โ”œโ”€โ”€ app.py # QApplication bootstrap โ”‚ โ”œโ”€โ”€ config.py # Settings (pydantic-settings + .env) โ”‚ โ”œโ”€โ”€ vendor.py # Vendor tool auto-discovery โ”‚ โ”œโ”€โ”€ ai/ โ”‚ โ”‚ โ”œโ”€โ”€ schemas.py # Pydantic data models (CircuitSpec, etc.) โ”‚ โ”‚ โ”œโ”€โ”€ client.py # LLM API wrapper (OpenAI-compatible) โ”‚ โ”‚ โ”œโ”€โ”€ prompts.py # System prompts + few-shot examples โ”‚ โ”‚ โ””โ”€โ”€ parser.py # AI output validation & repair โ”‚ โ”œโ”€โ”€ pcb/ โ”‚ โ”‚ โ”œโ”€โ”€ generator.py # Board generation + auto-placement โ”‚ โ”‚ โ”œโ”€โ”€ router.py # Freerouting integration โ”‚ โ”‚ โ”œโ”€โ”€ exporter.py # KiCad / Gerber / SVG / JSON export โ”‚ โ”‚ โ”œโ”€โ”€ rules.py # DRC engine (6 design rule checks) โ”‚ โ”‚ โ”œโ”€โ”€ dfm.py # DFM analysis engine (12 checks) โ”‚ โ”‚ โ”œโ”€โ”€ manufacturing.py # One-Click manufacturing pipeline โ”‚ โ”‚ โ””โ”€โ”€ components.py # Component database โ”‚ โ”œโ”€โ”€ simulation/ โ”‚ โ”‚ โ”œโ”€โ”€ engine.py # NgSpice + built-in MNA solver โ”‚ โ”‚ โ””โ”€โ”€ netlist.py # SPICE netlist generator โ”‚ โ”œโ”€โ”€ gui/ โ”‚ โ”‚ โ”œโ”€โ”€ main_window.py # Main window (6-tab layout) โ”‚ โ”‚ โ”œโ”€โ”€ input_panel.py # AI input + template selector โ”‚ โ”‚ โ”œโ”€โ”€ schematic_view.py # Drag & Drop schematic editor โ”‚ โ”‚ โ”œโ”€โ”€ pcb_view.py # KiCad-quality PCB layout viewer โ”‚ โ”‚ โ”œโ”€โ”€ view3d.py # 3D PCB viewer (VRML/OpenGL) โ”‚ โ”‚ โ”œโ”€โ”€ simulation_view.py # SPICE simulation UI + plots โ”‚ โ”‚ โ”œโ”€โ”€ ai_copilot.py # AI Co-Pilot + ERC engine โ”‚ โ”‚ โ”œโ”€โ”€ design_review.py # DFM analysis panel + scoring โ”‚ โ”‚ โ”œโ”€โ”€ manufacturing_dialog.py # One-Click manufacturing dialog โ”‚ โ”‚ โ”œโ”€โ”€ component_panel.py # BOM table โ”‚ โ”‚ โ”œโ”€โ”€ component_palette.py # Drag & Drop component palette โ”‚ โ”‚ โ”œโ”€โ”€ export_dialog.py # Multi-format export dialog โ”‚ โ”‚ โ”œโ”€โ”€ settings_dialog.py # Settings + tool status โ”‚ โ”‚ โ”œโ”€โ”€ i18n.py # Turkish/English translations โ”‚ โ”‚ โ””โ”€โ”€ theme.py # Dark/Light theme engine โ”‚ โ”œโ”€โ”€ models/ โ”‚ โ”‚ โ”œโ”€โ”€ model_registry.py # KiCad 3D model mapping โ”‚ โ”‚ โ””โ”€โ”€ vrml_parser.py # VRML 2.0 mesh parser โ”‚ โ””โ”€โ”€ utils/ โ”‚ โ”œโ”€โ”€ logger.py # Structured logging โ”‚ โ”œโ”€โ”€ file_io.py # Project save/load (.apcb) โ”‚ โ””โ”€โ”€ validators.py # Input validation โ”œโ”€โ”€ vendor/ # Bundled tools (auto-downloaded) โ”‚ โ”œโ”€โ”€ Spice64/ # NgSpice 46 โ”‚ โ””โ”€โ”€ freerouting-2.1.0.jar # Freerouting โ”œโ”€โ”€ data/ โ”‚ โ””โ”€โ”€ templates/ # Built-in circuit templates โ”œโ”€โ”€ assets/ # Icons, fonts, styles โ””โ”€โ”€ tests/ # Unit & integration tests ``` --- ## ๐Ÿงช Testing ```bash pip install -e ".[dev]" pytest ``` --- ## ๐Ÿ“Š Feature Comparison | Feature | AI PCB Generator | KiCad | EasyEDA | Altium | |---------|:---------------:|:-----:|:-------:|:------:| | AI Natural Language Design | โœ… | โŒ | โŒ | โŒ | | Drag & Drop Schematic | โœ… | โœ… | โœ… | โœ… | | SPICE Simulation | โœ… | โœ… | โŒ | โœ… | | DFM Analysis (12 checks) | โœ… | โŒ | โŒ | โœ… | | One-Click Manufacturing | โœ… | โŒ | โœ… | โŒ | | AI Co-Pilot (ERC + fixes) | โœ… | โŒ | โŒ | โŒ | | 3D PCB Viewer | โœ… | โœ… | โœ… | โœ… | | Cost Estimation | โœ… | โŒ | โœ… | โŒ | | Open Source | โœ… | โœ… | โŒ | โŒ | | Free | โœ… | โœ… | โš ๏ธ | โŒ | --- ## ๐Ÿค Contributing 1. Fork the repository 2. Create a feature branch (`git checkout -b feature/awesome-feature`) 3. Commit your changes (`git commit -m 'feat: add awesome feature'`) 4. Push the branch (`git push origin feature/awesome-feature`) 5. Open a Pull Request --- ## ๐Ÿ“„ License MIT License โ€” see the [LICENSE](LICENSE) file for details. ---

Built with โค๏ธ using Python, PySide6/Qt6, and AI
Star โญ this repo if you find it useful!

Buy Me A Coffee