Download and Test MT3608 spice model in ngspice electronics circuit simulator

This is note on how to download and test MT3608 spice model using free ngspice electronics circuit simulator. 

MT3608 Step Up/Boost Converter IC

MT3608 is a popular boost converter IC, inexpensive with high efficiency.  

MT3608 Spice Model | Download Free

Key Specifications

SpecificationValue
Input Voltage Range2V to 24V DC
Output Voltage RangeAdjustable, from 5V up to 28V DC
Maximum Peak Current2 Amps (1A or less recommended for continuous use without a heat sink)
Switching Frequency1.2 MHz (Allows the module to use tiny components)
Peak EfficiencyUp to 93% – 97%

Testing MT3608 spice file

Here we will use ngspice free electronics simulator to check whether the MT3608.LIB spice circuit works or not. 

Download ngspice simulator if you don't already have.

ngspice simulator
Double click on the ngspice.exe application.

There are two ways to test the MT3608 spice model in ngspice simulator.
  • Use the mt3608_test.cir testbench file which incorporates MT3608 spice model
  • Use MT3608_testbench.cir testbench file and include MT3608 spice model separately
MT3608 spice file testing
The required files are below.

MT3608.LIB


* ============================================================
* MT3608 - behavioral model (peak-current-mode boost, 1.2 MHz)
* SPICE3F5-compatible: NO B (arbitrary) sources. Uses only
* R, C, E, G, H, V (DC/PULSE) and S (SW model) elements.
* Built from the Aerosemi datasheet block diagram (Figure 3).
* Simulated OK in ngspice: 5V->12V/200mA gives 11.99V, 1.2MHz.
*
* Pin order (SOT23-6):  1=SW  2=GND(VSS)  3=FB  4=EN  5=IN  6=NC
* ============================================================
* NOTE: pin order matches the netlist Proteus emits for this part: IN FB EN SW VSS
.SUBCKT MT3608 IN FB EN SW VSS
*---- internal rails / thresholds (VSS = IC ground pin)
V5     v5   VSS DC 5
V25    v25  VSS DC 2.5
V50M   v50m VSS DC 0.05
V1V    v1v  VSS DC 1
*---- UVLO and EN as a series-switch AND gate: ok = 5 V when both true
S_UV   v5   n1  IN   VSS M_UV
S_EN   n1   ok  EN   VSS M_EN
R_OK   ok   VSS 100k
*---- 0.6 V reference with soft start: ramps 0.2 V -> 0.6 V over ~1.5 ms
* (starts above the FB level at power-up so the error amp is not driven negative at the DC operating point)
V_REF  refv VSS PULSE(0.2 0.6 20u 1.5m 1n 1 2)
*---- error amplifier (gm stage) + internal compensation
* node vc is the amplifier output = comparator + input
G_EA   VSS  vc  refv FB  100u
R_O    vc   VSS 10Meg
R_C    vc   cc  20k
C_C    cc   VSS 1n
*---- clamp Vc to 0..1 V (1 V / 0.25 V/A = 4 A limit)
S_CH   vc   v1v vc   VSS M_CH
S_CL   vc   VSS VSS  vc  M_CL
*---- current sense (0.25 V per A) and slope ramp, stacked in series
V_SN   sn   VSS DC 0
H_CS   csa  VSS V_SN 0.25
V_RMP sum csa PULSE(0 0.05 2n 832n 1n 0.1n 833.33n)
*---- oscillator: clock (set) and max-duty dead window
V_CLK  clk  VSS PULSE(0 5 2n 1n 1n 40n 833.33n)
V_DMN  dmn  VSS PULSE(5 0 2n 1n 1n 748n 833.33n)
*---- PWM comparator + control logic: SR latch built from switches
* set: clock pulse charges q;  reset: any of four parallel switches discharges q
S_SET  v5   q   clk  VSS M_SET
C_Q    q    VSS 10p
* current-limit reset: only effective after the leading-edge blanking delay (bl high)
S_R1   q    mid sum  vc  M_RSA
S_R1B  mid  VSS bl   VSS M_BL
R_MID  mid  VSS 1Meg
E_QB   qb   VSS q    VSS 1
R_BL   qb   bl  3k
C_BL   bl   VSS 20p
S_R2   q    VSS dmn  VSS M_RSD
S_R3   q    VSS v50m vc  M_RSA
S_R4   q    VSS v25  ok  M_RSA
*---- power MOSFET M1 (80 mOhm) in series with the sense source
S_M    SW   sn  q    VSS M_SW
*---- misc
* small parasitic cap on SW so the node never floats in DCM (helps convergence)
C_SW   SW   VSS 30p
.MODEL M_UV  SW(Ron=1    Roff=1G    Vt=1.93 Vh=0.05)
.MODEL M_EN  SW(Ron=1    Roff=1G    Vt=0.95 Vh=0.55)
.MODEL M_CH  SW(Ron=10   Roff=1G    Vt=1.0005 Vh=0.0005)
.MODEL M_CL  SW(Ron=10   Roff=1G    Vt=0.0005 Vh=0.0005)
.MODEL M_SET SW(Ron=1k   Roff=1G    Vt=2.5  Vh=0.1)
.MODEL M_BL  SW(Ron=1 Roff=1G Vt=2.5 Vh=0.1)
.MODEL M_RSA SW(Ron=10   Roff=1G    Vt=0    Vh=0.001)
.MODEL M_RSD SW(Ron=10   Roff=1G    Vt=2.5  Vh=0.1)
.MODEL M_SW  SW(Ron=0.08 Roff=20Meg Vt=2.5  Vh=0.5)
.ENDS MT3608

