The stuff on the other side of the optocoupler seems needlessly complex
but I guess that depends on what the load is you intend to drive. doing
that part the way you plan won't cause any problems.
It appears that you copied the a "solid state relay" schematic from
somewhere (and got atleast one copy wrong)
You don't need the whole solid state relay input stage if the input
has a predictable voltage range. a simple resistor is sufficient...
the 3022 has a 10mV input
sensitivity and Fairchild suggests feediing it about 15mA in case it
degrades a little, the internal LED has a voltage drop of about 1.5V
so 15ma at 3.5V comes to 233 ohms so 220 is close enough.
You can probably get by with fewer transistors and lower operating
The MOC3022 needs at least 10mA to trigger, so you work backwards
from there. Its input forward voltage is less than 1.5V, and a saturated
2N4401 is something like 0.3V. Thus, you will have 3.2V, and you want to
have 10mA through it, so you need at most 320 ohms of resistance. Make it
300 ohms. Passing 10mA through a signal NPN will probably require 500uA
into the base, so use an 8.2k resistor from Q to the base. This will
reliably turn on a MOC3022 when Q is high, and turn it off when Q is low.
Now, the other side of the coin is turning one on when Q is low. To do
that, you use a PNP transistor in an inverted configuration, emitter to
5V, collector to the MOC3022, and the other MOC input terminal to a 300
ohm resistor which then goes to ground. Again, connect the base to Q using
an 8.2k resistor, and your MOC3022 will turn on when Q is low, and turn
off when Q is high.
When you turn off the 555, both branches will go off. If you want it to
stay on after the 555 goes away, use what is called a latching relay.
There are two coils, and they latch the relay one way or the other.