Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Adding part to LTSpice

Status
Not open for further replies.

ronv

Well-Known Member
Most Helpful Member
Sorry about the second post but I thought I should put the question in the right place. I am trying to add a 317 regulator to LTSpice. It is my first attempt and I can't get it to work. I copied the code from a post here and pasted into note pad. Saved the symbol into misc. and the model into sub as .asy and .sub. I can insert the part into a schematic but can't simulate. I think I must be doing something wrong with the file type or ????
For some reason I am having trouble opening zip files so I haven't tried other models.
 

Attachments

  • LM317.sub.txt
    1.4 KB · Views: 738
  • 317.PNG
    317.PNG
    38.4 KB · Views: 1,624
  • 317-1.PNG
    317-1.PNG
    59.2 KB · Views: 867
hi,
Try to add .include LM317.sub to LTS diagram

EDIT:
Unzip this zip and keep the 3 files in the same folder
 

Attachments

  • lm317.zip
    1.1 KB · Views: 1,050
  • LM317lim1.asc
    1.2 KB · Views: 826
Last edited:
Is the .include a spice directive or just text? It is added to the schematic?
I'm not sure what i am doing wrong with the zip folders. seems like they used to work. I get a message no files to extract.
I haven't seen the LM317lim1.asc file before. Where does it go?
 
Here is Eric's example, changed around a bit. Since you cant UNZIP a file, I have included three attached files here. Save them to a clean subdirectory on your computer. You will have to rename two of them to get rid of the ".txt" suffix. This web site will not allow uploading of files with .sub or .asy suffix, so I had to use the work around of adding the .txt. You really should fix your ZIP installation because almost LTSpice models exist in .ZIP format.

The thumbnail is a screen shot showing all three files open inside LTSpice, and also includes an Attribute window which opens if you click on the LM317 symbol in the Schematic window.

The first attached file is an LTSPICE schematic:LM317Test.asc which includes an LM317 symbol. Provided the other two files are correctly placed in the same subdirectory, this will simulate.

The simulation subcircuit model of the LM317 is contained in the second attached file LM317.sub. This is a text file which can be opened using LTSpice's Text (or any other) editor. After saving this file in your subdirectory, rename it to get rid of the .txt

The graphics and attributes of the LM317 symbol is defined in the third file LM317.asy. It was created using the LTSpice symbol editor (similar but distinct from the Schematic editor). It can be opened and viewed inside the Symbol editor. After saving this file in your subdirectory, rename it to get rid of the .txt

If you successfully down load three files, and renamed two of them, you will have a running simulation which includes the LM317 and shows how well it regulates...
 

Attachments

  • LM317Test.asc
    1.9 KB · Views: 1,001
  • LM317.sub.txt
    1.4 KB · Views: 854
  • lm317.asy.txt
    403 bytes · Views: 856
  • LM317graphic.png
    LM317graphic.png
    72.9 KB · Views: 2,006
Last edited:
Mike,
Can't thank you enough. I had a few hours in this. Seems there are several ways to do this but yours was very clean .(although I'm not sure I could do it again) I ended up (I think) making a file I called LM317. I then copied it into Misc. in Spice. I wasn't sure where to put it. I don't know what the deal is with my zip files. Neither computer could open any from this site but had no problem with other zips from other sites. The other download I had would never have worked as it didn't have the circuit file.

Thanks Again!!
 
Hi Mike,
This is my first time trying to add a component to LTSpice IV. Can you please upload a video that shows how I can add the three files describing the LM317, which you have uploaded in your latest post, to the LTSpice so that I can use them just like any other component?

Thanks
Adnan
 
I was beginning to think I was the only one who got in a pickle with spice :D welcome to the hair tearing world of spice Ron :D,There are some tutorials out there but none seem to cover the little things like file structure etc.

I think its well worth the effort but I am half way bald from hair tearing already with it
 
Hi Mike,
This is my first time trying to add a component to LTSpice IV. Can you please upload a video that shows how I can add the three files describing the LM317, which you have uploaded in your latest post, to the LTSpice so that I can use them just like any other component?

Thanks
Adnan

Read this recent post.

Sorry, I don't do videos. Read, and follow the steps in this and the linked post.
 
Read this recent post.

Sorry, I don't do videos. Read, and follow the steps in this and the linked post.
While your at it how about a radio show? maybe pop over wash the tractor? lmao gotta love the cheek of some people. How about offering a free post service Mike? people send there project to you (you pay the postage) and then send back completed :D
 
If you want to know all the details about importing 3rd party spice models into LTspice, please see my website. This will talk you through it with worked examples. Best of Luck - Simon
 
Your site looks good Simon, will have to check it out later.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top