In this article, We will explain in detail how to add a device model(.model) of SPICE models to LTspice.
It is possible to use it without any problem even in addition to the SPICE model of Analog Devices (including Linear Technology) that is standard installed in LTspice.
What kind of parts can be added by device model?
The device model is a SPICE model in which netlist notation starts with “.model” and is represented only by model parameters.
The following eight types of device models are defined in LTspice and can be added.
- Passive component parts
- standard.res: Resistor
- standard.cap: Capacitor
- standard.ind: Inductor
- standard.bead: Ferrite bead
- Active component parts
- standard.dio: Diode
- standard.bjt: Bipolar transistor
- standard.jft: J-FET
- standard.mos: MOS-FET
If you do not understand the meaning of the device model itself, read the following article.
Device model getting
To obtain a device model, it is easiest to obtain the device model provided by the parts manufacturer.
In this article, we will acquire ON Semiconductor’s NPN bipolar transistor “2N4923” for explanation.
Click the link below to go to the page where you can download the SPICE model on the ON Semiconductor website.
In addition, since it is difficult to understand when moving from the top page of the ON Semiconductor web site, it is faster to search for “simulation model” in the on-site search.
A list of SPICE models that can be downloaded is displayed as shown below.
Enter “2N4923” in the search window and click “Search”.
Although multiple file names with different extensions are displayed, the file extension that can be used with LTspice is “.LIB”. Click “PSpice Model” and the download will start automatically.
Add device model to LTspice
If you open the downloaded “2N4923. LIB” in Notepad, the description starts from .MODEL, so you can see that it is a device model. We will add this device model to LTspice.
Start LTspice and click “File-Open …”.
When the “cmp” folder is opened from “C: \ Users \ USER \ Documents \ LTspiceXVII \ lib \ cmp”, the data file for each part is displayed.
Set the file type to “Discretes” and select and open “standard.bjt” where the data of the bipolar transistor is stored.
The data of the stored bipolar transistor is displayed.
Copy and paste the “2N 4923. LIB” text that you opened earlier in Notepad.
I don’t care anywhere, but this time I will paste it at the bottom for clarity.
As the number of device models added increases, it is easy to understand if you sort by maker and organize it using the comment statement as follows.
.MODEL 2N4923 npn(…)
.MODEL MUN5215 npn(…)
.model BFN24 npn(…)
.model BFP650 npn(…)
.model TIP50 npn(…)
.model BD135 npn(…)
Since “.MODEL Q2n4923 npn” is displayed, “Q2n4923” is displayed on the schematic.
Therefore, correct it as “.MODEL 2N4923 npn”.Also, delete any extra comments.
Since it is anxious about a line feed, let’s correct it in a horizontal row like other data.
Because the line break is represented by “+”, delete the “+” and enclose the parameter in parentheses. Leave a space between each parameter.
Save it after completing the correction.
Alternatively, you can add a device model by saving the device model file in a sub folder.
- Save “2N4923.LIB” to “C:\Users\USER\Documents\LTspiceXVII\lib\sub”.
- In the SPICE Directive, enter “.lib 2N4923.LIB” and place it in the schematic using 2N4923.
※ It works with “.inc” instead of “.lib”.
However, this method is troublesome because it has to place the .lib syntax in the schematic one by one. Again, it would be better to write the device model data directly to the data file.
Confirm the added device model
Open a new schematic editor in LTspice and click Component.
Select “npn” from “Select Component Symbol” and click “OK”.
In this article, the NPN bipolar transistor is used as an example, but the schematic model compatible with other device models is as follows.
- Diode: diode
- Zener diode: zener
- Schottky diode: schottky
- NPN bipolar transistor: npn
- PNP bipolar transistor: pnp
After placing the NPN, right-click to open the “Bipolar Transistor” editing screen.
Click “Pick New Transistor” to display the list of Select Bipolar Transistors stored in standard.bjt.
Check the bottom of the “Select Bipolar Transistor” screen, and there is “2N4923” added, so select it and click OK.
It is changed from “NPN” to “2N4923”. This confirms that the device model has been correctly added to LTspice.