3
\$\begingroup\$

I used relays before but just for simple 5V DC signals control using a Raspberry Pi. Now I'm quite cautious and would like to ask for some help from professionals because I'm not planning to set my apartment on fire.

What do I currently know about this?

I currently use the relay to switch on/off my computers. Doing this is very simple. Since computers turn on by shorting two terminals, I just took a branch from the power buttons of my computers and hooked them to a relay (like the one in the picture) to the terminals are not connected by default. I have a little script that switches the relay for 0.5 seconds, which is enough to turn computer on.

enter image description here

The problem:

Now I would like to use this to control some 220 Volts power outlet. For that, I bought a socket, like the one in the picture, and mounted it on a plastic project box:

enter image description here

From that socket comes 3 terminals, two terminals (call them black and red) and earth in the middle (call it green).

I would like to install an IEC socket on the box, too (like the one in the following picture):

enter image description here

The question:

How should I connect the outlet socket to the IEC through the relay? Please advise.

If you require any additional information, please ask.

\$\endgroup\$
8
  • 3
    \$\begingroup\$ You should use cables \$\endgroup\$
    – PlasmaHH
    Dec 17 '15 at 18:07
  • \$\begingroup\$ You need a relay or contactor rated for mains, with the right part it's as straightforward as a 5v relay with some extra due diligence to securing/isolating mains carrying wires. There are also solid state relays that will work. If you want to control mains power there are other devices like triacs and scrs that can be used \$\endgroup\$
    – crasic
    Dec 17 '15 at 18:08
  • 2
    \$\begingroup\$ @crasic Triacs and scrs are not a great idea, since they have off leakage and an external user can assume off=off and kill themselves. As for what to use in stead: Not only do you need a rated relay, but it also needs to be on a well designed board, not like the cheap eBay crap. And it needs to disconnect both wires. \$\endgroup\$
    – Asmyldof
    Dec 17 '15 at 18:21
  • 1
    \$\begingroup\$ @PlasmaHH I thought that's kind of given... are you serious? \$\endgroup\$ Dec 17 '15 at 18:25
  • \$\begingroup\$ I'd be interested to see specs on the relay board. The relay specs look good but the diode (and other parts) may not be rated for mains AC. \$\endgroup\$
    – David
    Dec 17 '15 at 19:04
3
\$\begingroup\$

If you have a properly rated relay, you don't need to do anything fancy. Just use the right gauge wire for your power requirements.

Route the hot line through the relay, don't route the neutral line. Then of course connect the earth and neutral from each connector together. If you don't know what hot, neutral and earth are, now would be a good time to get yourself up to speed on residential wiring.

However, you will want to be a little bit more deliberate and careful than you would with 5V lines, which might include heat shrinking over any soldered connections, and carefully routing the wires inside your enclosure so that they don't move around or come loose and short out. The stiffness of the thicker gauge wire may require a little more forethought and planning while cutting and placing, but you'll figure it out quickly enough.

Lastly, everything needs to be enclosed, you can't just leave it out in the open like you can with 5V.

\$\endgroup\$
10
  • 3
    \$\begingroup\$ With a box that will have a plug or input you NEED to route both wires, because you do not know that in all cases and all countries the plugs will always be plugged in only one way. \$\endgroup\$
    – Asmyldof
    Dec 17 '15 at 18:22
  • \$\begingroup\$ @Asmyldof: the guy is trying to automate something for his apartment, not design a product to be sold in numerous markets. \$\endgroup\$ Dec 17 '15 at 18:33
  • 2
    \$\begingroup\$ @Asmyldof - interesting argument. How would you reconcile this with the fact that most power strips and other switchable extension cords only switch the hot? I don't mean to be dismissive - mains safety is a serious thing. But why do you expect something different from a relay than from a manually actuated switch? \$\endgroup\$ Dec 17 '15 at 23:28
  • 1
    \$\begingroup\$ @ChrisStratton Here in mainland europe mains strips are not allowed to be sold switching only one wire. Both or none. \$\endgroup\$
    – Asmyldof
    Dec 18 '15 at 16:29
  • 1
    \$\begingroup\$ @whatsisname That makes no difference. If someone here is asking "Hey this 230V thing, how do I wire that" the burden is on the person answering to take all steps possible to not kill the OP with the advice given. \$\endgroup\$
    – Asmyldof
    Dec 18 '15 at 16:30
1
\$\begingroup\$

Wire as shown below. Those IEC sockets are rated at 6 A. The relay might be less, so choose a fuse to protect the lower rated device.

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
0

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.