qucs_s/library/Optocoupler.lib
2023-10-25 09:11:20 +03:00

401 lines
11 KiB
Plaintext

<Qucs Library 2.1.0 "Optocoupler">
<Component 4N25>
<Description>
4N25 BJT optocoupler
</Description>
<Model>
.Def:Optocoupler_4N25 _net0 _net1 _net2 _net3
Sub:X1 _net0 _net1 _net2 _net3 gnd Type="n4N25_cir"
.Def:End
</Model>
<ModelIncludes "4N25.cir.lst">
<Spice>* Qucs 2.1.0 Optocoupler_4N25.sch
* OPTO-ISO from User Library in TURBO SPICE
* Orig 8/17/99
* Modified TMH 2/15/23
*
*4N25 NPN Optoisolator pkg:DIP6
* Transistor Base not modeled
* A K C E
.SUBCKT 4N25 1 2 5 4
VM 1 12 DC 0
D1 12 2 LED
R1 10 11 450
C1 11 0 1000PF
H1 10 0 VM 3.33E-2
G1 5 6 11 0 1
Q1 5 6 4 QNPN
.MODEL LED D(IS=2.5E-12 RS=.75 CJO=3.5E-11 N=2)
.MODEL QNPN NPN(IS=3.33E-11 NF=1.35 CJC=4.74E-11 CJE=167E-12 TF=9.23E-10 TR=1.48E-7 BF=150 BR=10 IKF=.1 VAF=100)
.ENDS
.SUBCKT Optocoupler_4N25 gnd _net0 _net1 _net2 _net3
X1 _net0 _net1 _net2 _net3 4N25
.ENDS
</Spice>
<Symbol>
<Line -21 6 -18 0 #000080 2 1>
<Line -21 -6 -18 0 #000080 2 1>
<Line 20 15 0 -30 #000080 3 1>
<Line 30 30 0 -15 #000080 2 1>
<Line 20 -5 10 -10 #000080 2 1>
<Arrow 20 5 10 10 6 3 #000080 2 1 1>
<Line -30 6 -9 -12 #000080 2 1>
<Line -30 6 9 -12 #000080 2 1>
<Line -6 -6 4 -4 #000080 2 1>
<Line -12 -12 6 6 #000080 2 1>
<Arrow -2 -10 10 10 9 3 #000080 2 1 1>
<Arrow -4 0 10 10 9 3 #000080 2 1 1>
<Line -8 4 4 -4 #000080 2 1>
<Line -14 -2 6 6 #000080 2 1>
<Line -50 -20 100 0 #808080 2 1>
<Line -50 20 0 -40 #808080 2 1>
<Line 50 20 0 -40 #808080 2 1>
<Line -30 30 0 -24 #000080 2 1>
<Line -30 -6 0 -24 #000080 2 1>
<Line 30 -15 0 -15 #000080 2 1>
<Line -50 20 100 0 #808080 2 1>
<.PortSym -30 -30 1 0>
<.PortSym -30 30 2 0>
<.PortSym 30 -30 3 180>
<.PortSym 30 30 4 180>
<.ID 70 -16 X>
</Symbol>
</Component>
<Component 4N33>
<Description>
4N33 Darlington optocoupler
</Description>
<Model>
.Def:Optocoupler_4N33 _net3 _net4 _net2 _net0 _net1
Sub:X2 _net0 _net1 _net2 _net3 _net4 gnd Type="n4n33_cir"
.Def:End
</Model>
<ModelIncludes "4n33.cir.lst">
<Spice>* Qucs 2.1.0 Optocoupler_4N33.sch
.subckt 4n33_MC 4 5 3 1 2
* 4 -> LED ANODE 5 -> LED CATHODE
* 3 -> EMITTER 1 -> COLLECTOR 2 -> BASE
DIO 4 10 4n33_dio
VD 10 5 0V
RD 4 5 6e7
FDD 0 2 VD 0.15
RF 2 0 1e9
CF 1 4 1e-12
XDAR 1 2 3 4n33_dar
RDAR 1 3 4e9
* MODEL FORMAT: PSpice
.MODEL 4n33_dio d(
+ IS=2.90836e-12 RS=1.81548 N=2 EG=0.644108
+ XTI=3.99996 BV=1000 IBV=0.0001 CJO=2.02387e-11
+ VJ=0.4 M=0.271299 FC=0.5 TT=1e-09
+ KF=0 AF=1)
.ends 4n33_MC
.SUBCKT 4n33_dar 1 2 3
* MODEL FORMAT: PSpice
* Darlington macro model
* External node designations
* Node 1 -> Collect
* Node 2 -> Base
* Node 3 -> Emitter
Q1 1 2 4 qmodel
Q2 1 4 3 q1model 8.93463
D1 3 1 dmodel
R1 2 4 10000
R2 4 3 1000
* Default values used in dmodel
* EG=1.11 TT=0 BV=infinite
.MODEL dmodel d(
+ IS=1e-12 RS=10.5392 N=1.00539 XTI=3.00539
+ CJO=0 VJ=0.75 M=0.33 FC=0.5
.MODEL qmodel npn(
+ IS=2.40152e-12 BF=46.1011 NF=1.2 VAF=30
+ IKF=0.00662634 ISE=9.73117e-14 NE=1.23006 BR=4.14416
+ NR=1.5 VAR=146.759 IKR=0.0662634 ISC=9.73117e-14
+ NC=2.0474 RB=10.7666 IRB=0.205422 RBM=10.5475
+ RE=0.100058 RC=0.99859 XTB=0.457057 XTI=2.9909 EG=1.05
+ CJE=1e-11 VJE=0.75 MJE=0.33 TF=1e-09
+ XTF=1 VTF=10 ITF=0.01 CJC=1e-11
+ VJC=0.75 MJC=0.33 XCJC=0.9 FC=0.5
+ TR=1e-07 PTF=0 KF=0 AF=1)
.MODEL q1model npn(
+ IS=2.40152e-12 BF=46.1011 NF=1.2 VAF=30
+ IKF=0.00662634 ISE=9.73117e-14 NE=1.23006 BR=4.14416
+ NR=1.5 VAR=146.759 IKR=0.0662634 ISC=9.73117e-14
+ NC=2.0474 RB=10.7666 IRB=0.205422 RBM=10.5475
+ RE=0.100058 RC=0.99859 XTB=0.457057 XTI=2.9909 EG=1.05
+ CJE=1e-11 VJE=0.75 MJE=0.33 TF=1e-09
+ XTF=1 VTF=10 ITF=0.01 CJC=0
+ VJC=0.75 MJC=0.33 XCJC=0.9 FC=0.5
+ TR=1e-07 PTF=0 KF=0 AF=1)
.ENDS
.SUBCKT Optocoupler_4N33 gnd _net3 _net4 _net2 _net0 _net1
X2 _net0 _net1 _net2 _net3 _net4 4n33_MC
.ENDS
</Spice>
<Symbol>
<.ID 70 -16 X>
<Line -21 6 -18 0 #000080 2 1>
<Line -21 -6 -18 0 #000080 2 1>
<Line -30 6 -9 -12 #000080 2 1>
<Line -30 6 9 -12 #000080 2 1>
<Line -30 30 0 -24 #000080 2 1>
<Line -30 -6 0 -24 #000080 2 1>
<Line 40 15 0 -30 #000080 3 1>
<Line 50 30 0 -15 #000080 2 1>
<Line 40 -5 10 -10 #000080 2 1>
<Arrow 40 5 10 10 6 3 #000080 2 1 1>
<Line 50 -15 0 -15 #000080 2 1>
<Line 20 -10 0 -20 #000080 2 1>
<Line 40 0 -10 0 #000080 2 1>
<Line 30 0 -10 -10 #000080 2 1>
<Line 4 -6 4 -4 #000080 2 1>
<Line -2 -12 6 6 #000080 2 1>
<Arrow 8 -10 10 10 9 3 #000080 2 1 1>
<Arrow 6 0 10 10 9 3 #000080 2 1 1>
<Line 2 4 4 -4 #000080 2 1>
<Line -4 -2 6 6 #000080 2 1>
<Line -45 20 0 -40 #000080 2 1>
<Line 65 20 0 -40 #000080 2 1>
<Line -45 20 110 0 #000080 2 1>
<Line -45 -20 110 0 #000080 2 1>
<.PortSym -30 -30 4 180>
<.PortSym -30 30 5 0>
<.PortSym 50 30 3 180>
<.PortSym 50 -30 1 0>
<.PortSym 20 -30 2 0>
</Symbol>
</Component>
<Component MOC223>
<Description>
MOC223 Darlington optocoupler
</Description>
<Model>
.Def:Optocoupler_MOC223 _net0 _net2 _net1 _net3 _net4
Sub:X2 _net3 _net4 _net1 _net0 _net2 gnd Type="moc223_cir"
.Def:End
</Model>
<ModelIncludes "moc223.cir.lst">
<Spice>* Qucs 2.1.0 Optocoupler_MOC223.sch
.subckt moc223_MC 4 5 3 1 2
DIO 4 10 moc223_dio
VD 10 5 0V
RD 4 5 6e7
FI 0 11 VD 1
RFI 11 0 1000
XDL 11 0 12 delay_Sub
VDD 12 13 0
RXDL 13 0 1000
FDD 0 2 VDD 0.1
RF 2 0 1e9
CF 1 4 1e-12
XDAR 1 2 3 moc223_dar
RDAR 1 3 4e9
.MODEL moc223_dio d
+ IS=2.12534e-12 RS=1.37765 N=2 EG=0.6
+ XTI=2.96819 BV=1000 IBV=0.0001 CJO=1.84171e-11
+ VJ=1.203 M=0.356504 FC=0.5 TT=1e-09
+ KF=0 AF=1
.ends moc223_MC
.SUBCKT delay_Sub 1 2 3
RIN 1 2 1.0E9
E1 10 0 1 2 1
TD 10 0 11 0 Z0=50 TD=3e-06
RD 11 0 50
EO 30 2 11 0 1
RO1 30 3 1
RO2 3 2 1.0E9
.ENDS
.SUBCKT moc223_dar 1 2 3
Q1 1 2 4 qmodel
Q2 1 4 3 q1model 8.88022
D1 3 1 dmodel
R1 2 4 10000
R2 4 3 1000
* Default values used in dmodel
* EG=1.11 TT=0 BV=infinite
.MODEL dmodel d
+ IS=1e-12 RS=9.52529 N=0.995253 XTI=2.99525
+ CJO=0 VJ=0.75 M=0.33 FC=0.5
.MODEL qmodel npn
+ IS=2.99506e-12 BF=19.5647 NF=1.11791 VAF=56.0325
+ IKF=0.088067 ISE=1.43852e-13 NE=2.13329 BR=1.01562
+ NR=1.45409 VAR=98.9714 IKR=0.0952542 ISC=9.99997e-14
+ NC=1.99519 RB=9.57894 IRB=0.195253 RBM=9.52549
+ RE=0.0977153 RC=0.999915 XTB=0.503191 XTI=2.99553 EG=1.11591
+ CJE=2.15822e-11 VJE=0.95 MJE=0.23 TF=9.99885e-10
+ XTF=1 VTF=10 ITF=0.01 CJC=1.56635e-11
+ VJC=0.432344 MJC=0.345351 XCJC=0.9 FC=0.5
+ TR=1e-07 PTF=0 KF=0 AF=1
.MODEL q1model npn
+ IS=2.99506e-12 BF=19.5647 NF=1.11791 VAF=56.0325
+ IKF=0.088067 ISE=1.43852e-13 NE=2.13329 BR=1.01562
+ NR=1.45409 VAR=98.9714 IKR=0.0952542 ISC=9.99997e-14
+ NC=1.99519 RB=9.57894 IRB=0.195253 RBM=9.52549
+ RE=0.0977153 RC=0.999915 XTB=0.503191 XTI=2.99553 EG=1.11591
+ CJE=2.15822e-11 VJE=0.95 MJE=0.23 TF=9.99885e-10
+ XTF=1 VTF=10 ITF=0.01 CJC=0
+ VJC=0.432344 MJC=0.345351 XCJC=0.9 FC=0.5
+ TR=1e-07 PTF=0 KF=0 AF=1
.ENDS
.SUBCKT Optocoupler_MOC223 gnd _net0 _net2 _net1 _net3 _net4
X2 _net3 _net4 _net1 _net0 _net2 moc223_MC
.ENDS
</Spice>
<Symbol>
<.ID 70 -16 X>
<Line -21 6 -18 0 #000080 2 1>
<Line -21 -6 -18 0 #000080 2 1>
<Line -30 6 -9 -12 #000080 2 1>
<Line -30 6 9 -12 #000080 2 1>
<Line -30 30 0 -24 #000080 2 1>
<Line -30 -6 0 -24 #000080 2 1>
<Line 40 15 0 -30 #000080 3 1>
<Line 50 30 0 -15 #000080 2 1>
<Line 40 -5 10 -10 #000080 2 1>
<Arrow 40 5 10 10 6 3 #000080 2 1 1>
<Line 50 -15 0 -15 #000080 2 1>
<Line 20 -10 0 -20 #000080 2 1>
<Line 40 0 -10 0 #000080 2 1>
<Line 30 0 -10 -10 #000080 2 1>
<Line 4 -6 4 -4 #000080 2 1>
<Line -2 -12 6 6 #000080 2 1>
<Arrow 8 -10 10 10 9 3 #000080 2 1 1>
<Arrow 6 0 10 10 9 3 #000080 2 1 1>
<Line 2 4 4 -4 #000080 2 1>
<Line -4 -2 6 6 #000080 2 1>
<Line -45 20 0 -40 #000080 2 1>
<Line 65 20 0 -40 #000080 2 1>
<Line -45 20 110 0 #000080 2 1>
<Line -45 -20 110 0 #000080 2 1>
<.PortSym -30 -30 4 180>
<.PortSym -30 30 5 0>
<.PortSym 50 30 3 180>
<.PortSym 50 -30 1 0>
<.PortSym 20 -30 2 0>
</Symbol>
</Component>
<Component MOC3082>
<Description>
MOC3082 OPTO TRIAC with zero crossing switching
model provided by Helmut Sennewald 11/23/2008
</Description>
<Model>
.Def:Optocoupler_MOC3082 _net0 _net3 _net1 _net2
Sub:X1 _net0 _net3 _net1 _net2 gnd Type="MOC3082_sub_cir"
.Def:End
</Model>
<ModelIncludes "MOC3082_sub.cir.lst">
<Spice>* Qucs 2.1.0 Optocoupler_MOC3082.sch
* OPTO TRIAC With Zero Crossing Switching
* Helmut Sennewald 11/23/2008
* 04/12/2009, change in B-sources: V(ctrl10) -> V(ctrl10,4)
*
* Ported to ngspice Vadim Kusnetsov 2/15/23
*
* MOC3082 I_trig=10mA
* D+ D- MT2 MT1
*
.subckt moc3082_sub 1 2 3 4
.PARAM Itrig=10m
.PARAM RH1=20k
.PARAM RH2=20k
.PARAM RH3=16.7k
Q1 vb1p vb1 4 0 NPN1
Q2 vb1 vb1p vd1 0 PNP1
R3 vb1 4 {RH2}
D1 1 2 DL
R1 ctrl10 4 1
C1 ctrl10 4 10u
R2 ctrl1 vb1 {RH1}
R4 vd1 vb1p {RH3}
B1 ctrl10 4 I=-500*I(D1)*3m/Itrig
R7 vb2p 4 {RH3}
R6 vd2 vb2 {RH2}
Q3 vb2p vb2 vd2 0 NPN1
Q4 vb2 vb2p 4 0 PNP1
D3 vd2 3 D1
D2 3 vd1 D1
R5 N001 vb2 {RH1}
E1 vd2 N001 ctrl1 4 -1
R34 3 4 100MEG
R12 ctrl1 4 1
B2 ctrl1 4 V=(V(ctrl10,4)>1.45 && abs(V(34)) < 12?2:0)
C2 ctrl1 4 1u
B3 34 0 I=-V(3,4)/1000
R13 34 0 1k
C3 34 0 .1u
.MODEL PNP1 PNP(Is=1e-15 BF=10 Cjc=10p Cje=20p Tf=0.1u Ise=1e-12)
.MODEL NPN1 NPN(Is=1e-15 BF=10 Cjc=10p Cje=20p Tf=0.1u Ise=1e-12)
.MODEL D1 D(Is=0.1u Rs=2 Cj0=50p)
.MODEL DL D(Is=1e-20 Rs=5)
*.ends moc3082_sub
.ends moc3082
.SUBCKT Optocoupler_MOC3082 gnd _net0 _net3 _net1 _net2
X1 _net0 _net3 _net1 _net2 moc3082_sub
.ENDS
</Spice>
<Symbol>
<.ID -40 -96 X>
<.PortSym -60 -30 1 0>
<.PortSym -60 30 2 0>
<.PortSym 80 -30 3 180>
<.PortSym 80 30 4 180>
<Line -30 -30 -30 0 #000080 2 1>
<Line -60 30 30 0 #000080 2 1>
<Line -40 -10 20 0 #000080 2 1>
<Line -40 -10 10 20 #000080 2 1>
<Line -40 10 20 0 #000080 2 1>
<Line -30 30 0 -20 #000080 2 1>
<Line -30 -30 0 20 #000080 2 1>
<Line -30 10 10 -20 #000080 2 1>
<Rectangle -50 -50 120 100 #000080 2 1 #c0c0c0 1 0>
<Line 40 6 0 24 #000080 2 1>
<Line 40 -30 0 24 #000080 2 1>
<Line 58 6 -36 0 #000080 2 1>
<Line 22 10 5 0 #000080 2 3>
<Line 27 10 4 -4 #000080 2 3>
<Line 31 6 -9 -12 #000080 2 1>
<Line 31 6 9 -12 #000080 2 1>
<Line 49 -6 9 12 #000080 2 1>
<Line 49 -6 -9 12 #000080 2 1>
<Line 58 -6 -36 0 #000080 2 1>
<Line -10 2 4 -4 #000080 2 1>
<Line -16 -4 6 6 #000080 2 1>
<Arrow -6 -2 10 10 9 3 #000080 2 1 1>
<Arrow -8 8 10 10 9 3 #000080 2 1 1>
<Line -12 12 4 -4 #000080 2 1>
<Line -18 6 6 6 #000080 2 1>
<Rectangle 6 14 24 20 #000080 2 1 #c0c0c0 1 0>
<Line 22 14 0 -4 #000080 2 3>
<Text 8 18 8 #000080 0 "ZCC">
<Line 14 14 0 -28 #000080 2 3>
<Line 14 -14 26 0 #000080 2 3>
<Line 30 24 10 0 #000080 2 3>
<Line 80 30 -40 0 #000080 2 1>
<Line 80 -30 -40 0 #000080 2 1>
</Symbol>
</Component>