2
\$\begingroup\$

I want to import the LM393 part into my LTspice program library. The file download doesn't have a .lib or .asy file that my other files have. It's from Texas Instruments and is supposed to be a PSpice file, but only comes with a 5_1 file.

Could you explain how I can get it into my library?

\$\endgroup\$
1
  • 2
    \$\begingroup\$ The .5_1 extension is irrelevant. It's still an unencrypted text file with a .subckt inside. Copy it to your \Documents\LTspiceXVII\lib\sub folder. You can either put a SPICE directive down as .lib LM393A.5_1 or you can rename the file to a .LIB extension and do a .lib LM393A.LIB. Both are equivalent. There are plenty of answers discussing how to add 3rd party models to LTspice. I say check those out and if you still have trouble I can write you a custom tutorial for the LM393. \$\endgroup\$
    – Ste Kulov
    Oct 16, 2020 at 2:16

2 Answers 2

4
\$\begingroup\$

If you go to your link and select the "LM393A PSpice Model" download, you will get a ZIP file. If you reach into the ZIP file you'll find a simple text file with the following contents:

* LM393A VOLTAGE COMPARATOR "MACROMODEL" SUBCIRCUIT
* CREATED USING PARTS VERSION 4.03 ON 03/07/90 AT 14:17
* REV (N/A)
* CONNECTIONS:   NON-INVERTING INPUT
*                | INVERTING INPUT
*                | | POSITIVE POWER SUPPLY
*                | | | NEGATIVE POWER SUPPLY
*                | | | | OPEN COLLECTOR OUTPUT
*                | | | | |
.SUBCKT LM393A   1 2 3 4 5
*
  F1    9  3 V1 1
  IEE   3  7 DC 100.0E-6
  VI1  21  1 DC .75
  VI2  22  2 DC .75
  Q1    9 21  7 QIN
  Q2    8 22  7 QIN
  Q3    9  8  4 QMO
  Q4    8  8  4 QMI
.MODEL QIN PNP(IS=800.0E-18 BF=2.000E3)
.MODEL QMI NPN(IS=800.0E-18 BF=1002)
.MODEL QMO NPN(IS=800.0E-18 BF=1000 CJC=1E-15 TR=807.4E-9)
  E1   10  4  9  4  1
  V1   10 11 DC 0
  Q5    5 11  4 QOC
.MODEL QOC NPN(IS=800.0E-18 BF=20.29E3 CJC=1E-15 TF=942.6E-12 TR=543.8E-9)
  DP    4  3 DX
  RP 3  4 46.3E3
.MODEL DX  D(IS=800.0E-18)
*
.ENDS

Do a "copy" of this by using ctrl-A and then ctrl-C or whatever works for you in coping the above contents.

Once that is done, hit ctrl-S in LTspice to start up a Spice dialog box. When that is opened up, hit ctlr-V to paste that prior information into the new Spice dialog box. Click OK and then place this contents somewhere on your schematic.

Now. you need to find an appropriate symbol to match up with the above. You could just make one, if you like. But it turns out that there is already a convenient one. Hit F2 and then investigate the [Opamps] folder and then find "opamp2" within that section. Pick it and drop it onto your schematic.

Right-click over that new schematic symbol and it will pop up a "component Attribute Editor" dialog box. Here, under the the line (or row) that says "Value" you can change this to "LM393A". Click on the OK button to accept that choice.

You now have a symbol and also the test version of the folder. That's all good.

Hook up your (-) and (+) lines appropriately, now. And then add in the rest of the circuit. That should do the job.

\$\endgroup\$
1
\$\begingroup\$

You can easily find tutorials on importing models, including creation of a symbol.

The file is a .SUBCKT as you can see if you open it:

* LM393A VOLTAGE COMPARATOR "MACROMODEL" SUBCIRCUIT
* CREATED USING PARTS VERSION 4.03 ON 03/07/90 AT 14:17
* REV (N/A)
* CONNECTIONS:   NON-INVERTING INPUT
*                | INVERTING INPUT
*                | | POSITIVE POWER SUPPLY
*                | | | NEGATIVE POWER SUPPLY
*                | | | | OPEN COLLECTOR OUTPUT
*                | | | | |
.SUBCKT LM393A   1 2 3 4 5
*
  F1    9  3 V1 1
  IEE   3  7 DC 100.0E-6
  VI1  21  1 DC .75
  VI2  22  2 DC .75
  Q1    9 21  7 QIN
  Q2    8 22  7 QIN
  Q3    9  8  4 QMO
  Q4    8  8  4 QMI
.MODEL QIN PNP(IS=800.0E-18 BF=2.000E3)
.MODEL QMI NPN(IS=800.0E-18 BF=1002)
.MODEL QMO NPN(IS=800.0E-18 BF=1000 CJC=1E-15 TR=807.4E-9)
  E1   10  4  9  4  1
  V1   10 11 DC 0
  Q5    5 11  4 QOC
.MODEL QOC NPN(IS=800.0E-18 BF=20.29E3 CJC=1E-15 TF=942.6E-12 TR=543.8E-9)
  DP    4  3 DX
  RP 3  4 46.3E3
.MODEL DX  D(IS=800.0E-18)
*
.ENDS
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.