

1. According to the datasheet you can trigger the gate relative to MT2.
1. According to the datasheet you can trigger the gate relative to MT2.

QH and QL aren't needed. The opto-coupler should be able to provide enough current to trigger the TRIAC. If there are any doubts then an extra transistor could be added to the opto-coupler, forming a Darlington pair but it shouldn't be necessary.
Is the 3.3V rail isolated from the 5V rail and the mains? If not then there's no point in using an opto-coupler. You might as well trigger the TRIAC directly from the microcontroller.
QH and QL aren't needed. The opto-coupler should be able to provide enough current to trigger the TRIAC. If there are any doubts then an extra transistor could be added to the opto-coupler, forming a Darlington pair but it shouldn't be necessary.
The TRIAC requires minimum 2mA and maximum 35mA current to be triggered. Yes, the optocoupler can give that much current, but it also needs high driving forward current for that. That will reduce its life time. By adding QH and QL, I reduced the stress on it.
Is the 3.3V rail isolated from the 5V rail and the mains? If not then there's no point in using an opto-coupler. You might as well trigger the TRIAC directly from the microcontroller.There is a transformer which gives two isolated isolated windings (no center-tap, they are unconnected). I use one of them to generate 3.3V, and the other one for the 5V supply.
QH and QL aren't needed. The opto-coupler should be able to provide enough current to trigger the TRIAC. If there are any doubts then an extra transistor could be added to the opto-coupler, forming a Darlington pair but it shouldn't be necessary.
The TRIAC requires minimum 2mA and maximum 35mA current to be triggered. Yes, the optocoupler can give that much current, but it also needs high driving forward current for that. That will reduce its life time. By adding QH and QL, I reduced the stress on it.I took it as it the maximum allowed current into the trigger terminal is 35mA but the minimum current required to trigger is 2mA.
Either way, there is no need for QL. If anything it'll make it worse. It will never conduct. TRIACs aren't like MOSFETS. They don't have a gate capacitance to discharge.

QuoteIs the 3.3V rail isolated from the 5V rail and the mains? If not then there's no point in using an opto-coupler. You might as well trigger the TRIAC directly from the microcontroller.There is a transformer which gives two isolated isolated windings (no center-tap, they are unconnected). I use one of them to generate 3.3V, and the other one for the 5V supply.How well isolated is the 3.3V and 5V output?
It's pretty likely there isn't enough insulation between the secondary windings to act as protection against electric shock.
The secondary windings are normally on a separate bobbin to the primary winding or have a thick layer of insulating tape between them which provides enough insulation to protect against shock.
The chances are, the only insulation between each secondary winding is just the thin enamel on the wire. This is only classed as functional insulation and is not to be relied upon for protection against electric shock.
Why not use an optically isolated TRIAC?
http://www.ti.com/lit/ds/symlink/moc3022.pdf
http://www.farnell.com/datasheets/1688212.pdf
http://www.vishay.com/docs/83627/il410.pdf
I also hope you're aware of the minimum distance required on a PCB between the mains and extra low voltage side?
I will control a 2kW heater.

with Zero Voltage Crossing triac driver 2x 180 Ohm resistors optionally another one and varistor with fuse in circuit similar to this one from datasheet above works nice for me in a few projects where no phase control needed 
Either way, there is no need for QL. If anything it'll make it worse. It will never conduct. TRIACs aren't like MOSFETS. They don't have a gate capacitance to discharge.
Is it correct like this?
The datasheet says that the insulation is for 4kV. But it doesn't mention whether it is only between primary and secondary windings, or between every winding. I have to find a solid solution for that. Maybe I can use two separate transformers. It is good that you pointed this out.

I will control a 2kW heater. Actually, I'm trying to design a reflow oven controller for my personal usage. I browsed the list of optotriacs, none of them can switch more than 1A continuous current.
I will take care of it when I come to the PCB design stage.
PCB design stage? This is a commodity item.

If you can buy it for 3$ on eBay, why design it?

PCB design stage? This is a commodity item.Yep, if you connect it to MPU using... h-bridge and DC motor to drive potentiometerIf you can buy it for 3$ on eBay, why design it?Because of this is electronics forum, not ladies looking for another toy?

Buying a pre-made PID controller is not a bad idea, especially if you have little experience with designing mains PCBs. It depends on the requirements: if space is a problem then that one looks a little bulky. You may also want other features such as a programmable temperature cycle.
This is for a reflow oven so a simple PID controller is probably not good enough.
Can that PID controller produce a complex temperature profile? Could one interface it with an MCU to achieve that?
Do you have additional current sensing and zero crossing circuit? Switchin 2kW in AC voltage maximum (random phase) with less than 1A gate currect, I do not know, but probably wouldn't be happy with such design, especially when ZVC costs nothing using MOC304xwith Zero Voltage Crossing triac driver 2x 180 Ohm resistors optionally another one and varistor with fuse in circuit similar to this one from datasheet above works nice for me in a few projects where no phase control needed
http://www.onsemi.com/pub_link/Collateral/BTA16-600BW3-D.PDF

chose the circuit element values according to the optotriac datasheet.
I've additionaly MPU PWM timer interupt set to multiply of full 20ms @ 50Hz 240VAC mais-for fine tune maybe shrter pulses than 1s will be needed