I have recently seen a opto-isloated triac driver circuit. The Gate terminal of triac is connected to a live wire through physical switch. So when the physical switch is turned on, triac conducts and gives the signal to opto-isolator which then trigger gpio on the Microcontroller.
Now my question is: As far as I know opto-isolator used in the circuit can handle the mains voltage also. What is the necessity of triac here. Why can’t I directly connect the mains voltage to opto-isolator and skip the triac all together?
Let me know if the question is not clear. I will try to come up with circuit diagram soon.