Si7li/ltspice-spice-circuits huggingface dataset:
* Z:\home\khalils\Downloads\files\data\raw_asc\1045ca855507_transmession.asc
* Generated by LTspice 26.0.1 for Windows.
M3 N002 C 0 0 NMOS l=180n w=270n
M4 N001 C N002 N001 PMOS
V3 A_in 0 PULSE(0 1.8 0 0.1n 0.1n 10n 20n)
C1 B_out 0 50f
M2 A_in C B_out B_out NMOS l=180n w=270n
V2 C 0 PULSE(0 1.8 0 0.1n 0.1n 15n 30n)
M1 A_in N002 B_out A_in PMOS l=180n w=810n
V1 N001 0 1.8
.model NMOS NMOS
.model PMOS PMOS
.lib C:\users\khalils\AppData\Local\LTspice\lib\cmp\standard.mos
.tran 100n
.backanno
.end

* LTspice schematic (.asc):
Version 4.1
SHEET 1 904 680
WIRE -368 -240 -624 -240
WIRE 288 -240 -368 -240
WIRE -368 -208 -368 -240
WIRE 176 -192 128 -192
WIRE 176 -96 176 -112
WIRE 288 -96 288 -240
WIRE 288 -96 176 -96
WIRE -496 -80 -576 -80
WIRE -576 -16 -576 -80
WIRE -368 -16 -368 -128
WIRE -368 -16 -384 -16
WIRE 128 0 128 -192
WIRE 176 0 128 0
WIRE 208 0 176 0
WIRE -384 16 -384 -16
WIRE -384 16 -400 16
WIRE -624 64 -624 -240
WIRE -576 64 -624 64
WIRE -384 64 -384 16
WIRE -384 64 -400 64
WIRE 176 64 176 0
WIRE 176 64 128 64
WIRE 384 64 176 64
WIRE -496 96 -496 -80
WIRE -448 96 -496 96
WIRE 128 112 128 64
WIRE 128 112 96 112
WIRE 384 112 384 64
WIRE -400 128 -400 112
WIRE -16 128 -400 128
WIRE -400 144 -400 128
WIRE 128 160 128 112
WIRE 128 160 96 160
WIRE 384 160 336 160
WIRE -368 192 -400 192
WIRE -16 192 -16 128
WIRE 48 192 -16 192
WIRE 336 208 336 160
WIRE 384 208 336 208
WIRE -496 224 -496 96
WIRE -448 224 -496 224
WIRE -368 240 -368 192
WIRE -368 240 -400 240
WIRE 96 240 96 208
WIRE 96 240 80 240
WIRE -32 256 -96 256
WIRE 96 256 96 240
WIRE 176 256 96 256
WIRE 336 256 336 208
WIRE 336 256 176 256
WIRE -32 272 -32 256
WIRE 80 272 80 240
WIRE 80 272 32 272
WIRE -624 304 -624 64
WIRE -400 304 -400 240
WIRE -400 304 -624 304
WIRE -96 304 -96 256
WIRE -96 304 -400 304
WIRE 176 304 176 256
WIRE 208 304 176 304
WIRE -624 336 -624 304
WIRE -496 352 -496 224
WIRE 432 352 432 192
WIRE 432 352 -496 352
IOPIN -576 -80 In
IOPIN 208 304 Out
IOPIN 208 0 Out
SYMBOL nmos4 432 112 M0
SYMATTR InstName M2
SYMATTR Value2 l=180n w=270n
SYMBOL pmos4 -448 16 R0
SYMATTR InstName M4
SYMBOL voltage 176 -208 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V3
SYMATTR Value PULSE(0 1.8 0 0.1n 0.1n 10n 20n)
SYMBOL nmos4 -448 144 R0
SYMATTR InstName M3
SYMATTR Value2 l=180n w=270n
SYMBOL cap 32 256 R90
WINDOW 0 0 32 VBottom 2
WINDOW 3 32 32 VTop 2
SYMATTR InstName C1
SYMATTR Value 50f
SYMBOL voltage -368 -112 R180
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V1
SYMATTR Value 1.8
SYMBOL pmos4 48 112 R0
SYMATTR InstName M1
SYMATTR Value2 l=180n w=810n
SYMBOL voltage -576 -32 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V2
SYMATTR Value PULSE(0 1.8 0 0.1n 0.1n 15n 30n)
FLAG -576 -80 C
FLAG 208 304 B_out
FLAG 208 0 A_in
FLAG -624 336 0
TEXT -704 440 Left 2 !.tran 100n
* Z:\home\khalils\Downloads\files\data\raw_asc\LTC4217-12.asc
* Generated by LTspice 26.0.1 for Windows.
C1 N005 0 .1
V1 IN 0 12
C2 OUT 0 330
XU1 NC_01 IN N002 NC_02 N005 N005 0 OUT MP_03 MP_04 MP_05 MP_06 NC_07 N003 N002 NC_08 N004 NC_09 LTC4217-12 ;pnba Sense)Vdd)UV)OV)Timer)IntVcc)GND)Out)))))Gate)PG)_FLT)FB)Imon)Iset
R1 N004 0 20K
R2 OUT N003 20K
S1 0 OUT N001 0 SHORT
V2 N001 0 PULSE(0 1 240m 1m 1m 10m)
.model SHORT SW(Ron=10m Roff=1K Vt=.5 Vh=-.4)
.tran 600m startup
* Library below included based on ModelFile attribute of instance XU1 (C:\users\khalils\AppData\Local\LTspice\lib\sym\PowerProducts\LTC4217-12.asy)
.lib LTC4217-12.sub
.backanno
.end

