* Z:\home\khalils\Downloads\files\data\raw_asc\308d9e971004_LED_Driver.asc
* Generated by LTspice 26.0.1 for Windows.
* LM324 OPERATIONAL AMPLIFIER "MACROMODEL" SUBCIRCUIT
* CREATED USING PARTS RELEASE 4.01 ON 09/08/89 AT 10:54
* (REV N/A) SUPPLY VOLTAGE: 5V
* CONNECTIONS: NON-INVERTING INPUT
* | INVERTING INPUT
* | | POSITIVE POWER SUPPLY
* | | | NEGATIVE POWER SUPPLY
* | | | | OUTPUT
* | | | | |
*
* LM324 HI = Vcc-1.5V so need to compensate to make sure the LEDs are off when the LM324 is HI.
* Library below included based on ModelFile attribute of instance XU6 (C:\users\khalils\AppData\Local\LTspice\lib\sym\OpAmps\OP284.asy)
DLN 92 90 DX
XU10 N006 N003 N001 0 N004 LM324 ;pnba In+)In-)V+)V-)OUT
REE 10 99 19.92E6
V8 N018 0 PULSE(3.3 0 500u 100n 100n 1m 2m)
D3 N008 N012 D
RC1 4 11 7.957E3
Q1 11 2 13 QX
RO1 8 5 50
XU6 N015 N013 N007 0 N014 OP284 ;pnba In+)In-)V+)V-)OUT
VLIM 7 8 DC 0
Q2 12 1 14 QX
VE 54 4 DC .6
V1 N001 0 12
V2 N016 0 PULSE(3.3 0 250u 100n 100n 1m 2m)
XU8 N015 N018 N007 0 N019 LM324 ;pnba In+)In-)V+)V-)OUT
VB 9 0 DC 0
R5 N010 N014 {r_limit}
Q1 N001 N005 N007 0 2N2222
GCM 0 6 10 99 7.067E-9
V7 N013 0 PULSE(3.3 0 0 100n 100n 1m 2m)
R7 N012 N019 {r_limit}
EGND 99 0 POLY(2) (3,0) (4,0) 0 .5 .5
R17 N005 N004 1k
D1 N008 N010 D
R3 N008 N007 56
R20 N004 N003 10k
D2 N008 N011 D
RO2 7 99 50
R2 0 N006 10k
R24 N015 0 10k
VLP 91 0 DC 40
V3 N002 0 3.3
HLIM 90 0 VLIM 1K
VC 3 53 DC 2.100
R23 N002 N015 10k
DP 4 3 DX
R2 6 9 100.0E3
RE1 13 10 2.773E3
DC 5 53 DX
R19 N006 N002 10k
RP 3 4 30.31E3
R6 N011 N017 {r_limit}
RC2 4 12 7.957E3
RE2 14 10 2.773E3
XU7 N015 N016 N007 0 N017 LM324 ;pnba In+)In-)V+)V-)OUT
GA 6 0 11 12 125.7E-6
C1 11 12 5.544E-12
C2 6 7 20.00E-12
VLN 0 92 DC 40
DE 54 5 DX
DLP 90 91 DX
IEE 3 10 DC 10.04E-6
R1 N003 N009 1k
R18 N009 0 {pot_r}
FB 7 99 POLY(5) VB VC VE VLP VLN 0 15.91E6 -20E6 20E6 20E6 -20E6
.model D D
.lib C:\users\khalils\AppData\Local\LTspice\lib\cmp\standard.dio
.model NPN NPN
.model PNP PNP
.lib C:\users\khalils\AppData\Local\LTspice\lib\cmp\standard.bjt
.SUBCKT LM324 1 2 3 4 5
.MODEL DX D(IS=800.0E-18)
.MODEL QX PNP(IS=800.0E-18 BF=250)
.ENDS
.tran 10n 10m
.param r_limit=670
.param pot_r={10k/64}
.lib OP284.sub
.backanno
.end