* ============================================================

MT3608_test.cir

* MT3608 5V to 12V Boost Converter Testbench

* --- Power Supply and Enable ---
Vin vin 0 DC 5
Ven en  0 DC 5

* --- MT3608 IC Pin Order: IN FB EN SW VSS ---
X1 vin fb en sw 0 MT3608

* --- Boost Power Stage ---
L1 vin sw 22u
D1 sw vout D1N5819
Cout vout 0 22u
Rload vout 0 60  ; 200mA load at 12V (12V / 60 ohms)

* --- Feedback Network (12V Output, Vref = 0.6V) ---
R1 vout fb 190k
R2 fb   0  10k

* --- Diode Model ---
.model D1N5819 D (IS=1e-5 RS=0.1 N=1.05)

* ============================================================
* MT3608 Subcircuit Model
* ============================================================
.SUBCKT MT3608 IN FB EN SW VSS
V5     v5   VSS DC 5
V25    v25  VSS DC 2.5
V50M   v50m VSS DC 0.05
V1V    v1v  VSS DC 1
S_UV   v5   n1  IN   VSS M_UV
S_EN   n1   ok  EN   VSS M_EN
R_OK   ok   VSS 100k
V_REF  refv VSS PULSE(0.2 0.6 20u 1.5m 1n 1 2)
G_EA   VSS  vc  refv FB  100u
R_O    vc   VSS 10Meg
R_C    vc   cc  20k
C_C    cc   VSS 1n
S_CH   vc   v1v vc   VSS M_CH
S_CL   vc   VSS VSS  vc  M_CL
V_SN   sn   VSS DC 0
H_CS   csa  VSS V_SN 0.25
V_RMP sum csa PULSE(0 0.05 2n 832n 1n 0.1n 833.33n)
V_CLK  clk  VSS PULSE(0 5 2n 1n 1n 40n 833.33n)
V_DMN  dmn  VSS PULSE(5 0 2n 1n 1n 748n 833.33n)
S_SET  v5   q   clk  VSS M_SET
C_Q    q    VSS 10p
S_R1   q    mid sum  vc  M_RSA
S_R1B  mid  VSS bl   VSS M_BL
R_MID  mid  VSS 1Meg
E_QB   qb   VSS q    VSS 1
R_BL   qb   bl  3k
C_BL   bl   VSS 20p
S_R2   q    VSS dmn  VSS M_RSD
S_R3   q    VSS v50m vc  M_RSA
S_R4   q    VSS v25  ok  M_RSA
S_M    SW   sn  q    VSS M_SW
C_SW   SW   VSS 30p
.MODEL M_UV  SW(Ron=1    Roff=1G    Vt=1.93 Vh=0.05)
.MODEL M_EN  SW(Ron=1    Roff=1G    Vt=0.95 Vh=0.55)
.MODEL M_CH  SW(Ron=10   Roff=1G    Vt=1.0005 Vh=0.0005)
.MODEL M_CL  SW(Ron=10   Roff=1G    Vt=0.0005 Vh=0.0005)
.MODEL M_SET SW(Ron=1k   Roff=1G    Vt=2.5  Vh=0.1)
.MODEL M_BL  SW(Ron=1 Roff=1G Vt=2.5 Vh=0.1)
.MODEL M_RSA SW(Ron=10   Roff=1G    Vt=0    Vh=0.001)
.MODEL M_RSD SW(Ron=10   Roff=1G    Vt=2.5  Vh=0.1)
.MODEL M_SW  SW(Ron=0.08 Roff=20Meg Vt=2.5  Vh=0.5)
.ENDS MT3608

* --- Simulation Control Commands ---
.control
  tran 100n 3m
  run
  plot v(vout) v(sw)
