Sunday 2 November 2014

Adding components not Supported by LTspice IV

I've been messing around with LTspice IV which is a free circuit simulator from Linear Technology. It is essentially the SPICE circuit simulator (which has been around forever) with a basic GUI including a graph display tool and a means of drawing circuits.

It comes with a broad selection of Linear Technology components as well as a selection of other common components.

Annoyingly it doesn't include some common op amps from other manufacturers (such as a 741 or a LM324 etc). If you want to use cheap components like these it makes simulating harder.

I figured out you can do it however.

I downloaded a SPICE simulation of the LM324 from the Texas Instruments web site. The process for adding a component is


  1. Copy the component into the same directory as your circuit files (in my case this was a file called LM32.lib)
  2. Hit the .op button to add a spice directive and say
    .include LM324.lib
  3. Choose a generic component from the library - in my case this was opamp2 
  4. Right click the component, modify the 'value' parameter to have the same name as the name of the model in the file you included. In my case this was LM324. Make sure the prefix is X (not sure why this matters).
Now when you simulate your circuit it will use the model you included.

There is another way to do this where you can add your component to the library but I found that then you have to draw your own circuit symbol. It seems easier to me if you just use a generic component and specify the model.



No comments:

Post a Comment