LTspice-Addition of Device model(.model)

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.

Also, "Addition of Sub-circuit model(.subckt)" is explained in the following article.

TOC

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.

Device model types
  • 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.

1

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.

2

A list of SPICE models that can be downloaded is displayed as shown below.

LTspice XVII Serch 2N4923

Enter "2N4923" in the search window and click "Search".

3
LTspice XVII 2N4923 PSpice

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

1
LTspice XVII 2N4923.LIB

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.

2
LTspice XVII Open

Start LTspice and click "File-Open …".

3
LTspice XVII standard.bjt

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.

4
LTspice XVII Stored Bipolar Transistor

The data of the stored bipolar transistor is displayed.

5
LTspice XVII Copy Paste 2N4923

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.

Organizing by manufacturer

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.


*ON Semiconductor
.MODEL 2N4923 npn(…)
.MODEL MUN5215 npn(…)
*Infineon Technologies
.model BFN24 npn(…)
.model BFP650 npn(…)
*ST Microelectronics
.model TIP50 npn(…)
.model BD135 npn(…)

6
LTspice XVII Correct .MODEL 2N4923 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.

7
LTspice XVII Delete +

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.

8
LTspice XVII Save .MODEL 2N4923 npn

Save it after completing the correction.

Other ways to add device models

Alternatively, you can add a device model by saving the device model file in a sub folder.

  1. Save "2N4923.LIB" to "C:\Users\USER\Documents\LTspiceXVII\lib\sub".
  2. 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

1
LTspice XVII Component

Open a new schematic editor in LTspice and click Component.

2
LTspice XVII Select npn

Select "npn" from "Select Component Symbol" and click "OK".

Schematic symbol compatible with device model

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
  • Nch-JFET:njf
  • Pch-JFET:pjf
  • Nch-MOSFET:nmos
  • Pch-MOSFET:pmos
3
LTspice XVII Place NPN

After placing the NPN, right-click to open the "Bipolar Transistor" editing screen.

4
LTspice XVII Pick New Transistor

Click "Pick New Transistor" to display the list of Select Bipolar Transistors stored in standard.bjt.

5
LTspice XVII Select 2N4923

Check the bottom of the "Select Bipolar Transistor" screen, and there is "2N4923" added, so select it and click OK.

6
LTspice XVII Changed 2N4923

It is changed from "NPN" to "2N4923". This confirms that the device model has been correctly added to LTspice.

Let's share this post !
TOC