Electronic – Inline Mains Switch with microcontroller

mainsmicrocontrollerswitches

I'm looking for some inspirations/references as to how I might go about designing a switch powered by a microcontroller, switching a mains powered device . My ultimate objective is to create a zigbee controlled switch that simply switches the mains power on and off. This device would be controlled by another microcontroller able to communicate wirelessly via zigbee. My key requirement is for the inline switch to be simple to connect, allowing the mains line to enter one side and exit the other, allowing it to be fitted in any existing scenario where a device might be powered by a traditional switch. My questions are:

• In my design, what approach might I take to split off the the AC power and transform to DC allowing my microcontroller to operate without needing an independent low voltage DC power supply?

• How do I integrate a relay into my design to switch the mains power from the same mains source?

I appreciate there are many considerations about safe design when handling mains voltage. It strikes me there must be some very similar open source hardware designs out there that would help me learn how to best achieve this.

Grateful for any advice or references.

Many thanks,
Greg

Best Answer

• In my design, what approach might I take to split off the the AC power and transform to DC allowing my microcontroller to operate without needing an independent low voltage DC power supply?

A suitable, isolated DC power supply :)

There are other approaches (non-isolated low-voltage supply), but we want to see you here again, so don't go there.

• How do I integrate a relay into my design to switch the mains power from the same mains source?

There are a lot of topics that show how to connect a relay to a microcontroller. But I would suggest that you google for a 'solid state relay' or (same thing) 'optoisolated triac'. If possible, select a version with 'zero crossing switching'.

Related Topic