Inquire: Call 0086-755-23203480, or reach out via the form below/your sales contact to discuss our design, manufacturing, and assembly capabilities.
Quote: Email your PCB files to Sales@pcbsync.com (Preferred for large files) or submit online. We will contact you promptly. Please ensure your email is correct.
Notes: For PCB fabrication, we require PCB design file in Gerber RS-274X format (most preferred), *.PCB/DDB (Protel, inform your program version) format or *.BRD (Eagle) format. For PCB assembly, we require PCB design file in above mentioned format, drilling file and BOM. Click to download BOM template To avoid file missing, please include all files into one folder and compress it into .zip or .rar format.
Running circuit simulations before ordering PCBs has saved me from countless expensive mistakes. If you’re designing in KiCad and haven’t explored its built-in simulation capabilities yet, you’re missing out on one of the most powerful features the software offers. The KiCad ngspice integration gives you professional-grade circuit analysis without leaving your schematic editor.
This guide covers everything from basic ngspice KiCad setup to importing manufacturer SPICE models, using LTspice KiCad conversion workflows, and handling the quirks of KiCad PSpice model compatibility. I’ve been through the learning curve and made plenty of mistakes, so hopefully this saves you some frustration.
Understanding KiCad’s Built-in SPICE Simulator
KiCad ships with ngspice embedded directly into the schematic editor. This isn’t a separate download or plugin. Starting from KiCad 5, and significantly improved in versions 6 through 8, the simulator is ready to use out of the box. When you install KiCad, ngspice comes bundled with it.
The KiCad ngspice integration supports four primary analysis types:
Analysis Type
Purpose
Typical Use Case
Operating Point (OP)
Calculates DC quiescent state
Checking bias points in amplifiers
DC Transfer (DC Sweep)
Varies DC source over a range
Plotting I-V characteristics, transfer functions
AC Sweep
Small-signal frequency analysis
Filter response, gain/phase plots
Transient (TRAN)
Time-domain simulation
Switching circuits, pulse response
The simulator also supports custom SPICE directives, giving you access to additional ngspice capabilities like noise analysis, Fourier analysis, and pole-zero calculations when needed.
What Makes ngspice Compatible with Other SPICE Flavors
Here’s where things get interesting for engineers coming from other tools. The ngspice KiCad combination can read models designed for multiple SPICE dialects. Ngspice internally translates syntax from PSpice, LTspice, and HSpice before running simulations. This means you can often use manufacturer-provided models directly without modification.
When you enable “PSpice and LTSpice” compatibility mode in KiCad’s simulation settings, ngspice handles the translation automatically. This is critical because most semiconductor manufacturers provide their SPICE models in PSpice format.
Setting Up Your First KiCad Simulation
Let’s walk through a practical setup. The workflow involves three main steps: building a simulation-ready schematic, configuring component models, and running the analysis.
Using the Simulation_SPICE Library
KiCad includes a dedicated symbol library called Simulation_SPICE containing components specifically designed for simulation. These differ from standard schematic symbols in important ways:
Component Type
Standard Symbol
Simulation Symbol
Voltage Source
Generic power symbol
VDC, VAC, VSIN, VPULSE
Current Source
Generic symbol
IDC, IAC, ISIN, IPULSE
Ground
PWR_FLAG or power symbol
“0” (zero reference)
Resistor
R
R (same, with value)
Capacitor
C
C (same, with value)
The key difference is the ground symbol. Ngspice requires a “0” node as the reference for all voltage measurements. Using KiCad’s power symbols without this explicit ground connection will cause simulation failures. Always place the “0” symbol from Simulation_SPICE and connect it to your circuit’s ground reference.
Configuring Component Values
For passive components (resistors, capacitors, inductors), simply enter the value in the component’s Value field. Ngspice understands standard engineering notation:
10k = 10,000 ohms
100n = 100 nanofarads
4.7u = 4.7 microhenries
For active components like transistors and op-amps, you’ll need to configure simulation models. Double-click the component, select “Simulation Model,” and you’ll see options for assigning external model files or using built-in generic models.
Running Your First Analysis
With your schematic ready, launch the simulator from Inspect → Simulator. The simulator window opens with options for different analysis types. For a basic transient analysis:
Click “New Analysis Tab” (Ctrl+N)
Select TRAN from the dropdown
Enter time step (e.g., 10u for 10 microseconds)
Enter final time (e.g., 10m for 10 milliseconds)
Click Run (R)
After simulation completes, use the probe tool or Add Signals button to plot voltages at nodes (V(nodename)) or currents through components (I(componentname)).
Using External SPICE Models in KiCad
The generic models built into KiCad work for quick checks, but real design work requires accurate manufacturer models. This is where KiCad PSpice compatibility becomes essential.
Finding Manufacturer Models
Most semiconductor manufacturers provide free SPICE models on their websites. Common sources include:
Manufacturer
Model Format
Notes
Texas Instruments
PSpice (.lib)
Extensive library, well-documented
Analog Devices
LTspice (.lib)
High-quality op-amp and converter models
ON Semiconductor
PSpice (.lib)
Good transistor coverage
Infineon
PSpice (.lib)
Power device models
Diodes Inc.
PSpice (.lib)
Broad catalog coverage
STMicroelectronics
PSpice (.lib)
MOSFETs, IGBTs, thyristors
Download the .lib or .mod file and place it in your project directory. Keeping models local to the project prevents broken references when moving projects between computers.
Assigning Models to Schematic Symbols
The process for assigning an external model:
Double-click the component in your schematic
Click “Simulation Model…”
In the Simulation Model Editor, click “From File” to add your downloaded .lib file
Select the specific model from the dropdown if the file contains multiple definitions
Check the Pin Assignments tab to ensure symbol pins map correctly to model pins
That last step catches most beginners. A schematic symbol might have pins numbered 1-2-3 for collector-base-emitter, but the SPICE model expects 1-2-3 for collector-base-emitter in that exact order. If they don’t match, you’ll get incorrect simulation results or errors.
Handling Pin Assignment Mismatches
Pin mapping is the most common source of simulation problems with external models. Consider a SOT-23 package transistor: the physical package has pins in a certain order, but ngspice always expects BJTs in collector-base-emitter order (pins 1-2-3).
In the Simulation Model Editor’s Pin Assignments tab, you’ll see two columns:
Symbol Pin (from your KiCad symbol, fixed)
Model Pin (from the SPICE model, adjustable)
Rearrange the Model Pin column so that collector matches collector, base matches base, and emitter matches emitter across the same row. For MOSFETs, the expected order is drain-gate-source.
LTspice Integration with KiCad
Many engineers prefer LTspice for simulation due to its extensive model library and fast solver. There are two approaches to LTspice KiCad integration: using LTspice models in KiCad’s ngspice, or exporting from KiCad to simulate in LTspice directly.
Using LTspice Models in KiCad ngspice
LTspice models work in ngspice KiCad with the compatibility mode enabled. The process is identical to using PSpice models:
Download the LTspice model (.lib or .mod file)
Copy it to your project directory
Assign it to your component via Simulation Model Editor
Verify pin assignments
LTspice’s built-in models for Analog Devices parts are particularly valuable since they’re well-validated against real silicon.
Converting LTspice Schematics to KiCad
If you have existing LTspice to KiCad conversion needs, several tools exist:
The most maintained option is the LTSpiceToKiCadConverter project on GitHub (FOSSEE repository). This Python-based tool converts .asc schematic files to KiCad format. The workflow:
Limitations exist with this conversion. Hierarchical schematics don’t transfer, and component positioning may need manual cleanup. But for getting a simulation circuit into KiCad for PCB layout, it saves significant redrawing time.
KiCad to LTspice Workflow
Going the other direction, from KiCad to LTspice, requires generating a netlist and some manual work. The KiCadToLTspice project provides a more automated approach:
Install the KiCadToLTspice Python script
Configure paths to your LTspice installation
Generate netlist from KiCad using the Spice netlist format
Run the conversion script
This workflow is particularly useful when you want LTspice’s faster simulation engine for complex analog circuits or need access to specific LTspice features like .step parameter sweeps that aren’t fully supported in KiCad’s ngspice interface.
PSpice Model Compatibility in KiCad
The KiCad PSpice story is mostly positive. Ngspice handles the majority of PSpice syntax without issues. However, some edge cases require attention.
Compatibility Mode Settings
In the Simulator Settings dialog, ensure “PSpice and LTSpice” compatibility mode is enabled. This activates ngspice’s internal translator for:
PSpice-specific device syntax
LTspice behavioral source syntax
Common extensions to standard SPICE syntax
Common PSpice Model Issues
Some manufacturer PSpice models use features not supported by ngspice:
Feature
Status in ngspice
Workaround
Encrypted models
Not supported
Find alternative unencrypted model
.STEP command
Limited support
Use multiple simulations manually
ABM behavioral models
Partially supported
May need syntax adjustment
Advanced convergence hints
Often ignored
Use ngspice .options instead
When a TI or other manufacturer model fails to simulate, check the ngspice console output for specific errors. Common fixes include:
Removing unsupported .options statements
Simplifying behavioral source expressions
Checking for encrypted subcircuit definitions (these simply won’t work)
Advanced Simulation Techniques
Once you’re comfortable with basic simulation, several advanced features become valuable.
Embedding SPICE Directives in Schematics
You can add SPICE commands directly to your schematic as text. This preserves your simulation setup with the design. Use Place → Add Text and enter directives like:
.tran 1u 10m.ac dec 10 1 100k
These embedded directives are included in the generated netlist and executed when you run simulations.
Using the Tuning Tool
KiCad 8 introduced an interactive tuning feature. After running a simulation, click “Select a value to be tuned” and choose a component. A slider appears allowing real-time parameter adjustment with immediate re-simulation. This is excellent for optimizing filter cutoffs or amplifier gain.
Operating Point Display
After running an OP analysis, KiCad can display DC voltages and currents directly on the schematic. This makes checking bias conditions quick and intuitive without needing to probe individual nodes.
Useful Resources and Downloads
Building a good model library takes time. Here are the resources I rely on:
The .lib file path is correct (no spaces in path names)
The model name in your component matches exactly (case-sensitive)
The file isn’t encrypted
Unexpected Simulation Results
When results don’t match expectations:
Verify pin assignments in the Simulation Model Editor
Check component values (10k vs 10K can be different)
Confirm your ground reference is connected correctly
Try a simpler test circuit with known behavior
Best Practices for Reliable Simulations
After running hundreds of simulations, I’ve developed some habits that prevent common problems.
Keep Simulation Schematics Separate
Create dedicated simulation projects or hierarchical sheets rather than simulating your full production schematic. A focused test circuit with ideal sources and loads makes debugging much easier. Copy the relevant subcircuit into a separate sheet, add appropriate stimulus sources, and simulate in isolation.
Version Control Your Models
Store SPICE models in your project directory and include them in version control. Nothing breaks a simulation faster than a missing model file when you revisit a project months later. Document where each model came from in case you need to update it.
Validate Against Known Behavior
Before trusting simulation results for a new design, verify your setup against a circuit with known behavior. A simple RC filter with calculable response confirms your analysis types work correctly. This catches configuration issues before they mask real design problems.
Frequently Asked Questions
Can I use encrypted manufacturer SPICE models in KiCad?
No. Ngspice cannot decrypt proprietary encrypted models from vendors like some commercial SPICE tools can. If a manufacturer only provides encrypted models, you’ll need to find an alternative unencrypted model or use a different part with available models. Most major manufacturers provide unencrypted options for common parts.
Why won’t my TI PSpice model work in KiCad ngspice?
Some TI models use PSpice-specific features that ngspice doesn’t support. Enable PSpice compatibility mode in Simulation Settings first. If errors persist, check the ngspice console for specific unsupported statements. You may need to edit the .lib file to remove or comment out problematic lines, or find an alternative model.
How do I simulate a circuit with both digital and analog components?
Ngspice supports mixed-signal simulation using XSPICE digital models. The 74xx series logic gates have models available at the ngspice website. For KiCad symbols, you’ll need to assign these models manually and configure appropriate interface components between analog and digital sections. This is advanced usage and requires careful attention to timing models.
Can I import my entire LTspice project into KiCad?
Partially. Tools like LTSpiceToKiCadConverter handle schematic conversion, but you’ll need to manually verify component assignments and may need to reconfigure simulation models. Hierarchical schematics don’t convert directly. It’s often easier to rebuild simple simulation circuits in KiCad rather than convert complex LTspice projects.
Why is my transient simulation taking forever?
Long simulation times usually result from either very small time steps or convergence difficulties causing many iterations. Check that your time step isn’t unnecessarily small for your circuit’s frequency content. For switching power supplies, add snubber networks to reduce high-frequency ringing that forces small time steps. The .options directive can also adjust solver parameters for better performance.
Conclusion
The KiCad ngspice combination provides professional simulation capabilities at no cost. Once you understand the workflow for using external models and handling pin assignments, it becomes a natural part of the design process. The ability to catch design errors before fabrication easily justifies the learning curve.
Whether you’re using native ngspice KiCad simulation, importing LTspice KiCad models, or working with KiCad PSpice manufacturer files, the key is building up a library of known-good models and understanding the quirks of each analysis type. Start simple, verify against known circuits, and gradually tackle more complex simulations as your confidence grows.
For those coming from LTspice to KiCad workflows, the transition is manageable. The core SPICE concepts are identical, and most models work with minimal modification. The integration into KiCad’s schematic editor means you can simulate and lay out boards in the same environment, which streamlines the entire design flow.
Inquire: Call 0086-755-23203480, or reach out via the form below/your sales contact to discuss our design, manufacturing, and assembly capabilities.
Quote: Email your PCB files to Sales@pcbsync.com (Preferred for large files) or submit online. We will contact you promptly. Please ensure your email is correct.
Notes: For PCB fabrication, we require PCB design file in Gerber RS-274X format (most preferred), *.PCB/DDB (Protel, inform your program version) format or *.BRD (Eagle) format. For PCB assembly, we require PCB design file in above mentioned format, drilling file and BOM. Click to download BOM template To avoid file missing, please include all files into one folder and compress it into .zip or .rar format.