Automate LTspice Circuit Simulation Using Python Scripting

for Electrical Engineers

Update history

What you’ll learn

  • Automate LTspice simulation.
  • Use Python programming to create LTspice circuit files.
  • Able to run unlimited number of simulation cases just by one click.
  • Create the raw data from LTspice using Python.
  • Import LTspice .raw data to the world of Python.
  • Plot the data in Python IDE.
  • Read measurement from LTspice log files into Python.
  • Save plotted figures as image files.

Course Content

  • Introduction –> 2 lectures • 8min.
  • Software Installation –> 3 lectures • 1min.
  • Run LTspice using Python –> 11 lectures • 1hr 2min.
  • Read raw data using Python –> 9 lectures • 57min.
  • Plot data using Python –> 5 lectures • 33min.
  • Read measurement log file using Python –> 3 lectures • 16min.
  • Project: the 2nd order Low-Pass Filter (LPF) –> 4 lectures • 19min.
  • Congratulations –> 1 lecture • 1min.

Automate LTspice Circuit Simulation Using Python Scripting

Requirements

  • Basics of SPICE circuit simulation (LTspice preferable).
  • Basics of programming experience (Python preferable).
  • A windows OS PC with LTspice XVII installed.
  • A windows OS PC with Python IDE (e.g., Anaconda and Spyder).
  • Sorry this course is NOT prepared in macOS.

Update history

07/19/2020: Course material “Material v1.16 (2020-07-19).zip” is uploaded: “ltspy3meas” module is updated to fix a bug in reading the measurement name list

06/28/2020: Course material “Material v1.15 (2020-06-28).zip” is uploaded: New Section “Sec5-6 Spyder graphics backend setting”.

06/15/2020: Course material “Material v1.14 (2020-06-15).zip” is uploaded: “ltspy3meas” has been updated to import .step measurement.

06/10/2020: Course material “Material v1.13 (2020-06-10).zip” is uploaded. The output solution waveforms of the 2nd order LPF project are corrected.

05/05/2020: Note that 1080p video is NOW available. Just go to video “settings” and enable the “Auto option”. Then 1080p streaming will become possible for you!

05/06/2020: the pdf of “Sec5-2 Intro to Matplotlib” is updated on page 3 to avoid some potential bugs.

05/05/2020: The Matlab file name for Sec3-3 Bode Plot is changed to “BodePlot_Matlab.m”

04/19/2020: A bug is fixed in “ltspy3meas” for Section 6 Lecture 32: Read Measurement data in log file

  • A detailed step-by-step tutorial about how to automate LTspice circuit simulation using Python scripting
  • LTspice is the #1 SPICE simulation tools that is free, robust and fast. But it requires a lot of human efforts to run manually.
  • Python can automate LTspice for you!
  • Python is so easy to learn that is prefect for electrical engineers
  • Python can unleash the full potential of LTspice
  • Python can save you time and money from tedious and time-consuming LTspice simulation
  • Read raw data into Python and plot it as figures
  • Python opens the door for you to the world of data science