* LTspice schematic (.asc):
Version 4
SHEET 1 1592 680
WIRE 80 16 -48 16
WIRE 416 16 368 16
WIRE 512 16 416 16
WIRE 624 16 512 16
WIRE -48 32 -48 16
WIRE 416 32 416 16
WIRE 512 32 512 16
WIRE 624 32 624 16
WIRE 832 48 672 48
WIRE 928 48 912 48
WIRE 80 80 32 80
WIRE -48 128 -48 112
WIRE 512 128 512 96
WIRE 624 128 624 112
WIRE 416 144 416 112
WIRE 416 144 368 144
WIRE 32 208 32 80
WIRE 80 208 32 208
WIRE 384 208 368 208
WIRE 480 208 464 208
WIRE 432 272 368 272
WIRE 432 336 432 272
WIRE 432 336 368 336
WIRE 432 352 432 336
WIRE 224 416 224 384
WIRE 432 432 432 416
FLAG 432 432 0
FLAG 224 416 0
FLAG 480 208 0
FLAG -48 128 0
FLAG 512 128 0
FLAG 624 128 0
FLAG 672 96 0
FLAG 928 48 0
FLAG -48 16 IN
FLAG 624 16 OUT
SYMBOL cap 416 352 R0
SYMATTR InstName C1
SYMATTR Value .1
SYMBOL voltage -48 16 R0
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName V1
SYMATTR Value 12
SYMBOL cap 496 32 R0
SYMATTR InstName C2
SYMATTR Value 330
SYMBOL LTC4217-12 224 176 R0
SYMATTR InstName U1
SYMBOL res 368 224 R270
WINDOW 0 32 56 VTop 2
WINDOW 3 0 56 VBottom 2
SYMATTR InstName R1
SYMATTR Value 20K
SYMBOL res 400 16 R0
SYMATTR InstName R2
SYMATTR Value 20K
SYMBOL sw 624 128 R180
WINDOW 0 -23 102 Right 2
WINDOW 3 -26 2 Right 2
SYMATTR InstName S1
SYMATTR Value SHORT
SYMBOL voltage 816 48 R270
WINDOW 123 -74 56 VBottom 2
WINDOW 39 -53 56 VBottom 2
WINDOW 0 32 56 VTop 2
WINDOW 3 -32 56 VBottom 2
SYMATTR InstName V2
SYMATTR Value PULSE(0 1 240m 1m 1m 10m)
TEXT 496 368 Left 2 !.model SHORT SW(Ron=10m Roff=1K Vt=.5 Vh=-.4)
TEXT 560 296 Left 2 !.tran 600m startup
* Z:\home\khalils\Downloads\files\data\raw_asc\95511448a503_Draft3.asc
* Generated by LTspice 26.0.1 for Windows.
* Bn/Bp=1
* Bn/Bp=3
* Bn/Bp=0.333
Vin Vin 0 0
VDD VDD 0 5
M2 Vout Vin 0 0 N_1u l=1u w=10u
M1 Vout Vin 0 0 N_1u l=1u w=10u
M5 Vout Vin VDD VDD P_1u l=1u w=10u
M4 Vout Vin VDD VDD P_1u l=1u w=30u
M3 Vout Vin 0 0 N_1u l=1u w=10u
M6 Vout Vin VDD VDD P_1u l=1u w=90u
.model NMOS NMOS
.model PMOS PMOS
.lib C:\users\khalils\AppData\Local\LTspice\lib\cmp\standard.mos
.lib D:\software\pure_models.txt
.dc Vin 0 5
.backanno
.end

