I have the following optoisolator PC817. It is a 4-Pin Phototransistor Optoisolator. My idea is basically to control electrical appliances in my home. The power supply in my country is 230V 50Hz.
I specifically want to control tube lights in my room. The control of 5V comes from an AVR microcontroller.
My circuit connections are shown in the picture.
Hoping that my connections are correct, my question: is it safe to run them with optoisolator for a prolonged duration. And also how reliable are they?
I also want some suggestions on additional safety precautions.