Contact Sales & After-Sales Service

Contact & Quotation

  • 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.
Drag & Drop Files, Choose Files to Upload You can upload up to 3 files.

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.

KiCad SPICE Simulation: Complete ngspice & LTspice Integration Guide

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 TypePurposeTypical Use Case
Operating Point (OP)Calculates DC quiescent stateChecking bias points in amplifiers
DC Transfer (DC Sweep)Varies DC source over a rangePlotting I-V characteristics, transfer functions
AC SweepSmall-signal frequency analysisFilter response, gain/phase plots
Transient (TRAN)Time-domain simulationSwitching 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 TypeStandard SymbolSimulation Symbol
Voltage SourceGeneric power symbolVDC, VAC, VSIN, VPULSE
Current SourceGeneric symbolIDC, IAC, ISIN, IPULSE
GroundPWR_FLAG or power symbol“0” (zero reference)
ResistorRR (same, with value)
CapacitorCC (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:

  1. Click “New Analysis Tab” (Ctrl+N)
  2. Select TRAN from the dropdown
  3. Enter time step (e.g., 10u for 10 microseconds)
  4. Enter final time (e.g., 10m for 10 milliseconds)
  5. 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:

ManufacturerModel FormatNotes
Texas InstrumentsPSpice (.lib)Extensive library, well-documented
Analog DevicesLTspice (.lib)High-quality op-amp and converter models
ON SemiconductorPSpice (.lib)Good transistor coverage
InfineonPSpice (.lib)Power device models
Diodes Inc.PSpice (.lib)Broad catalog coverage
STMicroelectronicsPSpice (.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:

  1. Double-click the component in your schematic
  2. Click “Simulation Model…”
  3. In the Simulation Model Editor, click “From File” to add your downloaded .lib file
  4. Select the specific model from the dropdown if the file contains multiple definitions
  5. 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:

  1. Download the LTspice model (.lib or .mod file)
  2. Copy it to your project directory
  3. Assign it to your component via Simulation Model Editor
  4. 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:

  1. Clone the repository
  2. Run: python3 sch_LTspice2Kicad.py “path/to/schematic.asc”
  3. Output files appear in a new folder

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:

  1. Install the KiCadToLTspice Python script
  2. Configure paths to your LTspice installation
  3. Generate netlist from KiCad using the Spice netlist format
  4. 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:

FeatureStatus in ngspiceWorkaround
Encrypted modelsNot supportedFind alternative unencrypted model
.STEP commandLimited supportUse multiple simulations manually
ABM behavioral modelsPartially supportedMay need syntax adjustment
Advanced convergence hintsOften ignoredUse 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:

Official Documentation

Model Libraries

Manufacturer Model Sources

Conversion Tools

Simulation Examples

Troubleshooting Common Simulation Problems

Even with proper setup, simulations sometimes fail. Here are the issues I encounter most frequently and their solutions.

“No DC path to ground”

This error means a node in your circuit has no resistive connection to the ground reference. Common causes include:

  • Capacitor-coupled inputs without a bias resistor
  • Floating op-amp inputs
  • Missing ground symbol connection

Add a high-value resistor (1G ohm) from the floating node to ground if needed for simulation purposes.

“Convergence failed”

The simulator couldn’t find a stable solution. Try these in order:

  1. Check for short circuits or zero-value resistors
  2. Add .options statements: .options rshunt=1G cshunt=1p
  3. Reduce time step for transient analysis
  4. Simplify the circuit to isolate the problem

Model Not Found

If ngspice reports it can’t find a model, verify:

  • 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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Sales & After-Sales Service

Contact & Quotation

  • 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.

Drag & Drop Files, Choose Files to Upload You can upload up to 3 files.

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.