0
0
Embedded-cHow-ToBeginner · 4 min read

How to Simulate PCB Using SPICE: Step-by-Step Guide

To simulate a PCB using SPICE, first create a netlist describing your circuit components and connections. Then run the netlist in a SPICE simulator to analyze voltages, currents, and signals before building the physical board.
📐

Syntax

A SPICE netlist describes your PCB circuit using simple lines for components and connections.

  • R1 N1 N2 1k: Resistor R1 between nodes N1 and N2 with 1 kilo-ohm resistance.
  • C1 N2 0 10uF: Capacitor C1 between node N2 and ground (0) with 10 microfarads.
  • V1 N1 0 DC 5V: Voltage source V1 from node N1 to ground with 5 volts DC.
  • .tran 1ms 10ms: Transient analysis from 0 to 10 milliseconds with 1 ms step.
  • .end: Marks the end of the netlist.
spice
* Simple RC Circuit
V1 N1 0 DC 5V
R1 N1 N2 1k
C1 N2 0 10uF
.tran 1ms 10ms
.end
💻

Example

This example simulates a simple RC charging circuit. It shows how voltage changes over time across the capacitor.

spice
* RC Charging Circuit
V1 N1 0 DC 5V
R1 N1 N2 1k
C1 N2 0 10uF
.tran 1ms 10ms
.control
run
plot v(N2)
.endc
.end
Output
Simulation runs transient analysis from 0 to 10 ms showing voltage at node N2 rising from 0V to near 5V as capacitor charges.
⚠️

Common Pitfalls

Common mistakes when simulating PCBs with SPICE include:

  • Forgetting to define ground node as 0, which causes errors.
  • Incorrect component values or units (e.g., using 10 instead of 10uF).
  • Missing analysis commands like .tran or .ac to run simulations.
  • Not connecting all nodes properly, leaving floating nodes.

Always double-check your netlist syntax and run a simple test before complex circuits.

spice
* Wrong: Missing ground node
V1 N1 N2 DC 5V
R1 N1 N2 1k
.end

* Right: Ground node defined as 0
V1 N1 0 DC 5V
R1 N1 N2 1k
.end
📊

Quick Reference

SPICE CommandDescription
.tranRun transient (time-based) simulation
.acRun AC frequency sweep simulation
.dcRun DC sweep simulation
Rname N+ N- valueResistor between nodes with resistance
Cname N+ N- valueCapacitor between nodes with capacitance
Vname N+ N- DC valueVoltage source with DC voltage
.endEnd of netlist

Key Takeaways

Create a SPICE netlist describing your PCB circuit with correct nodes and components.
Always include a ground node labeled as 0 to avoid simulation errors.
Use analysis commands like .tran to simulate circuit behavior over time.
Check units and values carefully to ensure accurate simulation results.
Run simple test circuits first to verify your SPICE setup before complex designs.