LTspice to Kicad schematic conversion

Link : https://github.com/laurentc2/LTspice2Kicad

You can find some python scripts to transfer symbols and schematics from LTspice to Kicad.
The goal under that script is to design and simulate under LTspice and to automatically transfer the circuit (or only a part of it) to Kicad to draw the PCB.
For that, you need to have Python installed and in your path under windows only because LTspice is only under Windows. Note that I use and tested the script with Python 3.6 , LTspiceXVII and Kicad 4.0.7 (for other versions, some minor script(s) changes may be needed)

The method is based on those 2 steps in the directory that contains the LTspice symbols (.asy) and schematic (.asc) : in a command window :

run : LTspice2Kicad.bat
run : python sch_Ltspice2Kicad.py your_schematic.asc

The first step 1. is based on the python script lib_LTspice2Kicad.py and creates many libraries based LTspice symbols library, and also creates a library with all the symbols of the current directory.
The second step 2. transfers the schematic from LTspice to Kicad and creates 2 files : your_schematic.pro and your_schematic.sch

The current limitations, and so, the to-do list is :

  • the hierarchical schematics are not transferred, so only single sheet schematic are properly converted
  • the position of the name and value of the component is arbitrary fixed and do not follow the position of LTspice
  • the schematics and symbols saved in UTF-16-LE format cannot be converted without script customization, except ADA4807 and ADA4895 symbols

I hope that eeSchema will soon allows python scripts as Pcbnew does to include such a script in my menus.

If you have any remarks or if you have found a bug, I can try some correction.

Laurent

2 Likes

Just to clarify - there is no look-up table to convert LTspice symbols to existing KiCAD symbols?

No, all symbols of LTspice symbols are transferred, so any KiCad symbol cannot be used.
The reason, is that resistors, capacitors, … are not proportional, so it would need to change the wires length… maybe in eeSchema with API :slight_smile:

Laurent

1 Like

In the same idea, I just started to work on the hierarchical sheets transfer, but it looks very difficult for a simple transfer due to a limitation in Kicad :

the pins cannot be on the top or one bottom of the sheet ( Why ???)

It is a major inconvenient of Kicad for hierarchical sheet transfer, because it means that the pins have to be shifted on the left and right, but it extend the sheet (or symbol) size and it also needs rerouting of the wires :worried: , well it seems to be a blocking issue.

I can only hope to see pins at the top and bottom of hierarchical sheets in a future version :wink:

Laurent

Has this capability progressed at all since 2017? Should it still work ok on the 5.5 level currently, for simple 1 sheet designs?

Hi John, welcome at this forum.

If you follow Laurent’s link to github, then you’ll see that the last update of that project was on 2017-10-30, which is about the same date as his first post on this thread.

The conversion seems to be a python script, so I recommend to make a backup of your program, and simply try it out and check the results.

Depending on the Operating system you’re using, you may need to install Python first. (Python is a programming language).

Also: if you want to try it, please report back so others can see whether it works or not…

1 Like

…you need to have Python installed and in your path under windows only because LTspice is only under Windows.

LTSpice is also offered for MacOS, so it is not “only under Windows.” See here for download options. Personally, I’ve been running LTSpice (Windows version) in Linux, under WINE, for many years, without problems. Somewhere the manual even says that LTSpice can detect it’s running in Linux under WINE and behave accordingly!

2 Likes

I say chaps,
How about doing it the other way? Draw your schematic in KiCad, then netlist it, then put that netlist into a symbol-block in LTSpice, then put that symbol-block into a test-bed in LTSpice. You should have all the connections from your schematic/PCB on the symbol-block, and that should include any test points you might be interested in. A script to convert a netlist from KiCad-speak into LTSpice-speak should be simple because both are just text files, so you can see what’s going on.
TTFN
rickticktock

You can simulate a netlist coming from Kicad as well :
https://groups.io/g/LTspice/message/116513

Laurent