* SPICE netlist
V1 Pulse 0 PULSE(0 3.3 100u 10n 10n 100u 200u 10)
M2 N014 Pulse 0 0 IPD105N04L
Q1 N006 N010 N008 0 BC847A
R1 N008 N014 1R5
XU1 N012 N008 5V 0 N010 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
V2 N005 0 PULSE(0 2.5 350u 10u 10u 400u 700u 5)
V3 5V 0 5V
R2 N001 N002 1R5
M1 N002 Pulse 0 0 IPD105N04L
M3 N013 3.3V 0 0 IPD105N04L
Q2 N004 N009 N007 0 BC847A
R4 N007 N013 1R5
XU2 N011 N007 5V 0 N009 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
D3 5V N004 LXHL-BW02
V4 3.3V 0 3.3V
V5 N003 0 PULSE(0 3.3 0 1m 1m 10u 3m 5)
D1 5V N006 LXHL-BW02
D2 5V N001 LXHL-BW02
R3 N003 N011 3k2
R5 N011 0 1k
R6 N005 N012 3k2
R7 N012 0 1k
.tran 1m

* LTspice schematic (.asc)
Version 4
SHEET 1 1520 832
WIRE -248 -400 -264 -400
WIRE -184 -400 -248 -400
WIRE 56 -400 -184 -400
WIRE 760 -384 760 -416
WIRE -184 -368 -184 -400
WIRE 56 -368 56 -400
WIRE -184 -256 -184 -304
WIRE -184 -144 -184 -176
WIRE 440 -112 344 -112
WIRE -376 -64 -376 -80
WIRE -232 -64 -376 -64
WIRE 440 -64 440 -112
WIRE -376 -32 -376 -64
WIRE -760 -16 -760 -48
WIRE -648 -16 -648 -48
WIRE -184 -16 -184 -48
WIRE 760 0 760 -320
WIRE -248 16 -328 16
WIRE 56 16 56 -304
WIRE 600 32 568 32
WIRE -248 48 -248 16
WIRE -104 48 -136 48
WIRE 696 48 664 48
WIRE -376 64 -376 48
WIRE -8 64 -40 64
WIRE 440 64 440 16
WIRE 600 64 440 64
WIRE -760 80 -760 64
WIRE -648 80 -648 64
WIRE -104 80 -168 80
WIRE 344 96 344 -112
WIRE 440 96 440 64
WIRE -328 112 -328 16
WIRE 568 128 568 32
WIRE 760 128 760 96
WIRE 760 128 568 128
WIRE -248 144 -248 128
WIRE -168 144 -168 80
WIRE -168 144 -248 144
WIRE -136 144 -136 48
WIRE 56 144 56 112
WIRE 56 144 -136 144
WIRE 760 144 760 128
WIRE -248 160 -248 144
WIRE 56 160 56 144
WIRE 344 208 344 176
WIRE 440 208 440 176
WIRE -328 224 -328 192
WIRE 760 240 760 224
WIRE -248 256 -248 240
WIRE 56 272 56 240
WIRE 712 320 664 320
WIRE 8 352 -40 352
WIRE 760 384 760 336
WIRE 56 416 56 368
FLAG -376 64 0
FLAG -184 -16 0
FLAG 56 416 0
FLAG -328 224 0
FLAG -648 80 0
FLAG -648 -48 5V
FLAG -72 32 5V
FLAG -72 96 0
FLAG -248 -400 5V
FLAG -376 -80 Pulse
FLAG -40 352 Pulse
FLAG 760 384 0
FLAG 632 16 5V
FLAG 632 80 0
FLAG -760 80 0
FLAG -760 -48 3.3V
FLAG 664 320 3.3V
FLAG 344 208 0
FLAG 760 -416 5V
FLAG 440 208 0
FLAG -248 256 0
SYMBOL voltage -376 -48 R0
SYMATTR Value PULSE(0 3.3 100u 10n 10n 100u 200u 10)
SYMATTR InstName V1
SYMBOL nmos 8 272 R0
SYMATTR Value IPD105N04L
SYMATTR InstName M2
SYMBOL npn -8 16 R0
SYMATTR InstName Q1
SYMATTR Value BC847A
SYMBOL res 40 144 R0
SYMATTR InstName R1
SYMATTR Value 1R5
SYMBOL Opamps\\UniversalOpamp2 -72 64 R0
SYMATTR InstName U1
SYMBOL voltage -328 96 R0
SYMATTR Value PULSE(0 2.5 350u 10u 10u 400u 700u 5)
SYMATTR InstName V2
SYMBOL voltage -648 -32 R0
SYMATTR InstName V3
SYMATTR Value 5V
SYMBOL res -200 -272 R0
SYMATTR InstName R2
SYMATTR Value 1R5
SYMBOL nmos -232 -144 R0
SYMATTR Value IPD105N04L
SYMATTR InstName M1
SYMBOL nmos 712 240 R0
SYMATTR InstName M3
SYMATTR Value IPD105N04L
SYMBOL npn 696 0 R0
SYMATTR InstName Q2
SYMATTR Value BC847A
SYMBOL res 744 128 R0
SYMATTR InstName R4
SYMATTR Value 1R5
SYMBOL Opamps\\UniversalOpamp2 632 48 R0
SYMATTR InstName U2
SYMBOL LED 744 -384 R0
SYMATTR InstName D3
SYMATTR Value LXHL-BW02
SYMATTR Description Diode
SYMATTR Type diode
SYMBOL voltage -760 -32 R0
SYMATTR InstName V4
SYMATTR Value 3.3V
SYMBOL voltage 344 80 R0
SYMATTR Value PULSE(0 3.3 0 1m 1m 10u 3m 5)
SYMATTR InstName V5
SYMBOL LED 40 -368 R0
SYMATTR InstName D1
SYMATTR Value LXHL-BW02
SYMATTR Description Diode
SYMATTR Type diode
SYMBOL LED -200 -368 R0
SYMATTR InstName D2
SYMATTR Value LXHL-BW02
SYMATTR Description Diode
SYMATTR Type diode
SYMBOL res 424 -80 R0
SYMATTR InstName R3
SYMATTR Value 3k2
SYMBOL res 424 80 R0
SYMATTR InstName R5
SYMATTR Value 1k
SYMBOL res -264 32 R0
SYMATTR InstName R6
SYMATTR Value 3k2
SYMBOL res -264 144 R0
SYMATTR InstName R7
SYMATTR Value 1k