# What all does SPICE do?

#### hp1729

Joined Nov 23, 2015
2,304
I've been building small circuits for decades but never used SPICE. What all does it do? How good are the models in the library? I am familiar with ORCAD. But have my doubts about SPICE.
Referring to the guy who built the 12 V SLA battery charger using a TL072 running at 5 V, he said the simulation was good but he was applying a 12 V input to an op amp running off of 5 V. Does SPICE check such things? Does it just check that you don't have two outputs connected together that shouldn't and that all inputs are tied to something?
How does it model things like transistor gain? This isn't a precise value. LEDs do not have a precise voltage drop across them.
How does it deal with op amp offset voltage? Again this isn't a precise and predictable value.
thanks, just wondering if I should bother to learn PSPICE. Most of my stuff is pretty simple. Yes, I make mistakes but usually catch them the second or third time through.

I can see the long term value of simulations over breadboarding as parts get more surface mount and difficult to breadboard. Yes I can put the SMD parts on adapters but the adapters cost more than the chips.

#### dl324

Joined Mar 30, 2015
10,938
I've been building small circuits for decades but never used SPICE. What all does it do?
From Wikipedia: SPICE (Simulation Program with Integrated Circuit Emphasis) is a general-purpose, open source analog electronic circuit simulator.
Referring to the guy who built the 12 V SLA battery charger using a TL072 running at 5 V, he said the simulation was good but he was applying a 12 V input to an op amp running off of 5 V. Does SPICE check such things? Does it just check that you don't have two outputs connected together that shouldn't and that all inputs are tied to something?
Spice doesn't comprehend all of the dumb things Users can do.

I cringe when I see novices simulating everything. I think it's better to have a firm grasp of the basics and use simulators when it's beyond your ability to analyze.

#### hp1729

Joined Nov 23, 2015
2,304
From Wikipedia: SPICE (Simulation Program with Integrated Circuit Emphasis) is a general-purpose, open source analog electronic circuit simulator.
Spice doesn't comprehend all of the dumb things Users can do.

I cringe when I see novices simulating everything. I think it's better to have a firm grasp of the basics and use simulators when it's beyond your ability to analyze.
Thanks for the reply. I know the text book description of SPICE. My curiosity is about effectiveness. I know orcad is more than a drawing program. Chips are modeled specifying what pins are inputs, outputs, open collector, tri-state, passive, and so on so analysis can be done to assure two TTL outputs are not connected together that should not be. Is this all SPICE does?
On SPICE models for LEDs does it know what voltage should be across it depending on the current through it or does it just assume a "20 mA" condition?
Transistor gain. How does it know the characteristics of the actual transistor I use? Not all 2N3904s have exactly the same gain at a given collector current.
< > My concern is that I would be your worse nightmare for a number of years before I got reliable with SPICE. </ >

#### #12

Joined Nov 30, 2010
18,210
I don't Simulate.
That said, SPICE is a program. Garbage in = garbage out. You will be amazed at the mistakes SPICE won't catch, and the number of demands for perfection in your setup that will require a book to explain.

Spice doesn't comprehend all of the dumb things Users can do.

I cringe when I see novices simulating everything. I think it's better to have a firm grasp of the basics and use simulators when it's beyond your ability to analyze.
You better know 90% of what you're expecting your circuit to do or you will get so mired in the details of learning SPICE!
Start learning SPICE with really simple circuits.

#### kubeek

Joined Sep 20, 2005
5,724
LED are usually modelled the same way other diodes are, so there is logarithmic dependance between voltage and current. Same goes for transistors and other things, all the basic components are modelled quite accurately. Trouble comes with other parts like general ICs, those are modeled using those primitive devices and can often be quite far from reality, or can cause extremely slow or not at all working simulations, but that is a problem in the model and not the simlator.

Look at what parameters can be definded for a simple NPN transistor for example here http://www.ece.uci.edu/docs/hspice/hspice_2001_2-102.html
Lots of components don´t have all the parameters entered, so the simulator just assumes some default. Opamps usually have fixed offset an input currents, but you should be able to modify those and try different values, also there are different classes of models of for example opamps, which differ in realism and computation complexity, some will even run happily without any power supply connected.

#### wayneh

Joined Sep 9, 2010
16,398
LTspice is a simulator and like all simulators depends on the component models. Those in turn depend on the human that created them. Shinola in, shinola out. That's why you'll sometimes see multiple models available for a single component. A simple model may be fine for most applications, while a detailed elaborate model might be required for another.

