MOC3022 has specs for input trigger 5mA typ, 10mA max.
- If you design for nominal, some parts won't work.
- Therefore your current must exceed 10mA but be much less than 50mA abs. max.
- specs for Ift =1.5V max @10mA @25'C
- specs for PIC Out V_OL are 0.4V max @ 6mA @5V ...=> ESR=0.4mA/6mA=67Ω max (50 typ)
- assuming 5.00V For Ift=10mA R27,26 = (5-1.5)/10mA=350Ω
- subtract 67Ω due to driver... 350-67=283Ω
- change 470Ω to 270Ω
This is worst case at room temp with 5% margin, if you need more margin, consider R=240
Then check differential voltage output and input to Triac gate current against specs the same way for the quadrant used .
Note Quadrant 1 is better for triggering Triac, which means low side switching ( load between