is my schematic correct? (Optocoupler with triac)
It appears that you do not have sufficient current through the opto LED. 15 to 50 mA is recommended to meet the transfer function.

First check that your uP can drive at least 15 mA from its output. If so, then a series resistor of ~ 220 ohms should be used. If the output cannot drive that much current, add a simple NPN or FET driver to control the higher drive current.