bt136 schematic
Most likely you don't have enough current through opto's LED. You should drive it with 10mA. On 5V supply, you should use current limiting resistor of 360Ω and make sure your microcontroller or logic gate output has capability of sourcing 10-15mA.
Optocoupler is needed only when you need electrical isolation between MCU and mains. Most MCU dimmers people make, are not isolated and it is not necessary to drive triac through optocoupler.
There are two ways of driving TRIAC's without isolation depending on triac used. One is using quadrants II and III and is most common as most of the triacs are not capable running in quadrant IV, and second is using quadrants I and IV.
Quadrant I and IV are when gate terminal is positive in respect to MT1 and II and III are when gate is negative to MT1.
So, in case that you are driving some standard triac that does not work in quadrant IV, you could use schematic like this:
In case for BT136, which is capable of running in quadrant IV as well, you could drive gate with positive current and schematic could look something like this:
If your controller or gate can source 4-5mA, you could drive gate directly through 1K resistor.
Gate current can last only few microseconds, and after that triac will remain open untill it passes through 0 voltage. This is significant, since if you have resistor capacitor network for reducing voltage for 5V for MCU, reduced consumption would lead to smaller components. Once you trigger triac you can turn off gate current, and average consumption would depend on your MCU.