This code is referred from the following repository: https://github.com/laurentc2/LTspice2Kicad
This code is authored by Sumanto Kar, FOSSEE, IIT Bombay and the team members.
The repository contains program to convert LTSpice Schematics to KiCad Schematics.
The repository also contains program to convert LTSpice symbol files(.asy) to KiCad symbol files(.lib).
The code is supported by both Windows and Ubuntu(and flavors) Operating System.
To start with, please clone the repository:
git clone https://github.com/FOSSEE/LTSpiceToKiCadConverter
- Make sure python3 is installed and added to the path
- Switch to src/Windows directory
- Paste the LTspice file(.asc format) to be converted here
- Double Click on the
Sch_CreateBat.bat
script - The LTspice schematic is converted to eSim(KiCad) schematic and project files
- The files are saved in the src/Windows in a folder created with name
LTspice_<schematic_name>
- Make sure python3 is installed and added to the path
- Switch to src/Windows directory
- Run the following command to convert the .asy files contained in a single folder to a .lib file:
Example:
python3 lib_LTspice2Kicad.py <Path to the folder containing the .asy files">
The .asy files will be converted a single .lib file with name LTspice_<folder_name>.lib. For example: LTspice_DAC.libpython3 lib_LTspice2Kicad.py "C:\Program Files\LTC\LTspiceXVII\lib\sym\DAC"
- To convert many folders containg .asy files:
- Edit the path in the
lib_LTspice2Kicad.bat
file using a text editor - Save and close it
- Double click on the Batch files
- All the converted .lib files will be saved in the src/Windows
- Edit the path in the
- Make sure python3 is installed and added to the path
- Switch to src/Ubuntu directory
- Run the following command to convert the LTspice(.asc) files to KiCad Schematic(.sch, .pro and .proj) files:
For Example:
python3 sch_LTspice2Kicad.py <Path to the .asc file">
python3 sch_LTspice2Kicad.py "/home/sumanto/Downloads/ltspice/ltspice/27C.asc"
- The files are saved in a folder(in the same path where the original .asc file exists) created with name
LTspice_<schematic_name>
- Make sure python3 is installed and added to the path
- Switch to src/Ubuntu directory
- Run the following command to convert the .asy files contained in a single folder to a .lib file:
Example:
python3 lib_LTspice2Kicad.py <Path to the folder containing the .asy files">
The .asy files will be converted and save in src/Ubuntu to a single .lib file with name LTspice_<folder_name>.lib. For example: LTspice_DAC.libpython3 lib_LTspice2Kicad.py "python3 lib_LTspice2Kicad.py /home/sumanto/Downloads/ltspice/libs/DAC"
The Example LTspice Schematics(.asc) and Symbol Libraries(.asy) are available in the LTspice software.
Please download the software from the official website.
The converted examples are available here.
The Converted KiCad Schematics with eSim Simulation Plots are available here.
The converted KiCad Symbol Library files are available here.
To change the access of the file and folder
Use this command to change access to the files:
chmod <options> <permissions> <file name>
Example:
chmod u=rwx,g=rx,o=r myfile
You can also use:
sudo chmod 777 filename.
Example:
sudo chmod 777 ~/Desktop/convert/rc
To open the KiCad schematic file in eSim
- Open eSim.
- Create a new project.
- Open the schematic using open schematic option.
- Make sure all the libraries are loaded (9k+) using Place component option in eeschema.
- Append the schematic using Append Schematic option from the file menu
- Go to the directory where your files are converted.
- Select the KiCad coverted schematic file (.sch). Click on Open.
- To simulate, follow the instructions available on the eSim webpage.
To load the KiCad libraries
If all the libraries in eeschema are not loaded, follow these steps:
- In eeschema, select Preferences option.
- Click on the Component Libraries in the drop down list.
- A dialog box appears, click on the Add option.
- Go to the path where your library to be added is saved.
- Select the library to be added and click on Open button.
- Close the dialog box.
- All required libraries SHOULD be added.
- Use proper file format.
- DO NOT TRY TO CONVERT library file as schematic file or vice versa.
- Try adding libraries in the parser.py while getting error.
- DO NOT CHANGE any of the files unless and until needed.
To know everything about eSim, how it works and it's feature please download the manual from here
For any queries regarding eSim please write us on at this email address.
Please refer here for further details.
It is developed by FOSSEE Team at IIT Bombay and is released under GNU GPL License.