SPICE Simulation Tutorial: How to Use Circuit Simulation

SPICE (Simulation Program with Integrated Circuit Emphasis) is the standard for circuit simulation. It lets you test a circuit design on your computer before building it physically -- saving time, components, and potentially expensive mistakes. This tutorial covers what SPICE simulation is, the three main analysis types, and how to use browser-based SPICE simulation in CircuitDiagramMaker.

What Is SPICE Simulation?

SPICE was developed at the University of California, Berkeley in the 1970s and has become the universal standard for analog circuit simulation. It solves the mathematical equations that describe circuit behavior -- Kirchhoff's laws, Ohm's law, and semiconductor device models -- numerically.

What SPICE Can Do

What SPICE Cannot Do

The Three Main Analysis Types

1. DC Operating Point Analysis

DC analysis finds the steady-state voltages and currents in a circuit with all capacitors fully charged and all inductors carrying constant current. It answers: "What are the voltages and currents right now, after everything has settled?"

When to use DC analysis:

Example: Voltage Divider

A simple voltage divider with a 12V source, R1 = 10k ohms, R2 = 5k ohms:

This seems trivial for a voltage divider, but DC analysis becomes essential for complex circuits with multiple sources, nonlinear devices, and feedback loops.

2. Transient Analysis (Time-Domain)

Transient analysis simulates the circuit over time, showing how voltages and currents change from moment to moment. It answers: "What happens when I turn this circuit on, apply a signal, or change a load?"

When to use transient analysis:

Key settings:

Example: RC Circuit Charging

A 10 microfarad capacitor charging through a 1k-ohm resistor from a 5V source:

Transient analysis plots the voltage versus time curve, showing the exponential charging characteristic.

3. AC Analysis (Frequency Sweep)

AC analysis sweeps a range of frequencies and calculates the circuit's gain (magnitude) and phase shift at each frequency. The results are typically displayed as Bode plots. It answers: "How does this circuit respond to different frequencies?"

When to use AC analysis:

Key settings:

Example: Low-Pass RC Filter

A simple RC low-pass filter with R = 1k ohms, C = 100nF:

The Bode plot from AC analysis visually confirms the filter's frequency response.

Step-by-Step SPICE Tutorial

Step 1: Draw the Circuit

Start by drawing your circuit schematic. Place components, set their values, and connect them with wires. Every circuit needs:

Step 2: Set Component Values

SPICE uses standard engineering notation:

Suffix Multiplier Example
T 10^12 1T = 1 tera
G 10^9 1G = 1 giga
Meg 10^6 1Meg = 1 mega
k 10^3 10k = 10,000
m 10^-3 100m = 0.1
u 10^-6 10u = 10 micro
n 10^-9 100n = 100 nano
p 10^-12 22p = 22 pico

Step 3: Choose Your Analysis Type

Based on what you want to learn about the circuit:

Step 4: Run the Simulation

Click the simulate button. The SPICE engine:

  1. Builds the circuit matrix (nodes and branches)
  2. Solves the equations iteratively (Newton-Raphson for nonlinear circuits)
  3. Generates results for each node and branch

Step 5: View Results

Results are displayed as:

Step 6: Iterate

If the results are not what you expected:

  1. Check component values and connections
  2. Verify the ground reference is connected
  3. Adjust component values and re-simulate
  4. Compare simulation results to hand calculations

Common SPICE Components

Passive Components

Sources

Semiconductors

Practical Simulation Examples

Example 1: LED Current-Limiting Resistor

Verify the correct resistor value for an LED:

DC simulation confirms: LED current = 21.2mA (acceptable)

Example 2: 555 Timer Astable

Simulate a 555 timer generating a 1 kHz square wave:

Example 3: Audio Amplifier Frequency Response

Test a common-emitter amplifier's bandwidth:

Example 4: Power Supply Ripple

Simulate a full-wave rectifier with filter capacitor:

Tips for Better Simulations

  1. Always add a ground node: Every SPICE circuit needs a ground reference (node 0). Missing ground causes convergence errors.
  2. Start simple: If a complex circuit fails to converge, simulate subsections separately first.
  3. Check component values: A missing decimal point (10 ohms vs 10k ohms) gives wildly wrong results.
  4. Use realistic models: Ideal op-amps work for basic checks, but real models reveal bandwidth limits and offset voltages.
  5. Watch for convergence errors: These usually mean a circuit condition that SPICE cannot solve (e.g., voltage source directly across a voltage source). Add small series resistance.
  6. Verify with hand calculations: Simulation should confirm your calculations, not replace them. If the results disagree, find out why.

SPICE Simulation in CircuitDiagramMaker

CircuitDiagramMaker includes a full SPICE simulation engine directly in the browser -- no separate software needed:

  1. Draw your circuit in the editor with drag-and-drop components
  2. Set component values by double-clicking each component
  3. Click Simulate and choose DC, transient, or AC analysis
  4. View results overlaid on the schematic or in the waveform viewer
  5. Iterate on the design without switching between applications

The AI circuit generator can create simulation-ready circuits -- describe your circuit and it generates a complete schematic with correct component values, ready to simulate.

Conclusion

SPICE simulation is an invaluable tool for circuit design. It catches errors before you build, lets you experiment with component values instantly, and provides insight into circuit behavior that is difficult to measure physically. Start with simple circuits (voltage dividers, RC filters) to build confidence, then tackle more complex designs.


Simulate circuits in your browser with CircuitDiagramMaker -- the only online wiring diagram tool with built-in SPICE simulation (DC, transient, AC analysis).