The best way to handle AC voltage and current in a smart home project is using a industrial grade Solid Sate Relay with the ratings of 400V and 60A, which is the experienced professionals recommend too. The down side is, it's expensive and not suitable for hobbyist Engineers. almost every project that i am working on is stuck with this problem, either I can't afford the reliable SSR or create one on my own. well, wait a second, why not create one?
That's the spark of the idea I had yesterday midnight and searched for how Solid State Relay works, did some search on youtube and datasheet, learned something about that it's switching by semiconductor, phototransistor(I am still learning how it's really work), but, I have figured it out how it's isolate the switching circuit and AC contacts. It's just a phototransistor.
I have these things called IR LED and photodiode, 10s of them. I remember that I did some simple transmitter, receiver circuit with it. It's the base idea that makes me to create the Solid State Relay alike.
I have connected the IR LED to Arduino to control pulsing for test. Created a separate circuit with separate voltage(12V) for receiver section with photodiode. The photodiode is connected to 5V regulated rail with two 1K resistor for voltage dividing. The divided voltage goes to base of the 2n2222a transistor, the collector to emitter is connected to 12V rail. On the collector side, 12V relay is connected with red LED on NO(Normally Open) pin and COM (Common GND) pin. So, on each pulse the photodiode receives by IR LED, it turns on the 2n2222a transistor along with charged 12V coil, which is then turn on the red LED.
By this, I have successfully isolated the MCU circuit and AC control circuit. I can use 240V with maximum of 10A load with safe and secure. I have decide to create a circuit for this whole idea, even going to use ceramic or some clay stuff with holes to make sure the isolation is even secure and safe. With ceramic or clay wall with holes(for IR and photodiode) I can add more relay channels for my smart home projects.
Here is the prototype demo on breadboard...
Note: The 2n2222a transistor part is just for breadboard prototype purpose, i will use mosfet for my projects...