* SPICE netlist
XU1 A1 0 Q1C_OUT Q1B N005 4N25 ;pnba A)K)C)E)B
R3 N005 0 1Meg
R4 N003 Q1C_OUT 400 tol=1 pwr=4
V1 N003 0 24 Rser=0.1
V2 DATA_IN 0 PULSE(0 5 0.0004 0.000001 0.000001 0.0001 0.0002 10) Rser=1
R1 DATA_IN A1 2.21K
C1 Q1C_OUT 0 1pF
Q1 Q1C_OUT Q1B 0 0 2N4401
C2 DATA_IN N004 47nF
R2 N004 A1 470
XU2 N001 K2 Q1B 0 NC_01 4N25 ;pnba A)K)C)E)B
C3 K2 N002 47nF
R5 N002 DATA_IN 470
V3 N001 0 5 Rser=0.1
D1 K2 N001 1N4148
D2 0 A1 1N4148
R6 K2 DATA_IN 10K
.tran 0.0015

* LTspice schematic (.asc)
Version 4
SHEET 1 2368 1280
WIRE -768 640 -768 592
WIRE -1184 592 -928 592
WIRE -704 256 -768 256
WIRE -704 160 -768 160
WIRE -768 592 -400 592
WIRE -400 592 -400 496
WIRE -512 256 -400 256
WIRE -400 256 -400 416
WIRE -400 592 -96 592
WIRE 864 -80 864 -224
WIRE 864 -224 1184 -224
WIRE 1184 -224 1184 112
WIRE 1184 592 1184 192
WIRE -1184 240 -1184 592
WIRE -1184 160 -1184 -240
WIRE 864 208 864 96
WIRE -1072 -240 -1184 -240
WIRE -768 -240 -928 -240
WIRE -768 256 -768 592
WIRE -768 -240 -768 -144
WIRE -768 160 -768 -32
WIRE 864 592 864 272
WIRE 864 592 1184 592
WIRE 608 592 608 272
WIRE 608 592 864 592
WIRE -512 224 -320 224
WIRE 608 176 608 160
WIRE 608 96 672 96
WIRE 864 96 864 0
WIRE 672 96 864 96
WIRE -512 160 608 160
WIRE 608 160 608 96
WIRE -768 160 -864 160
WIRE -928 160 -928 96
WIRE -928 16 -928 -32
WIRE -928 -96 -928 -240
WIRE -928 -240 -1072 -240
WIRE -320 224 -32 224
WIRE -176 -576 -96 -576
WIRE -96 -576 -96 592
WIRE -96 592 608 592
WIRE -176 -640 -32 -640
WIRE -32 -640 -32 224
WIRE -32 224 544 224
WIRE -464 -144 -464 -208
WIRE -464 -288 -464 -336
WIRE -464 -400 -464 -416
WIRE -368 -544 -464 -544
WIRE -464 -144 -768 -144
WIRE -768 -144 -768 -112
WIRE -864 -352 -864 -496
WIRE -368 -640 -608 -640
WIRE -864 -640 -864 -576
WIRE -608 -448 -608 -416
WIRE -608 -416 -464 -416
WIRE -464 -416 -464 -528
WIRE -608 -512 -608 -640
WIRE -608 -640 -864 -640
WIRE -464 -528 -464 -544
WIRE -864 160 -928 160
WIRE -464 -144 -352 -144
WIRE -352 -144 -352 -208
WIRE -464 -416 -352 -416
WIRE -352 -416 -352 -288
WIRE -928 416 -928 592
WIRE -928 592 -768 592
WIRE -928 352 -928 160
FLAG -768 640 0
FLAG -1072 -240 DATA_IN
FLAG 672 96 Q1C_OUT
FLAG -320 224 Q1B
FLAG -864 -352 0
FLAG -464 -528 K2
FLAG -864 160 A1
SYMBOL Optos\\4N25 -608 224 R0
SYMATTR InstName U1
SYMBOL res -416 400 R0
SYMATTR InstName R3
SYMATTR Value 1MEG
SYMBOL res 848 -96 R0
SYMATTR InstName R4
SYMATTR Value 400
SYMATTR SpiceLine tol=1 pwr=4
SYMBOL voltage 1184 96 R0
SYMATTR SpiceLine Rser=0.1
SYMATTR InstName V1
SYMATTR Value 24
SYMBOL voltage -1184 144 R0
SYMATTR SpiceLine Rser=1
SYMATTR Value PULSE(0 5 0.0004 0.000001 0.000001 0.0001 0.0002 10)
SYMATTR InstName V2
SYMBOL res -784 -128 R0
SYMATTR InstName R1
SYMATTR Value 2.21K
SYMBOL cap 848 208 R0
SYMATTR InstName C1
SYMATTR Value 1pF
SYMBOL npn 544 176 R0
SYMATTR InstName Q1
SYMATTR Value 2N4401
SYMBOL cap -944 -96 R0
SYMATTR InstName C2
SYMATTR Value 47nF
SYMBOL res -944 0 R0
SYMATTR InstName R2
SYMATTR Value 470
SYMBOL Optos\\4N25 -272 -576 R0
SYMATTR InstName U2
SYMBOL cap -480 -400 R0
SYMATTR InstName C3
SYMATTR Value 47nF
SYMBOL res -480 -304 R0
SYMATTR InstName R5
SYMATTR Value 470
SYMBOL voltage -864 -592 R0
SYMATTR SpiceLine Rser=0.1
SYMATTR InstName V3
SYMATTR Value 5
SYMBOL diode -592 -448 R180
SYMATTR InstName D1
SYMATTR Value 1N4148
SYMBOL diode -912 416 R180
SYMATTR InstName D2
SYMATTR Value 1N4148
SYMBOL res -368 -304 R0
SYMATTR InstName R6
SYMATTR Value 10K