I would never assume that a simulation will catch any errors. They'll let you put 100mA into that 20mA LED and not make a peep.

I've done a little programming in an unrelated area and I can tell you that error trapping user input is usually the last and most difficult thing to add. My dad used to say, "If you think it's foolproof, you just haven't met the right fool yet".

#### eetech00

Joined Jun 8, 2013
1,937
I would never assume that a simulation will catch any errors. They'll let you put 100mA into that 20mA LED and not make a peep.
yes...but it a simulation it won't cause a pffffffftttt!!!

#### MikeML

Joined Oct 2, 2009
5,444

#### KL7AJ

Joined Nov 4, 2008
2,225
I've been building small circuits for decades but never used SPICE. What all does it do? How good are the models in the library? I am familiar with ORCAD. But have my doubts about SPICE.
Referring to the guy who built the 12 V SLA battery charger using a TL072 running at 5 V, he said the simulation was good but he was applying a 12 V input to an op amp running off of 5 V. Does SPICE check such things? Does it just check that you don't have two outputs connected together that shouldn't and that all inputs are tied to something?
How does it model things like transistor gain? This isn't a precise value. LEDs do not have a precise voltage drop across them.
How does it deal with op amp offset voltage? Again this isn't a precise and predictable value.
thanks, just wondering if I should bother to learn PSPICE. Most of my stuff is pretty simple. Yes, I make mistakes but usually catch them the second or third time through.

I can see the long term value of simulations over breadboarding as parts get more surface mount and difficult to breadboard. Yes I can put the SMD parts on adapters but the adapters cost more than the chips.
I learned the real value of spice while designing a 100 Kilowatt matching network for an inductively coupled plasma device at UCLA. I was already a seasoned R.F. guy by that time, but the impedance of this device was nearly impossible to calculate. So, using the method of iteration and spice, we actually came up with a really great network. I would NOT recommend Spice as a substitute for actually building stuff, though.

#### Papabravo

Joined Feb 24, 2006
13,924
Anybody who designs a circuit that depends on a specific value of any parameter has a fool for a client.

#### KL7AJ

Joined Nov 4, 2008
2,225
Anybody who designs a circuit that depends on a specific value of any parameter has a fool for a client.
I believe Spice's biggest value is in modeling PASSIVE networks like complex filters and such. Most of the literature and texts out there, however, concentrate only on the active parameters.

#### WBahn

Joined Mar 31, 2012
25,907
I've been building small circuits for decades but never used SPICE. What all does it do? How good are the models in the library? I am familiar with ORCAD. But have my doubts about SPICE.
Huh?

But OrCAD uses PSpice as its simulation engine. That's why they bought MicroSim. (unless things have changed in the last decade or so).

Referring to the guy who built the 12 V SLA battery charger using a TL072 running at 5 V, he said the simulation was good but he was applying a 12 V input to an op amp running off of 5 V. Does SPICE check such things? Does it just check that you don't have two outputs connected together that shouldn't and that all inputs are tied to something?
You are actually talking about a couple of different things. Connecting two outputs together that shouldn't comes under the heading of Electrical Design Rule Check (DRC). This requires information that the SPICE engine simply doesn't have access to. So these kinds of checks are primarily the purview of the schematic capture software and how you set up its DRC rules deck.

As for the quality of the simulation itself, that depends on the quality of the model and the quality of the simulation setup. The models historically have been all over the place. One time I used a TI model for an opamp (TL074, I think) and the simulation matched my actual circuit performance quite nicely. Then I started looking at total current draw and it showed the opamp was drawing a bit over a thousand amps! After playing around I called TI and they told me that their model developers only cared about the I/O pin characteristics and the power supply current was what ever the various dependent sources in the model happened to use. Remember that SPICE was originally developed for designing integrated circuits -- ICE stands for Integrated Circuit Emphasis -- so everything was at a pretty basic level as far as components went. As people wanted to simulate circuit boards that had ICs on them, device manufacturers started making simple models available and, at first, they focused on the signal processing chain and not anything else. Since then IC models have gotten a LOT better -- because people are demanding better sim results that cover more and more items of interest.

As design rules for transistors got into the deep-submicron, the transistor and other basic component models had to get better and better to give reasonable simulation results. Given that a mask set today can cost millions of dollars, you want a simulation that is nuts on. So companies were willing to pay fab houses to develop models that were nuts on (well, actually they just refused to use fab houses that didn't supply models that were nuts on -- i.e., they were willing to pay significantly higher fab costs compared to fabs that didn't provide high quality models.)

