* Z:\home\khalils\Downloads\files\data\raw_asc\dimmer.asc
* Generated by LTspice 26.0.1 for Windows.
XQ1 P001 N002 DIAC VK=30 ;pnba +)-
V1 A 0 SINE(0 166 60)
R1 N002 A {Rdim}
C1 N002 0 .062
Rload A B 135
XU1 B P001 0 TRIAC ;pnba MT2)G)MT1
B1 N001 0 V=V(A,B)*I(Rload)
R2 LoadPower N001 50K
C3 LoadPower 0 1
.tran .3
.subckt DIAC T1 T2
* default parameters
.param RS=10 ; series resistance
.param VK=20 ; breakdown voltage
Q1 N002 N001 T2 0 PN
Q2 N001 N002 N005 0 NP
R1 N002 N004 {20K*(VK-1)}
R2 N004 T2 9.5K
R3 N002 N005 9.5K
Q3 N004 N003 N005 0 PN
Q4 N003 N004 T2 0 NP
R4 T1 N005 {RS}
.model PN NPN Cjc=10p Cje=10p
.model NP PNP Cjc=10p Cje=10p
.ends DIAC
.subckt TRIAC MT2 G MT1
.param R=10K
Q1 N001 G MT1 0 NP
Q2 N001 N002 MT2 0 NP
Q3 N002 N001 MT1 0 PN
Q4 G N001 MT2 0 PN
R1 MT2 N002 {R}
R2 G MT1 {R}
.model PN NPN Cjc=10p Cje=10p
.model NP PNP Cjc=10p Cje=10p
.ends TRIAC
.step param Rdim list 1K 50K 100K 200K 300K 325K
* This example schematic is supplied for informational/educational purposes only.
* Light Bulb
.backanno
.end

* LTspice schematic (.asc):
Version 4
SHEET 1 1636 680
WIRE 176 16 -32 16
WIRE 368 16 176 16
WIRE 448 16 368 16
WIRE 368 32 368 16
WIRE 176 64 176 16
WIRE 592 96 512 96
WIRE 752 96 672 96
WIRE -32 112 -32 16
WIRE 368 128 368 112
WIRE 448 128 368 128
WIRE 512 128 512 96
WIRE 752 128 752 96
WIRE 368 144 368 128
WIRE 176 208 176 144
WIRE 256 208 176 208
WIRE 176 224 176 208
WIRE 512 240 512 208
WIRE 752 240 752 192
WIRE -32 304 -32 192
WIRE 176 304 176 288
WIRE 176 304 -32 304
WIRE 368 304 368 208
WIRE 368 304 176 304
WIRE -32 320 -32 304
FLAG -32 320 0
FLAG 512 240 0
FLAG 752 240 0
FLAG 448 16 A
FLAG 448 128 B
FLAG 752 96 LoadPower
SYMBOL misc\\DIAC 320 176 R90
WINDOW 0 0 32 VBottom 2
WINDOW 3 64 32 VTop 2
WINDOW 123 92 32 VTop 2
SYMATTR InstName Q1
SYMATTR Value2 VK=30
SYMBOL voltage -32 96 R0
WINDOW 0 10 -1 Left 2
WINDOW 3 9 103 Left 2
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
SYMATTR InstName V1
SYMATTR Value SINE(0 166 60)
SYMBOL res 160 160 M180
WINDOW 0 36 76 Left 2
WINDOW 3 36 40 Left 2
SYMATTR InstName R1
SYMATTR Value {Rdim}
SYMBOL cap 160 224 R0
SYMATTR InstName C1
SYMATTR Value .062
SYMBOL res 352 16 R0
WINDOW 0 36 23 Left 2
WINDOW 3 45 83 Left 2
SYMATTR InstName Rload
SYMATTR Value 135
SYMBOL misc\\TRIAC 336 144 R0
SYMATTR InstName U1
SYMBOL bv 512 112 R0
WINDOW 0 11 8 Left 2
WINDOW 3 10 101 Left 2
SYMATTR InstName B1
SYMATTR Value V=V(A,B)*I(Rload)
SYMBOL res 688 80 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R2
SYMATTR Value 50K
SYMBOL cap 736 128 R0
SYMATTR InstName C3
SYMATTR Value 1
TEXT 40 336 Left 2 !.tran .3
TEXT -472 -16 Left 2 !.subckt DIAC T1 T2\n* default parameters\n.param RS=10 ; series resistance\n.param VK=20 ; breakdown voltage\nQ1 N002 N001 T2 0 PN\nQ2 N001 N002 N005 0 NP\nR1 N002 N004 {20K*(VK-1)}\nR2 N004 T2 9.5K\nR3 N002 N005 9.5K\nQ3 N004 N003 N005 0 PN\nQ4 N003 N004 T2 0 NP\nR4 T1 N005 {RS}\n.model PN NPN Cjc=10p Cje=10p\n.model NP PNP Cjc=10p Cje=10p\n.ends DIAC
TEXT -888 40 Left 2 !.subckt TRIAC MT2 G MT1\n.param R=10K\nQ1 N001 G MT1 0 NP\nQ2 N001 N002 MT2 0 NP\nQ3 N002 N001 MT1 0 PN\nQ4 G N001 MT2 0 PN\nR1 MT2 N002 {R}\nR2 G MT1 {R}\n.model PN NPN Cjc=10p Cje=10p\n.model NP PNP Cjc=10p Cje=10p\n.ends TRIAC
TEXT 40 368 Left 2 !.step param Rdim list 1K 50K 100K 200K 300K 325K
TEXT 160 424 Top 1 ;This example schematic is supplied for informational/educational purposes only.
TEXT 392 72 Left 2 ;Light Bulb