Anyone who enjoys working with LTspice will appreciate the included component models. For more complex components, however, these are largely limited to components from the Analog Devices portfolio. Even simpler components such as transistors or diodes are sometimes missing but require more detailed simulation. Most manufacturers often offer a whole range of models for components such as transistors. An internet search for "SPICE model transistor xyz" promises useful results.
In such cases, it is necessary to search for external component models and then integrate them into the simulation. LTspice offers various ways to do this, as shown in the following diagram.
The solutions for standard components
Model placement on the circuit diagram
Standard components are components such as transistors, diodes, or resistors. All of these are already represented by symbols in LTspice. For example, if you want to add a new transistor that isn't yet available in LTspice, you can quickly install it as follows (we'll use the BC817 NPN transistor from On Semiconductor as an example).
(1) Download a SPICE file, which many manufacturers provide on their websites. These SPICE files typically have the extension ".lib," ".sub," or ".mod." In our case, the file is located at: https://www.onsemi.com/pub/Collateral/SBC817-40L.LIB.LIB
If you open this file in an editor, you will see a readable file, starting with a “.MODEL” command, followed by the name of the model (in our case “Qbc81740lt1g”) and the name of the base element (here “npn”).
The remaining lines merely form parameter sets for the basic element of the npn transistor.
(2) We create a circuit in LTspice that contains one or more NPN transistors. Now we simply copy the entire contents of the BC817 transistor's .lib file into the schematic next to the circuit as a Spice directive. To do this, we click the following button in the toolbar:
Next, we copy the contents of the .lib file into the text field, click "OK," and place our model anywhere in the schematic. We also rename the transistor value to the name of the transistor model. In this case, it's the somewhat cumbersome "Qbc81740lt1g." The result will then look something like this:
The simulation can now be started.
Integration via include statement
The disadvantage of the above-mentioned method is the increasing complexity when inserting multiple models into the schematic. A similar approach using the include statement is recommended. This does not require the entire model code to be placed in the schematic, but rather just a statement with a reference to the respective model file.
It is only necessary that the model file is located in the same working directory as the simulation file itself.
The simulation can now be started successfully again.
Integrate directly into the standard library
If you want to avoid placing the component model directly on the schematic or including it via the Include command, you can also include it directly in LTspice's standard library. The standard library is usually accessed by right-clicking on a standard component in the schematic. A window will open where you can then click "Pick New Transistor."
A list of the models already stored in LTspice for the respective standard component will then open. To add the BC817 transistor model to this list, open the "standard.bjt" file (.bjt = bipolar junction transistor) in the "LTspiceXVII\lib\cmp" directory. (LTspiceXVII is now located under Documents in Windows by default.)
The result after inserting it into the “standard.bjt” looks like this:
If you now open the standard library by right-clicking on an NPN transistor and then clicking "Pick New Transistor," the list of standard transistors opens. At the top of the list is our BC817 with its clunky name "Qbc81740lt1g" (which can, of course, be customized as desired).
By selecting our transistor, the simulation can be started without requiring an include command or direct model placement on the schematic. This is useful if you plan to use a component frequently in the future.
Integrate more complex models as subcircuits
More complex Spice models, which (among other things) are constructed from several standard elements, can also be easily integrated into LTspice. An example is the AP8803 LED driver from Diodes Inc.


The Spice model of this device can be downloaded from the Diodes Inc. website (https://www.diodes.com/assets/Spice-Models/Discrete-Prodcut-Groups/Medium-Voltage-DC-DC-LED-Drivers.txtWe now open this file in LTspice by clicking "File → Open" and then opening the file "Medium-Voltage-DC-DC-LED-Drivers.txt." LTspice automatically highlights the file in color, which is very convenient. The result looks like this:
If you now mark the .subckt line, which is displayed in blue font, and right-click on it, a larger selection window appears in which we click on “Create Symbol”.
LTspice then asks us “Do you wish to automatically create a symbol that will netlist against the subcircuit AL8803_SIMETRIX and her 5 ports?”, which we confirm with Yes. Now we're taken to the symbol editor in LTspice, where we can freely customize it, with a few exceptions, and create a symbol to our liking. However, the following simple symbol appears first:
We can assign the numbers next to the 5 connection pins to the connection pins from the datasheet using the subcircuit netlist:

Now we can begin designing our symbol as we wish. The only thing to keep in mind is that the Unnn should remain. This is a placeholder for LTspice and will later be automatically replaced by a sequential number in the schematic. Additionally, the symbol center is defined by the crosshairs, so this is also important to keep in mind.
However, the border box and the pin connections can be moved and designed as desired. After a few editing steps, our symbol now looks like this:
We save the symbol and can now use our LED driver in a simulation. To do this, open a simulation and place a new component. The "Select Component Symbol" dialog box will appear. Here, we'll find a new folder called "[AutoGenerated]," which contains the "AL8803_SIMETRIX" component.
We insert the block into our circuit diagram and add a few standard components to start the simulation.
Eureka! The LED driver, a type of buck converter with an internal switching MOSFET, regulates a current of approximately 200mA through our LED.
If you have any questions about integrating external models or general questions about simulations in LTspice, please don't hesitate to contact us. We'll be happy to help.
















