* SPICE netlist
R1 N007 0 33
V1 N005 0 5
V2 0 N013 5
V3 N010 0 3.3
Q1 N019 N021 N007 0 NPN
Q2 N016 N011 N008 0 PNP
D1 N016 N019 NSCW100
V4 N012 0 PULSE(0 3.3 0 0 0 0.005 0.01)
V5 N022 0 PULSE(5 0 0 0 0 0.005 0.01)
XU2 N010 N007 N005 N013 N008 level2 Avol=1Meg GBW=10Meg Slew=10Meg Ilimit=25m Rail=0 Vos=0 En=0 Enk=0 In=0 Ink=0 Rin=500Meg ;pnba In+)In-)V+)V-)OUT
R2 N012 N011 10k
R3 N022 N021 10k
Q3 N017 N018 N020 0 NPN
Q4 N018 N020 0 0 NPN
R4 N001 N018 1000
R5 N020 0 3
V6 N001 0 3.6
M1 N009 N014 N017 N017 Si7336ADP
V7 N015 0 PULSE(5 0 0 0 0 0.005 0.01)
M2 N004 N002 N001 N001 AO6407
V8 N003 0 PULSE(0 5 0 0 0 0.005 0.01)
R9 N015 N014 10k
R10 N003 N002 10k
D4 N006 0 red_led
V9 N006 0 PULSE(0 3.791 0 0.05 0.05 0.005 0.01)
D2 N006 0 green_led
D5 N006 0 blue_led
D3 N004 N009 blue_led
Q5 N030 N031 N032 0 NPN
Q6 N031 N032 0 0 NPN
R6 N023 N031 1000
R7 N032 0 3
V10 N023 0 PULSE(3.6 4.2 0.005 0.09 0.1 0.005)
M3 N027 N028 N030 N030 Si7336ADP
V11 N029 0 5
M4 N026 N024 N023 N023 AO6407
V12 N025 0 0
R8 N029 N028 10k
R11 N025 N024 10k
D6 N026 N027 blue_led
.tran 0 0.1 0 0.01
.TEMP 25

