LTspice Guide
LTspice Guide
LTspice is a circuit simulator based on the SPICE simulator and available as a free download
from Linear Technology (www.linear.com). LTspice is the most popular freeware SPICE
simulator.
Installation
Download LTspice from www.linear.com/designtools/software/ along with the Users Guides if
you wish.
Earlier versions of the simulator were called SwitcherCAD, because one of the intended
applications was to simulate switching power supply designs based on Linear Technologies
switching circuits so there may be remnants of the earlier name in the documentation.
A First Circuit
Create and probe a voltage divider circuit.
2. Place a ground symbol: L-click on gnd symbol , L-click on schematic to place, R-click or
Esc key to end function. A ground node is required in all simulations.
3. Place a voltage source: Click on component library to open , scroll right to find voltage
source , place on schematic. R-click on voltage source to open its Properties window.
Set DC value to 9V and series resistance to 0 ohms
4. Select the Move tool , click on the component or on component labels and move to the
locations you desire. R-click on an empty area of the page to cancel the move function.
5. Place two resistors on the schematic using the resistor tool . R-click to on the resistors
and set each to 1K.
6. If there are mistakes, use the Cut tool to delete extra components.
7. Use the wire tool to connect the schematic. L-click to start/end or to place corners.
Wires will snap to other wires and to component terminals. R-click to terminate wire tool.
8. To move components after they are connected, use the Drag tool , which will drag the
wiring along with the components.
10. Save the file. Use Save As to change to name and location of your choice.
11. Use the Label Net tool to label the nodes (connection points) on the schematic. This will
make it easier to interpret the simulation results. Select the Label Net and in the Net Name
dialog, enter Vin. Then position net name on the wire between the voltage source and the
top resistor.
the simulation Run button . The Edit Simulation Command dialog will appear because
this is the first run of the simulation. (To edit simulation commands after the first run, from the
menu bar select Simulate > Edit Simulation Cmd.) In the dialog, select the DC op pnt tab,
confirm that .op is in the bottom text box then Select OK.
The .op SPICE command will be inserted into the schematic and a window with the
Operating Point simulation results will appear
Notice how the current has dropped to 3 mA and the output voltage is now 6 V. This is a
small hint to the power of circuit simulation. Close the results window
17. Hover the mouse over R2 without selecting. The message area at the bottom of the
schematic lists the steady-state current through the component (3 mA) and the power being
dissipated by the component (18 mW). Find the current and power for the other resistor. This
is a good way to determine if the component you purchase will be able the power demands of
the circuit. For example, jumper around R2 with a wire, effectively taking it out of the circuit,
and change the value of R1 to 10 ohms.
1. Start a new schematic and create the circuit shown below. It has Gnd node, voltage source,
resistor and capacitor. To rotate a component (e.g. the resistor), enter Ctrl-R after selecting
but before placing. The resistor value has been changed to 1K and the capacitor value to 1
uF. The input and output nodes have been labeled Vin and Vout.
2. The Zoom to Fit command (spacebar shortcut key) is handy for fitting the schematic to the
window. The mouse scroll wheel can be used to zoom in and out.
4. Run the simulation. In the Edit Simulation Command box, select the Transient tab. Enter Stop
Time = 2. Notice that .tran 2 entered in the Syntax box and will appear on the schematic
then the dialog is closed.
5. Adjust the windows size and from the menu bar use Window > Tile Vertically to get things
looking right with the schematic on the left and the plotting window on the right (or place top
and bottom with Tile Horizontally).
7. R-click on the value for R1 and change to 100K. Click the Run simulation button and watch
the output plot update to the new values.
A white cross-hair cursor will appear in the window along with an additional cursor window.
Click and drag the cross-hairs along the trace and view exact output voltage values in the
cursor window.
st nd
12. R-click the V(vout) label again and attach the 1 & 2 cursors to this trace. Now you can
drag two cursors and get differential time and voltage readings. In more complex circuits, this
feature is handy for getting peak to peak values and for timing the length of transient events.
Use zoom and pan to precision the cursors more precisely. Zoom by click and dragging in the
plot to define the zoom area. Or, L-click on an axis to precisely set axis limits.
13. On the menu bar, look under Help > Help Topics to reach the on-line help file that describes
more things you can do with plots. Or, consult the LTspice Users Guide.
14. Delete all traces and Run the simulation to refresh.
15. You can plot the voltage across any component. Hover the cursor on the Vin node until it
turns into a red probe. Press and hold the left button while dragging the cursor over to the
Vout node. The cursor will change into a black probe. Release the mouse button. The
resulting plot is the red probe minus the black probe, which is the voltage across R1.
0.8V
0.6V
0.4V
0.2V
0.0V
-0.2V
-0.4V
-0.6V
-0.8V
0.0s 0.2s 0.4s 0.6s 0.8s 1.0s 1.2s 1.4s 1.6s 1.8s 2.0s
If you dont like the trace colors, they can be changed by R-clicking the trace label in the
LTspice plot window. In the menu bar, Tools > Control Panel > Waveforms gives additional
options including plotting with thick lines.
RC Filter
Notes: same as last ckt, r1=1-k, c1=10u. Set voltage source to SINE, AC analysis to amp=1,
phase=0. Set sim command to AC Analysis, Octave sweep, 10 pts/octave, .01 to 1000 hz. Attach
cursor. Hover over axis and click to change range and lin/log. Click and drag over plot to zoom-
select.
Active Circuits
Active circuits use op-amps. LTspice has a library of op amps from Linear Technologies. For
other op-amps, you can insert their Spice model, often found on the vendor web site. For
simulating an op amp circuit where you dont care about the model, insert the generic op amp
from the component library. Component > [Opamp] > opamp. When selecting this element from
the library, a note appears stating to include the simulation directive .lib opamp.sub on the
schematic.
Op-Amp Filter
nd
LPF Sallen-Key, first and 2 order.
Try simulating a precision recitifier.
For these circuits, the voltage source is changed to a sin signal with appropriate amplitude.
Specify 4 cycles.
For a 1000 Hz input, simulate for 4.0 ms under the Transient tab, which will give 4 cycles, enough
to determine circuit behavior.
Non-Linear Circuit
Rectifier
Wrapup
LTspice offers much more than what is shown here. A very powerful part of LTspice is the ability
to include SPICE models of complex analog components like op-amps, voltage regulators and
timers into the circuit. This means you can simulate what the circuit will do for different brands
and models of op-amps or other components. Components from Linear Technologies are built
into LTspice but models from other vendors are easy to include. See the LTspice help files for
details.