Tell us about yourself!
If you want to control AC mains current with a microcontroller I would recommend that you use a device with an Opto-isolator. See:https://en.wikipedia.org/wiki/Opto-isolatorThe job of the Opto-isolator is to physically isolate the high voltage circuit from your low voltage microcontroller. One such device is made byPowerSwitchTail.com this is much safer than simply using a relay as shown in these instructions. I have used PowerSSR Tail Kit for 200-240vac mains they require assembly but they work well. Keep safe!