When I was working with the IBM 130 nm process (a decade or so back) I looked at their model for their basic NFET. It consisted of a subcircuit that had over three hundred components! For ONE transistor. But it pays off. Even back in the mid 90's when I started doing IC design, when I would get the chips back from fab and I would measure the bias voltages that where generated on-chip they seldom different from the sim results by more than a few millivolts.

How does it model things like transistor gain? This isn't a precise value. LEDs do not have a precise voltage drop across them.
How does it deal with op amp offset voltage? Again this isn't a precise and predictable value.
Most of the models have statistical parameters that describe the distribution of various other parameters, such as gain and voltage drop and temperature coefficients and you name it. You can set up the simulation to do what is called a Monte Carlo simulation where individual device parameters are randomized according to that distribution. You then run many (ranging from half a dozen to thousands) of simulations and collate the results. This can take a lot of time, so your first step is usually to do what are known as "corner simulations" in which you put the key parameters, usually including temperature, at their extreme values. You then get it working as best you can over those variations before running a full Monte Carlo set.

thanks, just wondering if I should bother to learn PSPICE. Most of my stuff is pretty simple. Yes, I make mistakes but usually catch them the second or third time through.
When spinning a circuit costs a couple hours and some bread boarding or even a couple weeks and a few hundred bucks, this can be a perfectly reasonable approach. When spinning a circuit costs six months and a hundred thousand bucks, that's a very different thing.

#### #12

Joined Nov 30, 2010
18,210
I would never assume that a simulation will catch any errors. They'll let you put 100mA into that 20mA LED and not make a peep.
yes...but in a simulation it won't cause a pffffffftttt!!!
The pffffffftttt only happens when you believe the Simulator and build the circuit.

#### crutschow

Joined Mar 14, 2008
25,114
As noted, there is absolutely no rule checking in Spice. It will allow 10k amps through a 1mA part without a whimper. So all checks have to be done by looking at the simulation results and deciding if the voltages and currents are reasonable for the circuit design.
LTspice has an option (and other versions may also) that displays the power dissipated in a device to verify that it's not operating outside it's limits (or how large a heat sink it might require for power devices). That's especially useful for devices like power transistors in switch-mode circuits where it's rather difficult to calculate the power dissipation due to the switching losses.

Spice generally uses nominal values for the various parameters so if you want a worst-case test you will need to go into the models and change the value. One technique is to copy the model and generate your worst-case model with a slightly different name (such as adding "_WC" as an extension).

I think learning to use Spice is worth the effort. Not only does it often catch errors in your design but it allows you to easily modify the circuit to optimize the design or try alternate design approaches.
As MikeML noted I also never build a design without first simulating it.

Last edited:

#### eetech00

Joined Jun 8, 2013
1,937
The pffffffftttt only happens when you believe the Simulator and build the circuit.

Heh....mhmm...well....it is a simulation..

#### hp1729

Joined Nov 23, 2015
2,304
I don't Simulate.
That said, SPICE is a program. Garbage in = garbage out. You will be amazed at the mistakes SPICE won't catch, and the number of demands for perfection in your setup that will require a book to explain.

You better know 90% of what you're expecting your circuit to do or you will get so mired in the details of learning SPICE!
Start learning SPICE with really simple circuits.

#### hp1729

Joined Nov 23, 2015
2,304
Huh?

But OrCAD uses PSpice as its simulation engine. That's why they bought MicroSim. (unless things have changed in the last decade or so).

You are actually talking about a couple of different things. Connecting two outputs together that shouldn't comes under the heading of Electrical Design Rule Check (DRC). This requires information that the SPICE engine simply doesn't have access to. So these kinds of checks are primarily the purview of the schematic capture software and how you set up its DRC rules deck.

As for the quality of the simulation itself, that depends on the quality of the model and the quality of the simulation setup. The models historically have been all over the place. One time I used a TI model for an opamp (TL074, I think) and the simulation matched my actual circuit performance quite nicely. Then I started looking at total current draw and it showed the opamp was drawing a bit over a thousand amps! After playing around I called TI and they told me that their model developers only cared about the I/O pin characteristics and the power supply current was what ever the various dependent sources in the model happened to use. Remember that SPICE was originally developed for designing integrated circuits -- ICE stands for Integrated Circuit Emphasis -- so everything was at a pretty basic level as far as components went. As people wanted to simulate circuit boards that had ICs on them, device manufacturers started making simple models available and, at first, they focused on the signal processing chain and not anything else. Since then IC models have gotten a LOT better -- because people are demanding better sim results that cover more and more items of interest.