* LTspice schematic (.asc):
Version 4
SHEET 1 880 680
WIRE 80 16 48 16
WIRE 464 16 464 -48
WIRE 128 32 128 -48
WIRE 288 32 288 -48
WIRE 416 32 400 32
WIRE 80 48 80 16
WIRE 240 48 224 48
WIRE 224 112 224 48
WIRE 400 112 400 32
WIRE 464 128 464 112
WIRE 496 128 464 128
WIRE 48 144 48 16
WIRE 128 144 128 128
WIRE 144 144 128 144
WIRE 288 144 288 128
WIRE 320 144 288 144
WIRE 464 160 464 128
WIRE 128 176 128 144
WIRE 288 176 288 144
WIRE 576 208 464 208
WIRE 192 224 128 224
WIRE 384 224 288 224
WIRE 400 240 400 112
WIRE 416 240 400 240
WIRE 48 256 48 144
WIRE 80 256 48 256
WIRE 224 256 224 112
WIRE 240 256 224 256
WIRE 576 272 576 208
WIRE 192 288 192 224
WIRE 384 288 384 224
WIRE -48 320 -48 272
IOPIN 144 144 Out
IOPIN 320 144 Out
IOPIN 496 128 Out
SYMBOL voltage -48 176 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName Vin
SYMATTR Value 0
SYMBOL nmos4 240 176 R0
WINDOW 123 56 100 Left 2
SYMATTR InstName M2
SYMATTR Value N_1u
SYMATTR Value2 l=1u w=10u
SYMBOL nmos4 80 176 R0
WINDOW 123 56 100 Left 2
SYMATTR InstName M1
SYMATTR Value N_1u
SYMATTR Value2 l=1u w=10u
SYMBOL pmos4 240 128 M180
WINDOW 123 56 44 Left 2
SYMATTR InstName M5
SYMATTR Value P_1u
SYMATTR Value2 l=1u w=10u
SYMBOL nmos4 416 160 R0
WINDOW 123 56 100 Left 2
SYMATTR InstName M3
SYMATTR Value N_1u
SYMATTR Value2 l=1u w=10u
SYMBOL pmos4 80 128 M180
WINDOW 123 56 44 Left 2
SYMATTR InstName M4
SYMATTR Value P_1u
SYMATTR Value2 l=1u w=30u
SYMBOL voltage -48 32 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName VDD
SYMATTR Value 5
SYMBOL pmos4 416 112 M180
WINDOW 123 56 44 Left 2
SYMATTR InstName M6
SYMATTR Value P_1u
SYMATTR Value2 l=1u w=90u
FLAG 144 144 Vout
FLAG 320 144 Vout
FLAG 496 128 Vout
FLAG 128 272 0
FLAG 288 272 0
FLAG 464 256 0
FLAG 192 288 0
FLAG 384 288 0
FLAG 576 272 0
FLAG -48 320 0
FLAG -48 128 0
FLAG 48 144 Vin
FLAG 400 112 Vin
FLAG 224 112 Vin
FLAG 128 -48 VDD
FLAG 288 -48 VDD
FLAG 464 -48 VDD
FLAG -48 48 VDD
FLAG 128 80 VDD
FLAG 288 80 VDD
FLAG 464 64 VDD
FLAG -48 192 Vin
TEXT 376 384 Left 2 !.lib D:\\software\\pure_models.txt
TEXT -82 404 Left 2 !.dc Vin 0 5
TEXT 64 344 Left 2 ;Bn/Bp=1
TEXT 248 336 Left 2 ;Bn/Bp=3
TEXT 504 320 Left 2 ;Bn/Bp=0.333
* Z:\home\khalils\Downloads\files\data\raw_asc\AD8651.asc
* Generated by LTspice 26.0.1 for Windows.
* Library below included based on ModelFile attribute of instance XU1 (C:\users\khalils\AppData\Local\LTspice\lib\sym\OpAmps\AD8651.asy)
Rload OUT 0 10k
V2 -V 0 -2.5
R1 N001 0 10k
V1 +V 0 2.5
XU1 IN N001 +V -V OUT AD8651 ;pnba In+)In-)V+)V-)OUT
Vin IN 0 SINE(0 1 100k)
R2 OUT N001 10k
.tran 100u
.lib AD8651.lib
.backanno
.end