* LTspice schematic (.asc)
Version 4
SHEET 1 2416 1408
WIRE -136 -592 -136 -624
WIRE 24 -592 -136 -592
WIRE 24 -576 24 -592
WIRE 216 -560 72 -560
WIRE 344 -560 296 -560
WIRE 344 -544 344 -560
WIRE 24 -448 24 -480
WIRE -1000 -384 -1000 -416
WIRE 936 -384 824 -384
WIRE 1064 -384 936 -384
WIRE 1208 -384 1064 -384
WIRE -1032 -368 -1096 -368
WIRE -824 -352 -968 -352
WIRE 24 -352 24 -384
WIRE 824 -352 824 -384
WIRE 936 -352 936 -384
WIRE 1064 -352 1064 -384
WIRE 1208 -352 1208 -384
WIRE -1032 -336 -1208 -336
WIRE -712 -304 -760 -304
WIRE -584 -304 -632 -304
WIRE -1000 -288 -1000 -320
WIRE -136 -272 -136 -592
WIRE 232 -272 72 -272
WIRE 344 -272 312 -272
WIRE -824 -224 -824 -256
WIRE 824 -224 824 -288
WIRE 936 -224 936 -288
WIRE 936 -224 824 -224
WIRE 1064 -224 1064 -288
WIRE 1064 -224 936 -224
WIRE 1208 -224 1208 -272
WIRE 1208 -224 1064 -224
WIRE 24 -208 24 -256
WIRE -136 -160 -136 -192
WIRE -40 -160 -136 -160
WIRE -824 -128 -824 -160
WIRE 24 -112 -72 -112
WIRE -712 -80 -760 -80
WIRE -584 -80 -632 -80
WIRE -1096 -32 -1096 -368
WIRE -824 -32 -1096 -32
WIRE -1096 0 -1096 -32
WIRE -120 144 -120 112
WIRE 40 144 -120 144
WIRE 40 160 40 144
WIRE 232 176 88 176
WIRE 360 176 312 176
WIRE 360 192 360 176
WIRE 40 288 40 256
WIRE 40 384 40 352
WIRE -120 464 -120 144
WIRE 248 464 88 464
WIRE 360 464 328 464
WIRE 40 528 40 480
WIRE -120 576 -120 544
WIRE -24 576 -120 576
WIRE 40 624 -56 624
FLAG -1000 -208 0
FLAG -1000 -496 0
FLAG -1208 -256 0
FLAG -1096 80 0
FLAG -584 -224 0
FLAG -584 0 0
FLAG -136 -64 0
FLAG 24 -32 0
FLAG 344 -192 0
FLAG -136 -704 0
FLAG 344 -464 0
FLAG 1208 -224 0
FLAG -120 672 0
FLAG 40 704 0
FLAG 360 544 0
FLAG -120 32 0
FLAG 360 272 0
SYMBOL res -1112 -16 R0
SYMATTR InstName R1
SYMATTR Value 33
SYMBOL voltage -1000 -400 R180
SYMATTR InstName V1
SYMATTR Value 5
SYMBOL voltage -1000 -192 R180
SYMATTR InstName V2
SYMATTR Value 5
SYMBOL voltage -1208 -352 R0
SYMATTR InstName V3
SYMATTR Value 3.3
SYMBOL npn -760 -128 M0
SYMATTR InstName Q1
SYMBOL pnp -760 -256 R180
SYMATTR InstName Q2
SYMBOL LED -840 -224 R0
SYMATTR InstName D1
SYMATTR Value NSCW100
SYMATTR Description Diode
SYMATTR Type diode
SYMBOL voltage -584 -320 R0
SYMATTR InstName V4
SYMATTR Value PULSE(0 3.3 0 0 0 0.005 0.01)
SYMBOL voltage -584 -96 R0
SYMATTR InstName V5
SYMATTR Value PULSE(5 0 0 0 0 0.005 0.01)
SYMBOL Opamps\\UniversalOpamp2 -1000 -352 R0
SYMATTR InstName U2
SYMBOL res -616 -320 R90
SYMATTR InstName R2
SYMATTR Value 10k
SYMBOL res -616 -96 R90
SYMATTR InstName R3
SYMATTR Value 10k
SYMBOL npn -40 -208 R0
SYMATTR InstName Q3
SYMBOL npn -72 -160 M0
SYMATTR InstName Q4
SYMBOL res -152 -288 R0
SYMATTR InstName R4
SYMATTR Value 1000
SYMBOL res 8 -128 R0
SYMATTR InstName R5
SYMATTR Value 3
SYMBOL voltage -136 -608 R180
SYMATTR InstName V6
SYMATTR Value 3.6
SYMBOL nmos 72 -352 M0
SYMATTR InstName M1
SYMATTR Value Si7336ADP
SYMBOL voltage 344 -288 R0
SYMATTR InstName V7
SYMATTR Value PULSE(5 0 0 0 0 0.005 0.01)
SYMBOL pmos 72 -480 R180
SYMATTR InstName M2
SYMATTR Value AO6407
SYMBOL voltage 344 -560 R0
SYMATTR InstName V8
SYMATTR Value PULSE(0 5 0 0 0 0.005 0.01)
SYMBOL res 328 -288 R90
SYMATTR InstName R9
SYMATTR Value 10k
SYMBOL res 312 -576 R90
SYMATTR InstName R10
SYMATTR Value 10k
SYMBOL diode 808 -352 R0
SYMATTR InstName D4
SYMATTR Value red_led
SYMBOL voltage 1208 -368 R0
SYMATTR InstName V9
SYMATTR Value PULSE(0 3.791 0 0.05 0.05 0.005 0.01)
SYMBOL diode 920 -352 R0
SYMATTR InstName D2
SYMATTR Value green_led
SYMBOL diode 1048 -352 R0
SYMATTR InstName D5
SYMATTR Value blue_led
SYMBOL diode 8 -448 R0
SYMATTR InstName D3
SYMATTR Value blue_led
SYMBOL npn -24 528 R0
SYMATTR InstName Q5
SYMBOL npn -56 576 M0
SYMATTR InstName Q6
SYMBOL res -136 448 R0
SYMATTR InstName R6
SYMATTR Value 1000
SYMBOL res 24 608 R0
SYMATTR InstName R7
SYMATTR Value 3
SYMBOL voltage -120 128 R180
SYMATTR InstName V10
SYMATTR Value PULSE(3.6 4.2 0.005 0.09 0.1 0.005)
SYMBOL nmos 88 384 M0
SYMATTR InstName M3
SYMATTR Value Si7336ADP
SYMBOL voltage 360 448 R0
SYMATTR InstName V11
SYMATTR Value 5
SYMBOL pmos 88 256 R180
SYMATTR InstName M4
SYMATTR Value AO6407
SYMBOL voltage 360 176 R0
SYMATTR InstName V12
SYMATTR Value 0
SYMBOL res 344 448 R90
SYMATTR InstName R8
SYMATTR Value 10k
SYMBOL res 328 160 R90
SYMATTR InstName R11
SYMATTR Value 10k
SYMBOL diode 24 288 R0
SYMATTR InstName D6
SYMATTR Value blue_led