.endc

.end


MT3608_test.cir Code

******
** ngspice-47 : Circuit level simulation program
** Compiled with KLU Direct Linear Solver
** The U. C. Berkeley CAD Group
** Copyright 1985-1994, Regents of the University of California.
** Copyright 2001-2026, The ngspice team.
** Please get your ngspice manual from https://ngspice.sourceforge.io/docs.html
** Please file your bug-reports at https://ngspice.sourceforge.io/bugrep.html
** Creation Date: Aug 11 2026   13:49:23
******
ngspice 1 -> cd D:\ngspice
Current directory: D:\ngspice
ngspice 2 -> ngspice mt3608_test.cir
ngspice: no such command available in ngspice
ngspice 3 -> source mt3608_test.cir

Note: No compatibility mode selected!


Circuit: * mt3608 5v to 12v boost converter testbench

Doing analysis at TEMP = 27.000000 and TNOM = 27.000000

Using SPARSE 1.3 as Direct Linear Solver

Initial Transient Solution
--------------------------

Node                                   Voltage
----                                   -------
vin                                          5
en                                           5
x1.v5                                        5
x1.v25                                     2.5
x1.v50m                                   0.05
x1.v1v                                       1
x1.n1                                  4.99995
x1.ok                                   4.9999
x1.refv                                    0.2
x1.vc                             -3.74045e-05
fb                                    0.237415
x1.cc                             -3.74045e-05
x1.sn                                        0
x1.csa                                6.25e-08
x1.sum                                6.25e-08
x1.clk                                       0
x1.dmn                                       5
x1.q                               2.49999e-08
x1.mid                             2.49996e-08
x1.bl                              2.49999e-08
x1.qb                              2.49999e-08
sw                                           5
vout                                   4.74829
h.x1.h_cs#branch                             0
v.x1.v_sn#branch                       2.5e-07
l1#branch                            0.0791622
e.x1.e_qb#branch                             0
v.x1.v_dmn#branch                            0
v.x1.v_clk#branch                            0
v.x1.v_rmp#branch                            0
v.x1.v_ref#branch                            0
v.x1.v1v#branch                   -1.00004e-09
v.x1.v50m#branch                             0
v.x1.v25#branch                              0
v.x1.v5#branch                     -5.0004e-05
ven#branch                                   0
vin#branch                          -0.0791622


No. of Data Rows : 649376
Warning: No job (tran, ac, op etc.) defined:
run simulation not started
ngspice 4 -> 
x0 = 0.00126429, y0 = 13.6533    x1 = 0.00197857, y1 = 6.82667
dx = 0.000714286, dy = -6.82667
dy/dx = -9557.33    dx/dy = -0.000104632

x0 = 0.00157143, y0 = 10.9333

Steps to test the MT3608_test.cir spice model/library in ngspice.

To test the MT3608.LIB spice model of MT3608 boost converter IC, you can use the MT3608_test.cir test bench file provided above. You first have to place that file into a folder and use the ngspice.exe command window to cd to that folder. From there use the command source MT3608_test.cir in the command window to run the simulation.

CD to the folder where the MT3608_test.cir is located.

CD D:\ngspice

Then execute the following command:

source MT3608_test.cir

This is as shown below:

ngspice simulator

The following shows the transients graph created by the ngspice simulator:

ngspice simulator graph

This is a good result. The plot shows the output (yellow) and SW (red) from the mt3608_test.cir, the model is behaving like a real boost converter in that testbench.

What the plot shows

  • 0 to 0.2 ms: the output sits at about 5 V and nothing switches. This is expected. With 5 V in, FB is 5 V / 20 = 0.25 V, which is above the starting reference of 0.2 V. The converter stays idle until the reference ramp passes 0.25 V.
  • 0.2 to 1.6 ms: the output follows the reference ramp upward (about 5.4 V per ms), with SW switching continuously. There is no stall and no restart problem.
  • About 1.6 ms: one small overshoot to about 12.3 V, which is roughly 2.5%.
  • After about 2.2 ms: it settles at 12.0 V and stays there, with visible ripple. This is with a 200 mA (60 Ω) load, 22 µH, and your generic 1N5819.

That is the soft-start, regulation and load behavior.

If you have download seperate spice simulation model file like MT3608.LIB, it maybe easier to create the testbench file seperate from the spice model file that you want to test. This is because multiple spice model of similar function that you are looking for can be separately easily tested with separate testbench file like MT3608_testbench.cir.

To test the simultion model this way, you have to run the following:

cd D:/ngspice

source MT3608_testbench.cir

optional commands:

run

plot v(vout)


See further:


Post a Comment

Previous Post Next Post