* LTspice schematic (.asc):
Version 4
SHEET 1 1240 700
WIRE 480 -880 464 -880
WIRE 576 -880 560 -880
WIRE 592 -880 576 -880
WIRE 688 -880 672 -880
WIRE 240 -768 240 -784
WIRE 352 -768 352 -784
WIRE 576 -768 576 -880
WIRE 592 -768 576 -768
WIRE 688 -752 688 -880
WIRE 688 -752 656 -752
WIRE 816 -752 688 -752
WIRE 592 -736 480 -736
WIRE 816 -736 816 -752
WIRE 480 -720 480 -736
WIRE 240 -672 240 -688
WIRE 352 -672 352 -688
WIRE 816 -640 816 -656
WIRE 480 -624 480 -640
SYMBOL res 800 -752 R0
SYMATTR InstName Rload
SYMATTR Value 10k
SYMBOL res 576 -896 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R1
SYMATTR Value 10k
SYMBOL AD8651 624 -816 R0
SYMATTR InstName U1
SYMBOL res 688 -896 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R2
SYMATTR Value 10k
SYMBOL voltage 480 -736 R0
WINDOW 123 24 146 Left 2
WINDOW 39 24 125 Left 2
SYMATTR InstName Vin
SYMATTR Value SINE(0 1 100k)
SYMBOL voltage 352 -784 R0
WINDOW 123 24 146 Left 2
WINDOW 39 24 125 Left 2
SYMATTR InstName V2
SYMATTR Value -2.5
SYMBOL voltage 240 -784 R0
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName V1
SYMATTR Value 2.5
FLAG 240 -784 +V
FLAG 240 -672 0
FLAG 480 -624 0
FLAG 816 -752 OUT
FLAG 480 -736 IN
FLAG 624 -784 +V
FLAG 352 -784 -V
FLAG 624 -720 -V
FLAG 464 -880 0
FLAG 816 -640 0
FLAG 352 -672 0
TEXT 752 -592 Left 2 !.tran 100u
* Z:\home\khalils\Downloads\files\data\raw_asc\LT1375-5.asc
* Generated by LTspice 26.0.1 for Windows.
* Library below included based on ModelFile attribute of instance XU1 (C:\users\khalils\AppData\Local\LTspice\lib\sym\PowerProducts\LT1375-5.asy)
C4 N004 0 10n
XU1 N001 IN N003 N002 MP_01 0 OUT N005 LT1375 top=5.36K bot=5K ;pnba Boost)Vin)SW)_SHDN))GND)Sense)Vc
V1 IN 0 6.2
D2 OUT N001 1N4148
R1 N005 N004 1K
C2 OUT 0 100 Rser=0.05
Rload OUT 0 10
C1 N001 N003 .1
D1 0 N003 MBRS340
L1 N003 OUT 10 Rser=0.02 Rpar=5000
.model D D
.lib C:\users\khalils\AppData\Local\LTspice\lib\cmp\standard.dio
.tran 1m startup
.lib LT1375.sub
.backanno
.end

* LTspice schematic (.asc):
Version 4
SHEET 1 2372 1144
WIRE 1584 672 1456 672
WIRE 1664 672 1584 672
WIRE 1776 672 1728 672
WIRE 1328 688 1120 688
WIRE 1120 704 1120 688
WIRE 1328 704 1328 688
WIRE 1456 704 1456 672
WIRE 1584 704 1584 672
WIRE 1248 784 1232 784
WIRE 1584 784 1584 768
WIRE 1584 784 1536 784
WIRE 1664 784 1584 784
WIRE 1776 784 1776 672
WIRE 1776 784 1744 784
WIRE 1824 784 1776 784
WIRE 1920 784 1824 784
WIRE 1120 800 1120 784
WIRE 1584 800 1584 784
WIRE 1824 800 1824 784
WIRE 1920 800 1920 784
WIRE 1584 880 1584 864
WIRE 1824 896 1824 864
WIRE 1920 896 1920 880
WIRE 1072 912 1056 912
WIRE 1152 912 1136 912
WIRE 1248 912 1232 912
WIRE 1776 912 1776 784
WIRE 1776 912 1536 912
WIRE 1392 1008 1392 992
SYMBOL cap 1136 896 R90
WINDOW 3 32 32 VTop 2
WINDOW 0 0 32 VBottom 2
SYMATTR Value 10n
SYMATTR InstName C4
SYMBOL POLCAP 1808 800 R0
SYMATTR InstName C2
SYMATTR Value 100
SYMATTR SpiceLine Rser=0.05
SYMBOL IND 1648 800 R270
WINDOW 0 32 56 VTop 2
WINDOW 3 5 56 VBottom 2
SYMATTR InstName L1
SYMATTR Value 10
SYMATTR SpiceLine Rser=0.02 Rpar=5000
SYMBOL PowerProducts\\LT1375-5 1392 848 R0
SYMATTR InstName U1
SYMBOL VOLTAGE 1120 688 R0
SYMATTR InstName V1
SYMATTR Value 6.2
SYMBOL res 1904 784 R0
SYMATTR InstName Rload
SYMATTR Value 10
SYMBOL schottky 1568 864 M180
WINDOW 0 36 54 Left 2
WINDOW 3 24 0 Left 2
SYMATTR InstName D1
SYMATTR Value MBRS340
SYMBOL POLCAP 1568 704 R0
SYMATTR InstName C1
SYMATTR Value .1
SYMBOL DIODE 1728 656 R90
WINDOW 0 0 32 VBottom 2
WINDOW 3 32 32 VTop 2
SYMATTR InstName D2
SYMATTR Value 1N4148
SYMBOL res 1248 896 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R1
SYMATTR Value 1K
FLAG 1584 880 0
FLAG 1920 896 0
FLAG 1824 896 0
FLAG 1392 1008 0
FLAG 1120 800 0
FLAG 1056 912 0
FLAG 1920 784 OUT
FLAG 1120 688 IN
TEXT 1592 952 Left 2 !.tran 1m startup
* Z:\home\khalils\Downloads\files\data\raw_asc\AD4003.asc
* Generated by LTspice 26.0.1 for Windows.
* Library below included based on ModelFile attribute of instance XU1 (C:\users\khalils\AppData\Local\LTspice\lib\sym\ADC\AD4003.asy)
V3 N001 0 5
C1 0 N005 10p
V1 N003 0 PWL(0 0 100u 5)
V6 N002 0 1.8
XU1 N001 N002 N004 MP_01 0 N006 N005 N008 AD4003 EN_Hi_Z=1 ;pnba REF)Vdd)IN+))GND)IN-)Vout)CNV
R2 N006 N007 10
R1 N004 N003 10
V4 N008 0 PULSE(0 1.8 227n 0.1n 0.1n 40n 500n)
V2 N007 0 PWL(0 5 100u 0)
.tran 110u
.lib AD4003.sub
.backanno
.end

