Skip to content

SPICE Simulation

MorrisYLin edited this page Sep 8, 2025 · 2 revisions

SPICE Simulation

While it's not always an option, simulating your circuits can be helpful to verify that they function as you expect. KiCAD has Ngspice integrated, a version of the SPICE circuit simulator that can directly read from your schematic layout to create tests. The full documentation is here, but for this project you won't need to go too deep.

Readying Schematic

Source

You'll need a VDC source from the Simulation_SPICE library in KiCAD. Make sure you have it added to the schematic, see the image below for what it looks like. This VDC source will not actually exist on our PCB, it will just be how the simulator interacts with our schematic.

Symbol Exclusion

Additionally, you'll want to exclude all components that aren't a part of the boost converter, as that's the circuit of focus here. The image below shows the properties dialog and "Exclude from Simulation" option to do so. Anything excluded from simulation should have a grey shadow behind it.

image

The right block contains the voltage source for the simulator, it will act as the 12V input. Notice it's connected to the +12V and GND power symbols to connect it with the rest of the circuit

Custom Component Simulation Models

Many complex components like ICs require models to be imported in for Ngspice to know how to interact with them. There are two components here that we must import models for, and you should already have them in your local repo:

  • MC34063A Controller IC: MC33063A-Q1_TRANS.lib
  • 1N5819 Schottky Diode: 1N5819.spice.txt Much of the difficulty with simulation when making your own circuits is finding these models from manufacturers, as they aren't always available. You don't need to import models for the passive components (resistors, capacitors, inductors), as KiCAD infers their behaviors and values from your schematic.

Assigning Models

For each component, open their properties and hit the "Simulation Model..." button at the bottom of the Symbol Properties dialog. Hit the file icon on the Simulation Model Editor window and select the corresponding model file.

For the MC34063A, it will bring up a list of models, select the MC33063A-Q1_TRANS model, then move to the Pin Assignments tab. You'll want the pins to match the below:

image

For the 1N5819, you'll need to do the same:

image

You need to select the pins as KiCAD doesn't know which pins of the Symbol correspond to which pins of the simulation model.

Simulation Dialog

Hit the simulator icon image to open the simulator dialog. After that, hit the new simulation icon image on the top toolbar.

Set the simulation to TRAN - Transient Analysis. This simulation mode simply simulates the circuit for a fixed amount of time. Then, configure the SPICE command. Play around with values to see what works best:

  • Time step: Dictates the amount of time between plotted points. The ideal value changes depending on the circuit simulated, I tried 100u (100 microseconds).
  • Final time: The total length of the simulation. Experiment with this value, I tried 30m (30 milliseconds). On the right, you can click which nets (connections) to read voltage, current, and power off of. Pick your input and output voltage nets.
image

Once your simulation looks something like mine, you can move on.

Next Steps

See Board Layout

Clone this wiki locally