Maker Pro
Maker Pro

Computer Software to Simulate Circuits?

chopnhack

Apr 28, 2014
1,576
Joined
Apr 28, 2014
Messages
1,576
Does anyone know of free software that can emulate circuits? I have done some research and found things like Eagle and Spice. Eagle not being free and somewhat confusing looking for a newbie, I looked at the Spice program and from what I understood it can map the output of digital i.c.'s. But is there any software that can actually simulate a circuit you can build? I know that this sounds like a tall order, but if all these components are nothing more than logical switches, gates, etc. why wouldn't there be a program to emulate them?
 

chopnhack

Apr 28, 2014
1,576
Joined
Apr 28, 2014
Messages
1,576
Interesting program, I am toying with it now. I tried to change the attributes of a npn transistor, but it wont allow me make the changes? It allowed me to do so on resistors and caps... Is there a way to import more components or to build your own from spec sheets? The add a component feature was not to intuitive.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
You can add many components to LTSPICE.
Step 1: get the respective SPICE model from the manufacturer.
Step 2: Look at the model file. There are basically 2 types of model:
a) a model based on the internal model for elementary components where the model parameters are added in form of a parameter list.
b) models based on subcircuits.
The two types of model are treated differently.

Example for a), BCX17:
Get the model from NXP (under Downloads -> All models). Open the ZIP file and extract BCX17.PRM. This is a text file, you c an rename it to BCX17.TXT to open it with any text editor. Find the Library for bipolar transistors (e.g. C:\Program Files (x86)\LTC\LTspiceIV\lib\cmp\standard.bjt) Open it with a text editor (you may need admin rights) and append the model description from the BCX17.PRM file, the lines from
-----------------------
.MODEL QBCX17 PNP
+ IS=1.08E-13
...
+ FC=0.99
-----------------------
Save standard.bjt and you will now have QBCX17 as an additional model in LTSPICE.

Example for b), LMX321 operatinal amplifier.
Get the model from MAXIM, save the file (LMX321.FAM on your hard drive). From within LTSPICE (!) go to file -> open -> and open the saved LMX321.FAM file (this is a text file, but you have to use the LTSPICE integrated editor for the following steps). Within the editor, fin the macro description, in this case it is this line:
.SUBCKT LMX321 1 2 3 4 5
Highlight the complete line with the mouse, the right click and select "Create Symbol" from the popup. Answer yes to the following popup (do you wish to create...) If you get an error message like "trouble creating...", restart LTSPICE with admin rights. LTSPICE will now create a block for this PSICE model that you can use like any other model. If you don't like the looks of the block, you can edit the symbol with the LTSPICE symbol editor.

Here is an excellent book on LLTSPICE.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Great info Harald! This should be in the Resources section.
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
Tomorrow I'll have access to my LTSPICE database. Let me see, what I can do...
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
Nice work Harald.

I use the .lib or .inc commands that link to the website where the spice files are stored.

Then all you do is pick the correct generic component and add a spice directive.

.inc http://www.onsemi.com/pub_link/Collateral/NTD20N03.LIB
or
.lib http://www.onsemi.com/pub_link/Collateral/NTD20N03.LIB

Using the .lib command only picks out the part you are interested in. You then just give the part the correct name in value field and your done. This also means when they update the spice file you will always be using the latest spice model. As long as they keep the file name the same obviously.
Thanks
Adam
 

chopnhack

Apr 28, 2014
1,576
Joined
Apr 28, 2014
Messages
1,576
I tried the method Harald outline with limited success. I was able to get a 1n4004 diode included in standard.dio, however when you look up the item, the specs are blank?! No breakdown voltage listed, no amp carrying given - the fields are just blank.
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
however when you look up the item, the specs are blank?! No breakdown voltage listed, no amp carrying given - the fields are just blank
Right, that's meta-information you have to provide yourself, they are not part of the model (and in fact irrelevant for the simulation, just for selecting the component from the menu).
In the case of a diode add the following data to the model line in standard.dio:
Iave=Iave[A] Vpk=Vbrkdn[V] mfg=manufacturer type=type_of_diode
wehre you replace Iave[A], Vbrkdn[V], manufacturer and type_of_diode with the values you want to see in the component selection menu. this is a sample line from the original diode library:
.model SS3P5 D(Is=120u Rs=40m N=2.05 Cjo=200p Vj=700m M=.45 Iave=3 Vpk=50 mfg=Fairchild type=Schottky)
 

chopnhack

Apr 28, 2014
1,576
Joined
Apr 28, 2014
Messages
1,576
Right, that's meta-information you have to provide yourself, they are not part of the model (and in fact irrelevant for the simulation, just for selecting the component from the menu).

I resolved the problem, there was a carriage return entered involuntarily by the txt editor causing a break in the data! Thanks.

As for the above comment, I don't understand, I thought the simulator used the vital model information like Vbrk and Iave to perform its computations. Can you explain?

Thanks!
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
No, it doesn't.
Simulation parameters are all others, except Iave, Vpk amd mfg.
 
Top