* LTspice schematic (.asc):
Version 4
SHEET 1 2580 1252
WIRE 704 224 368 224
WIRE 832 224 784 224
WIRE 368 288 368 224
WIRE 704 336 496 336
WIRE 832 336 784 336
WIRE -192 368 -240 368
WIRE -80 368 -112 368
WIRE 80 368 0 368
WIRE 80 416 80 368
WIRE 144 416 80 416
WIRE 560 432 496 432
WIRE 688 432 624 432
WIRE 144 448 80 448
WIRE -192 496 -240 496
WIRE -80 496 -112 496
WIRE 80 496 80 448
WIRE 80 496 0 496
WIRE 704 528 496 528
WIRE 816 528 784 528
WIRE 368 608 368 576
SYMBOL voltage -96 496 R90
WINDOW 0 -32 56 VBottom 2
WINDOW 3 32 56 VTop 2
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V2
SYMATTR Value PWL(0 5 100u 0)
SYMBOL AD4003 400 432 R0
SYMATTR InstName U1
SYMBOL voltage 688 224 R270
WINDOW 0 32 56 VTop 2
WINDOW 3 -32 56 VBottom 2
SYMATTR InstName V3
SYMATTR Value 5
SYMBOL res 16 352 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R1
SYMATTR Value 10
SYMBOL res 16 480 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R2
SYMATTR Value 10
SYMBOL voltage 688 528 R270
WINDOW 0 32 56 VTop 2
WINDOW 3 -32 56 VBottom 2
SYMATTR InstName V4
SYMATTR Value PULSE(0 1.8 227n 0.1n 0.1n 40n 500n)
SYMBOL voltage 688 336 M90
WINDOW 0 47 41 VRight 2
WINDOW 3 -44 39 VRight 2
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName V6
SYMATTR Value 1.8
SYMBOL cap 624 416 R90
WINDOW 0 0 32 VBottom 2
WINDOW 3 32 32 VTop 2
SYMATTR InstName C1
SYMATTR Value 10p
SYMBOL voltage -96 368 R90
WINDOW 0 -32 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName V1
SYMATTR Value PWL(0 0 100u 5)
FLAG 368 608 0
FLAG 832 336 0
FLAG -240 368 0
FLAG 688 432 0
FLAG 816 528 0
FLAG 832 224 0
FLAG -240 496 0
TEXT 192 616 Left 2 !.tran 110u
* Z:\home\khalils\Downloads\files\data\raw_asc\592e925ca8cd_current-limiting-npn.asc
* Generated by LTspice 26.0.1 for Windows.
* Sizing:\nR2 sets max current -> set max current through the load: Imax = 20 mA\nFind R2 at max current assuming its voltage drop is Vbe and Q2 is still not conducting -> R2 = 0.6V/Imax = 30 ohm\nFind base current at the limiting condition where Q2 is still not conducting -> Ib = Ic/100 = 200 uA\nFind R1 using KVL -> 12 = R1*Ib + 0.6 + 0.6 -> R1 = (12 - 1.2)/20 u = 54k ohm\n \nNow see what happens when R load changes -> max current through the circuit is fixed at 20 mA\nPossible application -> LED driver circuit\n \nAfter running the simulation:\n1) CTRL + L or View SPICE error log\n2) Right click -> Plot .step ed .meas data
* Current limiting circuit using NPN transistors
Q1 N001 N002 N003 0 2N3904
R3 Vcc N001 {R_load}
R1 N002 Vcc 54k
R2 0 N003 30
V1 Vcc 0 12
Q2 N002 N003 0 0 2N3904
.model NPN NPN
.model PNP PNP
.lib C:\users\khalils\AppData\Local\LTspice\lib\cmp\standard.bjt
.tran 1
.step param R_load 100 1k 50
.meas Load_current AVG I(R3)
.backanno
.end

