free Spice

rmeldo

Senior Member
Hi,

A good one for the forum.

I am looking for a circuit simulator software for hobbyists. It would be great if it was free. Normally there are a lot of codes which are freeware. In the area of circuit simulation however I could only find very expensive commercial software.

Is it because I haven't looked in the right places?

Also I imagine that a key factor must be the availability of component libraries. (i.e. a model of the component behaviour). Are these libraries only available for Spice or can tehy be used in other programs?

Thanks

Riccardo
 

BeanieBots

Moderator
You won't find anything free for circuit simulation because unlike most other software, it has a limited audience, is very complex and requires models to be created for each and every component that is used.

How much time and effort would you like to put in so that we can have a free version?
How accurate would YOUR model of a resistor be?
Inductance of the leads? Capacitance between leads? Thermal characteristics?
Unless ALL such parameters are correctly modelled, the simulation is of little value. That's just a resistor. Now consider a semiconductor device.
 

Dippy

Moderator
I've seen certain design tools for things e.g. National Semi, but never a free full-blown spice simulator.

I'm with BB on this. I really can't imagine anything free and good. I sincerely HOPE to be proven wrong so I can have one as well.
I also hope it has free technical support and free component libraries and free product upgrades.
I also want someone to come round, again free of charge, to show me how to drive it :)

I also want all my components free, someone to CAD the designs free, and free PCB prduction.