* LTspice schematic (.asc):
Version 4
SHEET 1 2576 7696
WIRE -1232 -2496 -1392 -2496
WIRE -912 -2496 -1232 -2496
WIRE -1232 -2400 -1232 -2496
WIRE -1232 -2288 -1232 -2320
WIRE -1632 -2208 -1856 -2208
WIRE -1344 -2176 -1472 -2176
WIRE -1216 -2176 -1264 -2176
WIRE -1632 -2160 -1632 -2208
WIRE -912 -2096 -912 -2496
WIRE -1392 -2080 -1392 -2496
WIRE -1472 -2064 -1472 -2176
WIRE -1424 -2064 -1472 -2064
WIRE -1216 -2048 -1216 -2176
WIRE -1216 -2048 -1360 -2048
WIRE -1136 -2048 -1216 -2048
WIRE -976 -2048 -1056 -2048
WIRE -1856 -2032 -1856 -2208
WIRE -1760 -2032 -1856 -2032
WIRE -1632 -2032 -1632 -2080
WIRE -1424 -2032 -1632 -2032
WIRE -1632 -1984 -1632 -2032
WIRE -1472 -1984 -1472 -2064
WIRE -1392 -1984 -1392 -2016
WIRE -1856 -1936 -1856 -2032
WIRE -912 -1936 -912 -2000
WIRE -720 -1936 -912 -1936
WIRE -128 -1936 -640 -1936
WIRE -1632 -1840 -1632 -1904
WIRE -1472 -1840 -1472 -1904
WIRE -1856 -1824 -1856 -1856
WIRE -128 -1808 -128 -1936
WIRE -128 -1808 -192 -1808
WIRE -80 -1808 -128 -1808
WIRE 32 -1808 -80 -1808
WIRE -192 -1744 -192 -1808
WIRE -80 -1744 -80 -1808
WIRE 32 -1744 32 -1808
WIRE -192 -1616 -192 -1680
WIRE -80 -1616 -80 -1680
WIRE 32 -1616 32 -1680
WIRE -912 -1600 -912 -1936
WIRE -912 -1600 -992 -1600
WIRE -880 -1600 -912 -1600
WIRE -736 -1600 -880 -1600
WIRE -1472 -1568 -1472 -1760
WIRE -2336 -1504 -2768 -1504
WIRE -992 -1504 -992 -1600
WIRE -2336 -1488 -2336 -1504
WIRE -1024 -1488 -2336 -1488
WIRE -192 -1472 -192 -1536
WIRE -192 -1472 -960 -1472
WIRE -2768 -1456 -2768 -1504
WIRE -1024 -1456 -1104 -1456
WIRE -992 -1408 -992 -1440
WIRE -2768 -1344 -2768 -1376
WIRE -880 -1328 -880 -1600
WIRE -912 -1312 -2768 -1312
WIRE -80 -1296 -80 -1536
WIRE -80 -1296 -848 -1296
WIRE -1104 -1280 -1104 -1456
WIRE -912 -1280 -1104 -1280
WIRE -2768 -1248 -2768 -1312
WIRE -880 -1232 -880 -1264
WIRE -2768 -1136 -2768 -1168
WIRE -736 -1104 -736 -1600
WIRE -768 -1088 -2112 -1088
WIRE -2112 -1072 -2112 -1088
WIRE -2112 -1072 -2768 -1072
WIRE 32 -1072 32 -1536
WIRE 32 -1072 -704 -1072
WIRE -1104 -1056 -1104 -1280
WIRE -768 -1056 -1104 -1056
WIRE -2768 -1040 -2768 -1072
WIRE -736 -1008 -736 -1040
WIRE -2768 -928 -2768 -960
WIRE -1760 -736 -1760 -2032
WIRE -1760 -608 -1760 -656
WIRE -1104 -608 -1104 -1056
WIRE -1104 -608 -1760 -608
WIRE -1760 -560 -1760 -608
WIRE -1760 -416 -1760 -480
RECTANGLE Normal -292 -1888 308 -1636 2
SYMBOL OpAmps/OP284 -992 -1536 R0
SYMATTR InstName U6
SYMBOL voltage -2768 -1472 R0
SYMATTR InstName V7
SYMATTR Value PULSE(3.3 0 0 100n 100n 1m 2m)
SYMBOL res -1488 -2000 R0
SYMATTR InstName R1
SYMATTR Value 1k
SYMBOL res 16 -1632 R0
SYMATTR InstName R7
SYMATTR Value {r_limit}
SYMBOL voltage -1232 -2416 R0
SYMATTR InstName V1
SYMATTR Value 12
SYMBOL OpAmps/opamp2 -736 -1136 R0
SYMATTR InstName U8
SYMATTR Value LM324
SYMBOL voltage -2768 -1264 R0
SYMATTR InstName V2
SYMATTR Value PULSE(3.3 0 250u 100n 100n 1m 2m)
SYMBOL OpAmps/opamp2 -1392 -2112 R0
SYMATTR InstName U10
SYMATTR Value LM324
SYMBOL res -1616 -1888 R180
WINDOW 0 36 76 Left 2
WINDOW 3 36 40 Left 2
SYMATTR InstName R2
SYMATTR Value 10k
SYMBOL LED -208 -1744 R0
SYMATTR InstName D1
SYMBOL voltage -2768 -1056 R0
SYMATTR InstName V8
SYMATTR Value PULSE(3.3 0 500u 100n 100n 1m 2m)
SYMBOL npn -976 -2096 R0
SYMATTR InstName Q1
SYMATTR Value 2N2222
SYMBOL res -1776 -752 R0
SYMATTR InstName R23
SYMATTR Value 10k
SYMBOL res -1488 -1856 R0
SYMATTR InstName R18
SYMATTR Value {pot_r}
SYMBOL OpAmps/opamp2 -880 -1360 R0
SYMATTR InstName U7
SYMATTR Value LM324
SYMBOL res -1616 -2064 R180
WINDOW 0 36 76 Left 2
WINDOW 3 36 40 Left 2
SYMATTR InstName R19
SYMATTR Value 10k
SYMBOL res -624 -1952 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R3
SYMATTR Value 56
SYMBOL res -1248 -2192 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R20
SYMATTR Value 10k
SYMBOL res -1776 -576 R0
SYMATTR InstName R24
SYMATTR Value 10k
SYMBOL res -96 -1632 R0
SYMATTR InstName R6
SYMATTR Value {r_limit}
SYMBOL res -1040 -2064 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R17
SYMATTR Value 1k
SYMBOL LED 16 -1744 R0
SYMATTR InstName D3
SYMBOL voltage -1856 -1952 R0
SYMATTR InstName V3
SYMATTR Value 3.3
SYMBOL LED -96 -1744 R0
SYMATTR InstName D2
SYMBOL res -208 -1632 R0
SYMATTR InstName R5
SYMATTR Value {r_limit}
FLAG -2768 -1344 0
FLAG -2768 -1136 0
FLAG -2768 -928 0
FLAG -992 -1408 0
FLAG -880 -1232 0
FLAG -736 -1008 0
FLAG -1392 -1984 0
FLAG -1472 -1568 0
FLAG -1232 -2288 0
FLAG -1856 -1824 0
FLAG -1760 -416 0
FLAG -1632 -1840 0
TEXT -3936 -2288 Left 2 !* LM324 OPERATIONAL AMPLIFIER "MACROMODEL" SUBCIRCUIT\n* CREATED USING PARTS RELEASE 4.01 ON 09/08/89 AT 10:54\n* (REV N/A)      SUPPLY VOLTAGE: 5V\n* CONNECTIONS:   NON-INVERTING INPUT\n*                | INVERTING INPUT\n*                | | POSITIVE POWER SUPPLY\n*                | | | NEGATIVE POWER SUPPLY\n*                | | | | OUTPUT\n*                | | | | |\n.SUBCKT LM324    1 2 3 4 5\n*\n  C1   11 12 5.544E-12\n  C2    6  7 20.00E-12\n  DC    5 53 DX\n  DE   54  5 DX\n  DLP  90 91 DX\n  DLN  92 90 DX\n  DP    4  3 DX\n  EGND 99  0 POLY(2) (3,0) (4,0) 0 .5 .5\n  FB    7 99 POLY(5) VB VC VE VLP VLN 0 15.91E6 -20E6 20E6 20E6 -20E6\n  GA    6  0 11 12 125.7E-6\n  GCM   0  6 10 99 7.067E-9\n  IEE   3 10 DC 10.04E-6\n  HLIM 90  0 VLIM 1K\n  Q1   11  2 13 QX\n  Q2   12  1 14 QX\n  R2    6  9 100.0E3\n  RC1   4 11 7.957E3\n  RC2   4 12 7.957E3\n  RE1  13 10 2.773E3\n  RE2  14 10 2.773E3\n  REE  10 99 19.92E6\n  RO1   8  5 50\n  RO2   7 99 50\n  RP    3  4 30.31E3\n  VB    9  0 DC 0\n  VC 3 53 DC 2.100\n  VE   54  4 DC .6\n  VLIM  7  8 DC 0\n  VLP  91  0 DC 40\n  VLN   0 92 DC 40\n.MODEL DX D(IS=800.0E-18)\n.MODEL QX PNP(IS=800.0E-18 BF=250)\n.ENDS
TEXT -2432 -2512 Left 2 !.tran 10n 10m
TEXT -2496 -2416 Left 2 !.param r_limit=670
TEXT -2480 -2360 Left 2 !.param pot_r={10k/64}
TEXT -680 -2048 Left 2 ;LM324 HI = Vcc-1.5V so need to compensate to make sure the LEDs are off when the LM324 is HI.