To WBahn and all ...
Thanks for the responses. In ORCAD 16.6 2015, I create a project and start placing PSPICE parts I can get a specific diode okay, but when I try to place a specific transistor or op amp (2N4401, LF351) I can find it in the library but it doesn't place it on the schematic. What am I doing wrong?

As design rules for transistors got into the deep-submicron, the transistor and other basic component models had to get better and better to give reasonable simulation results. Given that a mask set today can cost millions of dollars, you want a simulation that is nuts on. So companies were willing to pay fab houses to develop models that were nuts on (well, actually they just refused to use fab houses that didn't supply models that were nuts on -- i.e., they were willing to pay significantly higher fab costs compared to fabs that didn't provide high quality models.)

When I was working with the IBM 130 nm process (a decade or so back) I looked at their model for their basic NFET. It consisted of a subcircuit that had over three hundred components! For ONE transistor. But it pays off. Even back in the mid 90's when I started doing IC design, when I would get the chips back from fab and I would measure the bias voltages that where generated on-chip they seldom different from the sim results by more than a few millivolts.

Most of the models have statistical parameters that describe the distribution of various other parameters, such as gain and voltage drop and temperature coefficients and you name it. You can set up the simulation to do what is called a Monte Carlo simulation where individual device parameters are randomized according to that distribution. You then run many (ranging from half a dozen to thousands) of simulations and collate the results. This can take a lot of time, so your first step is usually to do what are known as "corner simulations" in which you put the key parameters, usually including temperature, at their extreme values. You then get it working as best you can over those variations before running a full Monte Carlo set.

When spinning a circuit costs a couple hours and some bread boarding or even a couple weeks and a few hundred bucks, this can be a perfectly reasonable approach. When spinning a circuit costs six months and a hundred thousand bucks, that's a very different thing.
Huh?

But OrCAD uses PSpice as its simulation engine. That's why they bought MicroSim. (unless things have changed in the last decade or so).

You are actually talking about a couple of different things. Connecting two outputs together that shouldn't comes under the heading of Electrical Design Rule Check (DRC). This requires information that the SPICE engine simply doesn't have access to. So these kinds of checks are primarily the purview of the schematic capture software and how you set up its DRC rules deck.

As for the quality of the simulation itself, that depends on the quality of the model and the quality of the simulation setup. The models historically have been all over the place. One time I used a TI model for an opamp (TL074, I think) and the simulation matched my actual circuit performance quite nicely. Then I started looking at total current draw and it showed the opamp was drawing a bit over a thousand amps! After playing around I called TI and they told me that their model developers only cared about the I/O pin characteristics and the power supply current was what ever the various dependent sources in the model happened to use. Remember that SPICE was originally developed for designing integrated circuits -- ICE stands for Integrated Circuit Emphasis -- so everything was at a pretty basic level as far as components went. As people wanted to simulate circuit boards that had ICs on them, device manufacturers started making simple models available and, at first, they focused on the signal processing chain and not anything else. Since then IC models have gotten a LOT better -- because people are demanding better sim results that cover more and more items of interest.

As design rules for transistors got into the deep-submicron, the transistor and other basic component models had to get better and better to give reasonable simulation results. Given that a mask set today can cost millions of dollars, you want a simulation that is nuts on. So companies were willing to pay fab houses to develop models that were nuts on (well, actually they just refused to use fab houses that didn't supply models that were nuts on -- i.e., they were willing to pay significantly higher fab costs compared to fabs that didn't provide high quality models.)

When I was working with the IBM 130 nm process (a decade or so back) I looked at their model for their basic NFET. It consisted of a subcircuit that had over three hundred components! For ONE transistor. But it pays off. Even back in the mid 90's when I started doing IC design, when I would get the chips back from fab and I would measure the bias voltages that where generated on-chip they seldom different from the sim results by more than a few millivolts.

Most of the models have statistical parameters that describe the distribution of various other parameters, such as gain and voltage drop and temperature coefficients and you name it. You can set up the simulation to do what is called a Monte Carlo simulation where individual device parameters are randomized according to that distribution. You then run many (ranging from half a dozen to thousands) of simulations and collate the results. This can take a lot of time, so your first step is usually to do what are known as "corner simulations" in which you put the key parameters, usually including temperature, at their extreme values. You then get it working as best you can over those variations before running a full Monte Carlo set.

When spinning a circuit costs a couple hours and some bread boarding or even a couple weeks and a few hundred bucks, this can be a perfectly reasonable approach. When spinning a circuit costs six months and a hundred thousand bucks, that's a very different thing.