Examples

This section contains practical examples demonstrating Circuit Synth capabilities.

Simple LED Circuit

A basic LED circuit with current limiting resistor:

Complex ESP32 Project

The main example demonstrates a complex ESP32-based project with multiple subcircuits:

This example shows:

  • Hierarchical circuit design

  • Multiple subcircuits (regulator, USB, IMU, debug header)

  • Component reuse and templating

  • Automatic reference designation

  • Net management

Power Supply Circuit

A 3.3V linear regulator circuit:

USB Interface

USB-C connector with ESD protection:

ESP32 Microcontroller

ESP32-C6 microcontroller with decoupling:

Running the Examples

To run the complete example:

# Navigate to the project directory
cd circuit-synth

# Run the example
python example_project/circuit-synth/main.py

# Generate complete KiCad project
python example_project/circuit-synth/main.py

This will generate:

  • ESP32_C6_Dev_Board.json - Circuit netlist data

  • ESP32_C6_Dev_Board/ directory with complete KiCad project files * .kicad_pro - KiCad project file * .kicad_sch - Schematic file * .kicad_pcb - PCB layout file

Advanced Features

Component Templates

Define reusable component templates:

# Define a template
C_10uF_0805 = Component(
    symbol="Device:C", ref="C", value="10uF",
    footprint="Capacitor_SMD:C_0805_2012Metric"
)

# Use the template
cap1 = C_10uF_0805()
cap1.ref = "C1"

Mixed Pin Access

Use both integer and string pin access:

# Integer pin access
regulator[1] += GND

# String pin access
regulator["VIN"] += input_voltage

# Mixed access
resistor[1] += regulator["VOUT"]

Debugging and Visualization

Enable debug features:

gen.generate_project(
    "circuit.json",
    generate_pcb=True,
    draw_bounding_boxes=True,  # Show component boundaries
    force_regenerate=True      # Overwrite existing files
)