i am begginer in electronics and this is my first circuit its about a small motion sensor 220v AC switch i want to make myself but i want to use Triac as a solid state relay insteade of normal relays i searched alot about Triac circuits and i coudn't understand some of them. can i trigger the Triac gate using output power from motion sensor module HC-SR501 without damaging sensor module as shown in circuit diagram?? is it necessary to use optoisolator or can the circuit done using triac only?
Note: i am trying to make the circuit as simple as possible cause i want the final PCB the same size as the HC-SR501 motion sensor module PCB
Edit: using your tips and with some googling around i made that modified schematic, will this work. i don't want to test until i am sure i will not fry anything.
i used this opto-triac isolator in this modified schematic.