* LTspice schematic (.asc):
Version 4
SHEET 1 1828 680
WIRE -128 -48 -128 -96
WIRE 288 -16 288 -64
WIRE -128 64 -128 32
WIRE 288 128 288 64
WIRE 48 176 -32 176
WIRE 160 176 128 176
WIRE 224 176 160 176
WIRE 160 256 160 176
WIRE 288 304 288 224
WIRE 288 304 224 304
WIRE 288 352 288 304
WIRE 160 464 160 352
WIRE 288 464 288 432
SYMBOL res 272 -32 R0
SYMATTR InstName R3
SYMATTR Value {R_load}
SYMBOL res 144 160 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R1
SYMATTR Value 54k
SYMBOL voltage -128 -64 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V1
SYMATTR Value 12
SYMBOL npn 224 256 M0
SYMATTR InstName Q2
SYMATTR Value 2N3904
SYMBOL npn 224 128 R0
SYMATTR InstName Q1
SYMATTR Value 2N3904
SYMBOL res 304 448 R180
WINDOW 0 36 76 Left 2
WINDOW 3 36 40 Left 2
SYMATTR InstName R2
SYMATTR Value 30
FLAG 288 464 0
FLAG 160 464 0
FLAG -128 64 0
FLAG -128 -96 Vcc
FLAG 288 -64 Vcc
FLAG -32 176 Vcc
TEXT 544 -128 Left 2 ;Sizing:\nR2 sets max current -> set max current through the load: Imax = 20 mA\nFind R2 at max current assuming its voltage drop is Vbe and Q2 is still not conducting -> R2 = 0.6V/Imax = 30 ohm\nFind base current at the limiting condition where Q2 is still not conducting -> Ib = Ic/100 = 200 uA\nFind R1 using KVL -> 12 = R1*Ib + 0.6 + 0.6 -> R1 = (12 - 1.2)/20 u = 54k ohm\n \nNow see what happens when R load changes -> max current through the circuit is fixed at 20 mA\nPossible application -> LED driver circuit\n \nAfter running the simulation:\n1) CTRL + L or View SPICE error log\n2) Right click -> Plot .step ed .meas data
TEXT 544 368 Left 2 !.tran 1
TEXT 544 256 Left 2 !.step param R_load 100 1k 50
TEXT 544 312 Left 2 !.meas Load_current AVG I(R3)
TEXT 56 -288 Left 4 ;Current limiting circuit using NPN transistors
* Z:\home\khalils\Downloads\files\data\raw_asc\LTC3406B-1.2.asc
* Generated by LTspice 26.0.1 for Windows.
* Library below included based on ModelFile attribute of instance XU1 (C:\users\khalils\AppData\Local\LTspice\lib\sym\PowerProducts\LTC3406B-1.2.asy)
XU1 IN 0 N001 IN OUT LTC3406B-1.2 ;pnba Run)GND)SW)Vin)Vout
Rload OUT 0 10
L1 N001 OUT 4.7
C1 OUT 0 22
V1 IN 0 5
.tran 500u startup
.lib LTC3406B-1.2.sub
.backanno
.end