When I order a free sample from Microchip or TI or whoever (you stilll can unless you're a scrounging schoolboy) I expect that component to be delivered to my door free of charge by the time the kettle has boiled.
Talking of which...
 
Last edited:
Riccardo,

Check out SIMetrix (www.simetrix.co.uk) which offers a free evaluation version of a SPICE simulator. I believe it has all of the facilities of their paid-for version but with a limited number of nodes. I have used it for several years (recommended by one of my colleagues at work) and, by coinidence, last night was the first time I needed more nodes than the evaluation copy would allow, but the circuit that I was simulating did have six uA741 op-amps, each of which would have used several nodes in its model. Mostly I have used this simulator for filters.

There are extensive libraries of ICs, transistor and diodes, but you should always question the results as the models may not be accurate. One circuit that I simulated behaved very differently to the built-up version and this was because the drain-gate capacitance of a FET wasn't in the model.

These days I usually simulate the circuit before prototyping it - overall it saves some time and allows some optimisation without the use of a soldering iron.

Richard
 

rmeldo

Senior Member
Thanks Richard,

I will check out the software.

Dynamic simulation is my profession. Not of electronic but mechanic systems. It is my experience that simulation and reality go hand in hand only when the model is adequate and the person who takes the measurements knows what is doing.

A common mistake that inexperienced people make is to try and model everything. The model gets to complicated, difficult to handle and it al ends tits up.

In my field prototyping is very expensive so we rely a lot on simulation... and due to specialisation the designer and the experimenter are often two different persons.

In hobby electronics fortunately this is not true, prototypes are affordable and you get to simulate, build ant test your own work.

There are quite a few good free software packages for the simulation of mechanical dynamic systems, mainly written at universities. Academics normally resort to writing their own code because they cannot afford the license costs of commercial software and they have endless supply of bright and eager students to build component submodels. The user interface is not the best, but component models and the solver are normally good.

I just assumed it would be the same in the field of electronics.

Riccardo
 

TMeyer

New Member
Riccardo:

In addition to Richard's suggestion, look into LTSpice.
http://www.linear.com/designtools/software/spice_models.jsp

I have just begun to play with the application.

This suggestion is based on Peter J. Stonard's tutorial in the December and January issues of "Nuts and Volts" (www.nutsvolts.com). Digital subscriptions are available with more tutorials promised.

The SW does not –appear- to have any limitations from a licensing perspective and is focused on basic components.

Key here, is the detail of the N/V tutorial. It includes methods of adding elements from other vendors to the LTSpice library. I cannot comment if microprocessors can be added. For me, simulating MOSFETs is reason enough to investigate.

All the best....
 

rmeldo

Senior Member
Thanks guys

Thanks guys.

Richard,

I installes SImetrix and I am playing with it.

I am building the model for the circuit in message 1 of the following thread:

http://www.picaxeforum.co.uk/showthread.php?t=11212

I found the transistors in the library, but not the LED and the phototransistor.

A few questions:

What diode could I use to approximate the LED?
Do the libraries have phototransistors?

I found that the phototransistor is a "OSRAM" product. How do you normally go about finding the models for components which are not on the library? Are companies technical support personnel helpful?


Thanks

Riccardo
 

BeanieBots

Moderator
What diode could I use to approximate the LED?
Use a zener diode of the voltage which matches the colour and rating of the LED you want to simulate. Then put a resistor (between 2 and 10 ohms) in series. Put a cap of around 100pF in series with about 100R all in parallel with the zener/resistor.
Can't be more specific without knowing WHICH LED you want to simulate.
 

womai

Senior Member
I recommend LT Spice (also called Switchercad) from Linear Technologies. It's free, has a Yahoo support group, and performance wise is absolutely comparable (and sometimes superior, e.g. for switching power supply simulations) to expensive professional Spice simulators.

There is a limited (but very usable) version of Orcad PSpice available as well. Look for version 9.1 or 9.2. Main restriction is the number of components (50 in a single sheet, or 70 with tricks), but for hobby applications absolutely sufficient. You can download it from one of my websites (go to "Free Tools"):

http://www.testtechniques.com

I also have a small introductory tutorial into PSpice on that website as well.

Actually I have to disagree that in the Spice arena there aren't any (or many) free offerings. In fact the original Spice got started (and still exists) as an open-source university project in the sixties. Look for Berkeley Spice. The other companies have often just taken that one and added their own proprietary modifications, improvements and graphical frontends.

Wolfgang
 
Last edited:
Riccardo,

OSRAM was Infineon and before that Siemens Opto. At work, I have used various Infra-red LEDs from that company in recent years but never simulated circuits using them. I would be surprised if there was a SPICE model for a photo-transistor, but am happy to be proved wrong. One problem is that you can't add the illumination as part of the model.

Which LED and photo-transistor are you using? If the SPICE model isn't mentioned in the datasheet then it may not exist. If the LED and/or photo-transistor are multi-sourced, then you could check out the datasheets for the same devices made by other manufacturers. Othewise follow Beaniebots' suggestion.

Using a simulator allows "what if...?" questions to be investigated quickly.

Richard
 

InvaderZim

Senior Member
I recommend LT Spice (also called Switchercad) from Linear Technologies.
Awesome, I'll need to look at that!

There is a limited (but very usable) version of Orcad PSpice available as well. Look for version 9.1 or 9.2. Main restriction is the number of components (50 in a single sheet, or 70 with tricks), but for hobby applications absolutely sufficient. You can download it from one of my websites (go to "Free Tools")
I currently use Orcad PSpice, but I'm not very good with it. Any advice on how to alter one of the zener diode model breakdown voltages? Every circuit I've wanted to simulate has a zener, seems like :p
 

fernando_g

Senior Member
Riccardo:

In addition to Richard's suggestion, look into LTSpice.
http://www.linear.com/designtools/software/spice_models.jsp
I've used LTSpice for close to a year now, having previously used Berkeley Spice, several variants of PSPice (including the Orcad one, which I never liked) as well as MultiSim and its previous incarnation Electronics Workbench. Oh, and now the Picaxe VSM.

LTSpice is one of the easiest to use, and although it does not have some advanced features (temperature sweeps and MonteCarlo analysis I miss the most) it is extremely powerful, relatively simple to add third party models, and is regularly updated. The switchmode power supplies, at least those from Linear, simulate like a charm. And yes, it is FREE.

Highly recommended.
 

rmeldo

Senior Member
Thanks for the recommendations.

I was wondering where to find the (differential) equations that represent the behaviour of the components. A quick look at the LT Spice directory shows only binary files, no text files. From what I could see in the help the model of the components are not fully described (I might just not hav found the relevant section).

Another useful piece of information could be the "equivalent network" of a component. For example BenieBots suggested to use a Zener Diode + capacitors + resistors to model the behaviour of an LED.

This also prompts another question: What is the smallest set of components from which all other components can be modeled, by a combination of the basic ones?

Are these silly questions?

Riccardo
 

BeanieBots

Moderator
What is the smallest set of components from which all other components can be modeled, by a combination of the basic ones?
Not wanting to sound rude but the very question means that you are not ready to create your own models.

The answer is LCR+V.
You also need to know that ALL values need to be expressed as vectors.

For example, an inductor, capacitor & resistor in series driven by a sawtooth wave generator. You can calculate the voltage across the inductor using nothing other ohms law. However, the "inductive resistance" (etc) will need to be expressed using imaginary numbers. (SQR(-1)).

The LCR values themselves also need to be functions of the time domain.
That is, they change with frequency. ("frequencies" can be compound, eg square=infinite)

A similar analogy to mechanics, MLT.(mass lenght time)
L=mass, R=Friction, C=1/(Spring constant). (C includes the element time, Friction includes length)

For transistors, it's all the above but includes a fixed gain transfer function.
For insights on how to model it, look up "hybrid Pi model".
 
Last edited:

rmeldo

Senior Member
BenieBots,

I have a lot of questions. Most are basic ones, but how to progress if not by asking? Fortunately I am not going to blow anything up on a simulator.

I wasn't thinking of creating my own models. I wanted to check out the parameters and equations used to define one. It is educational.

Thanks for the hint. I will look up the hybrid Pi model

Is there a book that explains the various models?

Thanks Riccardo


P.S. did you see the write up on the 1-wire master?
 

BeanieBots

Moderator
Yes, I did see the 1-wire writeup. Thanks, very good stuff.
Not yet in a position to try it myself but will do at some time soon.

Modelling is a lot about understanding maths as anything else.
You need a full understanding of calculus, imaginary numbers and vector arithmatic. To be honest, those are needed for quite a lot of the more basic analogue circuits anyway.
When it comes to VLSI chips, the internal electronics are NOT usually included within the simulation but have a 'software program' which emulates the overall functionality (based on the datasheet). That is simply because even with today's computers, they would struggle with that many components.
 

rmeldo

Senior Member
BB,

math is not a problem. I am quite knowledgeable on it.

Modelling is a lot about understanding maths as anything else
you got my point.... I need to find the networks and the equations. Which book?

I guess for VLSI must switch from linear analysis (good old Laplace) to time based integration algorithms (SPICE).

What I am interested in are the basic everyday components like, say,

diode
LED
Zener
Transistor (got that)
...
...


Thanks

Riccardo
 

Clive Wallis

New Member
free spice

I'm also very interested in this. Sometime ago I tried out a couple of 'Spice' type simulators. IIRC they were TopSpice and 5Spice. I found that there was a very steep learning curve, and therefore my project is still on a long list of things to do :)

Unfortunately, since trying these programs I've re-installed my operating system, so I'll have to start again. I'll also try simetrix, LTSpice, and Orcad Pspice which others have mentioned.

I've also noticed that there are a lot of simulators which run on Linux, such as gEDA. I would expect most of these to be free.

HTH

Clive
 

BeanieBots

Moderator
Diode, LED & Zener are all the same model but with different values.
It's a perfect diode with ideal volt source resistance and capacitance.
Depending how far you want to go, add inductance for the leads.

Unfortunatley, the model described above (used by most simulators) will not work if you wan't to simulate a circuit which actually uses the logrithmic conduction characteristics. To get that right requires the voltage source to be linked (by the required function) to the curent flowing (and temperature).
For a 'general' diode, simply use a log function, for a 'specific' diode, use an extrapolated lookup table based on the IV curve of the diode in question.

The capacitive & resistive elements need to be reverse calculated from the datasheet to give the required frequency cut-off points.

Sorry, don't know of any specific books on the subject but any good electronics or even physics book should provide the dynamic equations required for capcitive and inductive analysis. Any good maths book should show how to handle imaginary numbers.
 

Jaguarjoe

Senior Member
Three questions about LT spice:

1) Is there a tutorial?
2) How do you add components (like competitor's op-amps?)
3) Where is a potentiometer in LT spice?

Thanks,

Joe
 

fernando_g

Senior Member
1) A specific tutorial on LTSpice other than its help menus and the Yahoo LTSpice usergroup, I have not seen.

2) Read the Help FAQs section, under Third Party Models

3) A potentiometer is a subcircuit, which must be added with an ".include potentiometer.sub" statement, and of course the proper .asy and .sub files loaded. These are in the above referenced usergroup.
 

Jaguarjoe

Senior Member
I found a quick start guide on the L/T website. With that I was able to spice up the analog front end for my combustible gas meter. My physical design will use a National CMOS op amp ( because they're free and come in a dip package) but I was able to find an L/T equivalent for the simulation. Instead of a potentiometer, I just used two fixed resistors and kept varying their ratio. A tad hokey but it worked well none the less. This is just as much fun as breadboarding!
 
Top