Skip to article frontmatterSkip to article content

Introduction to LTspice for Circuit Simulation

LTspice is a free, high-performance SPICE simulator widely used in electrical engineering education and industry. In this project, you will use LTspice to verify your circuit designs for the power supply, power amplifier, and passive loudspeaker filters before building them physically.

Why Simulate Before Building?

Simulation allows you to:

Installation and Guides

Basic LTspice Workflow

The general process for simulating a circuit in LTspice follows these steps:

  1. Draw the circuit schematic using LTspice’s component library and drawing tools

  2. Define the analysis type by adding analysis statements (e.g. .tran for transient/time-domain, .ac for frequency response)

  3. Configure signal sources appropriate to your analysis (AC voltage, DC bias, pulse signals, etc.)

  4. Run the simulation and examine the results

  5. Interpret the results in the context of your design specifications

Drawing Your Schematic

When you open LTspice, you create a new schematic by:

Take time to organize your schematic logically—group related components together, avoid excessive wire crossings, and use clear labeling. A well-organized schematic makes it easier to verify that you’ve built the correct circuit and simpler to debug if results don’t match expectations.

See here: Guidelines for Drawing Schematics

Ground Node Requirement

Every SPICE circuit simulation requires at least one ground node (node 0). This serves as the voltage reference point (0 V) for all other voltages in the circuit.

Analysis Types and Signal Sources

Different analyses require different types of signal sources. The choice depends on what you want to know about the circuit.

With transient analysis, you can e.g. check power supply ripple and verify maximum amplifier input voltage before clipping of the output waveform because of a limited supply voltage.

With AC analysis, you can e.g. plot the frequency response (magnitude and phase) of e.g. loudspeaker filters or a power amplifier.

Transient Analysis (.tran)

Signal source setup:

On windows, use the menu. On mac, right mouse click > Draft > SPICE Directive

Example transient statement:

.tran 50m

This simulates 50 milliseconds of circuit behavior, starting from time zero. The .tran directive has more settings, on Mac you can find them using the LTspice help menu.

AC Analysis (.ac)

Signal source setup:

Example AC source declaration: In component properties, set the source to have both DC and AC components:

On windows, use the menu. On mac, right mouse click > Draft > SPICE Directive

Example AC analysis statement:

.ac dec 100 10 100k

This simulates the frequency response from 10 Hz to 100 kHz with 100 points per decade (logarithmic sweep).

In general:

.ac <oct, dec, lin> <Nsteps> <StartFreq> <EndFreq>

The frequency is swept between frequencies StartFreq and EndFreq. The number of steps is defined as Nsteps per octave (oct), decade (dec) or linearly spaced (lin) between StartFreq and EndFreq

Setting Up Sources for Different Circuits

Power Supply Circuit

Power Amplifier Circuit

Passive Loudspeaker Filters

Running Your First Simulation

  1. Complete your schematic and add the appropriate SPICE directive (type of analysis to run)

  2. Start simulation (▶ on Windows, running figure on Mac)

  3. LTspice opens a waveform viewer, use the probe in the schematics window to select signals to show or use the add trace button The add trace button also allows to plot mathematical functions of wave values, including voltage differences.

  4. Examine the plots—do they match your expectations?

  5. If not, check:

    • Component values and connections

    • Source definitions and amplitude

    • Analysis parameters (frequency range, time span, etc.)

Multi-Step Simulation (Advanced)

Multi-step simulations allow you to automatically run multiple simulations while stepping component values or source parameters through a range of values.

Purpose:

Preparation: Use symbolic component and source values

Instead of fixed numeric values, assign symbolic names, e.g:

SPICE directive for parameter stepping:

Use the .step command in combination with the analysis statement (can also be .ac instead of .tran):

.tran 0 100m
.step param R_load 5k 10k 1k

This runs a transient analysis for each value of R_load from 5 kΩ to 10 kΩ in 1 kΩ steps (values: 5k, 6k, ..., 10k)

Viewing results:

Use the waveform viewer’s Stepping feature to navigate between results. Right-click on traces to select which parameter values to display.

Tips for Successful Simulations

Creating Schematic and Waveform Figures

Schematics

LTSpice circuits can be neatly included in your reports by printing them to pdf. The result is the circuit on a white background. Then take a screenshot, and save as png (preferred) or jpg. Enlarging the image before taking the screenshot (on a reasonable screen) will usually produce an image with a good enough resolution.

Windows
Mac
  • In the schematic window, go to File > Print Preview

  • Alternatively, print to pdf directly

  • Enlarge and zoom

  • Take and save screenshot, can use standard windows Snipping Tool app

Waveforms

Waveforms can be exported to text files, for further processing using e.g. Python (with matplotlib) or most any other graphing tool.

Windows
Mac
  • With the plot window active, go to File > Export data as text

  • Select the waveforms for export

  • Select where on your computer you want to store the exported data as a text file

  • Click OK