3
\$\begingroup\$

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

\$\endgroup\$
5
\$\begingroup\$

• 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'.

\$\endgroup\$
  • \$\begingroup\$ Thanks, that is useful, confirms part of what I suspected but puts some flesh on the bones. Anyone come across any tutorials showing the two concepts deployed together. I'll have a go, but as a relative noob a tutorial for something similar would be nice. \$\endgroup\$ – user524261 Dec 4 '13 at 20:03
  • \$\begingroup\$ Since it seems the microcontroller circuit would be completely contained inside the product and only communicate externally via radio, a isolated supply might actually be appropriate here. Of course the OP needs to understand the safety issues clearly before trying it. \$\endgroup\$ – Olin Lathrop Dec 4 '13 at 20:37
  • \$\begingroup\$ @Olin: for a real product I agree (I think you meant NON-isolated in the sense of no isolation from the mains?), but this has to be developed by someone who asks this question. Better keep him alive for the next question. \$\endgroup\$ – Wouter van Ooijen Dec 4 '13 at 22:03
  • \$\begingroup\$ @Wouter: Oops, yes, I meant non-isolated. \$\endgroup\$ – Olin Lathrop Dec 4 '13 at 22:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.