Learning how a circuit works or designing a new one requires experimentation. Besides actually building a circuit, many people use a circuit simulation program. LTspice/SwitcherCAD III is a free program (download link) that many forumites use. Here is a brief introduction to using LTspice, illustrating a calculation with Ohm’s law. This tutorial first appeared on February 27, 2007 on the pre-WordPress version of this site.
When you first open the LTspice window, you will see something like this image. To create a schematic, either
- click on the new schematic tool bar button beneath the menus on the far left or
- choose the File > New Schematic menu item.
The window will change to a background that shows the grid for laying out the schematic. Also the toolbars beneath the menus become active.
For example, you can see the symbols for ground, a resistor, and a capacitor are available elections. In the picture above, the Component button is highlighted. To the left is a diode symbol and to the right is the image of a hand. After clicking on the Component button, we will select a voltage source for our schematic.
Below is the dialog window that opens after clicking on the Components button. After scrolling through the alphabetical list on the bottom, we have selected the voltage source symbol. Clicking on the OK button returns us to the schematic where we can place this symbol by clicking in a desired location.
In the next picture, you can see where we have placed the voltage source. The Resistor button is highlighted because we are about to add a resistor to our schematic. We will place all of the components that we need first. Then we will place connections and finally we will assign values to the components.
After placing the resistor, we are about to add a Ground symbol to our schematic.
The ground symbol is now in place and we are about to place wires to connect the components of our simple circuit. To run the connections, press F3 or click the Wire button (a pencil to the left of the Ground button) or choose Wire from the Edit menu. Click to start a wire and to make a corner. Double click to end a wire.
Here is the completed circuit for illustrating Ohm’s law. Component values can be assigned by placing the mouse over a component and right-clicking. If you make the the mouse a pair of crosshairs (by pressing the ESC key), then the mouse will turn into a hand as it is placed over the component.
Right-clicking on the voltage source component brings up the dialog window below. We are assigning the value 9 for 9 volts of direct current (DC). There are other options that we ignore for this tutorial.
Now you will see that the letter V underneath the voltage supply symbol has been replaced by the value 9. We also right-clicked on the resistor component and assigned the value 1K.
Having assigned all of the components values, we are ready to simulate the circuit in the schematic. To do this, we must create a command for SPICE, the algorithm that computes the simulations. Choose the Simulate > Edit Simulation Cmd menu item.
This dialog appears. We have selected the DC opt pnt tab. This is the choice for a simple DC simulation.
After clicking on OK, we placed the SPICE command “.op” at the bottom of the schematic, in the same way that one places components. The final step to running a simulation is to click on the Run button, highlighted in this image.
A window opens with the results of the DC simulation. In this simple case, we see that the voltage supply is 9 volts, as we specified. In addition, the current is computed for the voltage supply and the resistor. As Ohm’s law requires, the current through the resistor is 9/1K = 0.009 amperes, or 9mA.