* LTspice schematic (.asc):
Version 4
SHEET 1 984 700
WIRE 192 64 96 64
WIRE 352 64 192 64
WIRE 96 80 96 64
WIRE 352 80 352 64
WIRE 192 144 192 64
WIRE 208 144 192 144
WIRE 512 144 496 144
WIRE 624 144 592 144
WIRE 672 144 624 144
WIRE 768 144 672 144
WIRE 672 160 672 144
WIRE 768 160 768 144
WIRE 96 176 96 160
WIRE 672 256 672 224
WIRE 768 256 768 240
WIRE 624 304 624 144
WIRE 624 304 496 304
WIRE 352 384 352 368
SYMBOL ind 496 160 R270
WINDOW 0 32 56 VTop 2
WINDOW 3 5 56 VBottom 2
SYMATTR InstName L1
SYMATTR Value 4.7
SYMBOL VOLTAGE 96 64 R0
SYMATTR InstName V1
SYMATTR Value 5
SYMBOL PowerProducts\\LTC3406B-1.2 352 224 R0
SYMATTR InstName U1
SYMBOL RES 752 144 R0
SYMATTR InstName Rload
SYMATTR Value 10
SYMBOL polcap 656 160 R0
SYMATTR InstName C1
SYMATTR Value 22
FLAG 96 176 0
FLAG 352 384 0
FLAG 672 256 0
FLAG 768 256 0
FLAG 768 144 OUT
FLAG 96 64 IN
TEXT 592 336 Left 2 !.tran 500u startup
* Z:\home\khalils\Downloads\files\data\raw_asc\LT3663.asc
* Generated by LTspice 26.0.1 for Windows.
XU1 IN IN N005 N004 OUT N003 N001 N002 0 LT3663 ;pnba Vin)Run)FB)Ilim)Vout)Isense)Boost)SW)GND
R1 OUT N005 59K
R2 N005 0 11K
L1 N002 N003 6.8
D1 0 N002 MBRS140
C1 N002 N001 .1
C2 OUT 0 22
V1 IN 0 12
R3 N004 0 28.7K
R4 OUT 0 5
.model D D
.lib C:\users\khalils\AppData\Local\LTspice\lib\cmp\standard.dio
.tran 500u startup
* Library below included based on ModelFile attribute of instance XU1 (C:\users\khalils\AppData\Local\LTspice\lib\sym\PowerProducts\LT3663.asy)
.lib LT3663.sub
.backanno
.end

* LTspice schematic (.asc):
Version 4
SHEET 1 880 680
WIRE 288 -48 240 -48
WIRE 400 -48 352 -48
WIRE 240 16 240 -48
WIRE 80 64 -16 64
WIRE 112 64 80 64
WIRE 400 64 400 -48
WIRE 400 64 368 64
WIRE 496 64 400 64
WIRE 592 64 560 64
WIRE -16 80 -16 64
WIRE 400 80 400 64
WIRE -16 176 -16 160
WIRE 80 176 80 64
WIRE 112 176 80 176
WIRE 400 176 400 160
WIRE 400 176 368 176
WIRE 400 272 368 272
WIRE 512 272 400 272
WIRE 608 272 512 272
WIRE 400 288 400 272
WIRE 512 288 512 272
WIRE 608 288 608 272
WIRE 16 384 0 384
WIRE 112 384 96 384
WIRE 400 384 400 368
WIRE 400 384 368 384
WIRE 512 384 512 352
WIRE 608 384 608 368
WIRE 400 400 400 384
WIRE 240 448 240 432
WIRE 400 496 400 480
FLAG 240 448 0
FLAG 400 496 0
FLAG 592 64 0
FLAG 512 384 0
FLAG -16 176 0
FLAG 0 384 0
FLAG 608 384 0
FLAG -16 64 IN
FLAG 608 272 OUT
SYMBOL PowerProducts\\LT3663 240 224 R0
SYMATTR InstName U1
SYMBOL res 384 272 R0
SYMATTR InstName R1
SYMATTR Value 59K
SYMBOL res 384 384 R0
SYMATTR InstName R2
SYMATTR Value 11K
SYMBOL ind 384 64 R0
SYMATTR InstName L1
SYMATTR Value 6.8
SYMBOL schottky 560 48 R90
WINDOW 0 0 32 VBottom 2
WINDOW 3 32 32 VTop 2
SYMATTR InstName D1
SYMATTR Value MBRS140
SYMATTR Description Diode
SYMATTR Type diode
SYMBOL cap 352 -64 R90
WINDOW 0 0 32 VBottom 2
WINDOW 3 32 32 VTop 2
SYMATTR InstName C1
SYMATTR Value .1
SYMBOL cap 496 288 R0
SYMATTR InstName C2
SYMATTR Value 22
SYMBOL voltage -16 64 R0
SYMATTR InstName V1
SYMATTR Value 12
SYMBOL res 112 368 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R3
SYMATTR Value 28.7K
SYMBOL res 592 272 R0
SYMATTR InstName R4
SYMATTR Value 5
TEXT 512 448 Left 2 !.tran 500u startup
* Z:\home\khalils\Downloads\files\data\raw_asc\13f184c89c61_v1.0.asc
* Generated by LTspice 26.0.1 for Windows.
* MOV\n470V
* 220 Vrms\n50Hz
* 100mA
* 400V
* 1W
* Red LEDs
A1 N003 N004 0 0 0 0 IN 0 VARISTOR
DLED3 N008 N009 D
DLED4 N005 N002 D
DLED2 N006 N008 D
R6 N009 0 1k
V1 IN 0 SINE(0 310 50)
DLED1 N002 N006 D
R1 N002 IN 1Meg
DLED6 N009 N007 D
V3 N003 N004 470
C2 N002 IN 100n
DLED5 N007 N005 D
.model D D
.lib C:\users\khalils\AppData\Local\LTspice\lib\cmp\standard.dio
.tran 40m
.backanno
.end

