microcontroller drive triac
The triac is a current driven device; it will switch on (i.e. T1, T2) whenever enough current is driving its gate. The required amount of gate current can be determined through triacs datasheet; there are two types (according to gate drive) low gate current triacs and a standard gate current triacs. To switch a triac with MCU you can use I/O lines directly whoever you may need to use as parallel line as needed to proved the required current to drive triac (according to gate drive by data sheet).
If you are going to use this triac to switch main’s operated equipment then care should be taken to avoid shock or the use of an opto-coupler as an insulator is a must.
Care must also be taken to type of load connected to triac; inductive load (i.e. AC Motors) may require a snubber circuit.