* LTspice schematic (.asc):
Version 4.1
SHEET 1 1116 680
WIRE -192 48 -224 48
WIRE -80 48 -112 48
WIRE -704 128 -704 96
WIRE -544 128 -704 128
WIRE -352 128 -464 128
WIRE -224 128 -224 48
WIRE -224 128 -352 128
WIRE -192 128 -224 128
WIRE -80 128 -80 48
WIRE -80 128 -128 128
WIRE 32 128 -80 128
WIRE 224 128 32 128
WIRE -704 160 -704 128
WIRE 32 176 32 128
WIRE 224 176 224 128
WIRE -352 208 -352 128
WIRE -368 224 -432 224
WIRE -368 256 -384 256
WIRE 32 272 32 240
WIRE 224 272 224 240
WIRE -384 304 -384 256
WIRE -384 304 -432 304
WIRE 32 368 32 336
WIRE 224 368 224 336
WIRE -704 464 -704 240
WIRE -352 464 -352 272
WIRE -352 464 -704 464
WIRE -208 464 -352 464
WIRE 32 464 32 432
WIRE 32 464 -128 464
WIRE 224 464 224 432
WIRE 224 464 32 464
WIRE -704 496 -704 464
SYMBOL res -112 448 R90
WINDOW 0 -29 54 VBottom 2
WINDOW 3 -34 54 VTop 2
SYMATTR InstName R6
SYMATTR Value 1k
SYMBOL LED 208 272 R0
WINDOW 0 -67 27 Left 2
WINDOW 3 -29 50 Left 2
SYMATTR InstName LED2
SYMBOL res -448 112 R90
WINDOW 0 -31 63 VBottom 2
WINDOW 3 -34 54 VTop 2
SYMATTR InstName Fuse
SYMATTR Value 0
SYMBOL voltage -704 144 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
WINDOW 0 40 34 Left 2
WINDOW 3 -60 0 VRight 2
SYMATTR InstName V1
SYMATTR Value SINE(0 310 50)
SYMBOL LED 48 336 R180
WINDOW 0 -70 42 Left 2
WINDOW 3 -30 19 Left 2
SYMATTR InstName LED5
SYMBOL LED 208 176 R0
WINDOW 0 -67 27 Left 2
WINDOW 3 -29 50 Left 2
SYMATTR InstName LED1
SYMBOL cap -128 112 R90
WINDOW 0 0 32 VBottom 2
WINDOW 3 32 32 VTop 2
SYMATTR InstName C2
SYMATTR Value 100n
SYMBOL LED 48 240 R180
WINDOW 0 -69 41 Left 2
WINDOW 3 -28 17 Left 2
SYMATTR InstName LED4
SYMBOL voltage -432 208 R0
WINDOW 0 -67 43 Left 2
WINDOW 3 -80 67 Left 2
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V3
SYMATTR Value 470
SYMBOL res -96 32 R90
WINDOW 0 -31 63 VBottom 2
WINDOW 3 -34 54 VTop 2
SYMATTR InstName R1
SYMATTR Value 1Meg
SYMBOL LED 48 432 R180
WINDOW 0 -70 42 Left 2
WINDOW 3 -30 19 Left 2
SYMATTR InstName LED6
SYMBOL LED 208 368 R0
WINDOW 0 -67 27 Left 2
WINDOW 3 -29 50 Left 2
SYMATTR InstName LED3
SYMBOL SpecialFunctions\\varistor -336 176 R0
WINDOW 0 2 48 Left 2
SYMATTR InstName A1
FLAG -704 496 0
FLAG -704 96 IN
TEXT -648 512 Left 2 !.tran 40m
TEXT -328 248 Left 2 ;MOV\n470V
TEXT -664 208 Left 2 ;220 Vrms\n50Hz
TEXT -536 160 Left 2 ;100mA
TEXT -192 184 Left 2 ;400V
TEXT -192 496 Left 2 ;1W
TEXT 80 488 Left 2 ;Red LEDs