Relay switch to control wall socket - Page 1
Forum section: electronics / beginners

author: Legion
author_rank: Frequent Contributor
timestamp: April 01, 2014, 04:59:44 pm
content: I have a water pump that I'd like to turn on and off from a microcontroller. I don't want to modify the water pump in any way. What I'd like to do is plug the pump into a socket and control whether or not that socket has power. Kinda like how a power bar has a switch that will turn power on/off for any devices plugged into it.Sparkfun has a tutorial describing exactly what I'm looking for here:https://www.sparkfun.com/tutorials/119However I was wondering if there's an off the shelf part that will do this that I can order from a place like digikey? I checked digikey's relay listings but didn't find what I'm looking for. Maybe it has a specific name I need to search for?

author: Christopher
author_rank: Frequent Contributor
timestamp: April 01, 2014, 05:40:01 pm
content: Playing with mains isn't a good idea.How about something like this?http://www.tlc-direct.co.uk/Main_Index/Xmas_Lights/Remote_Controlled_Sockets/index.htmlObviously go with something not dodgy (made-in-china).. You could probably open it up to get to the coil, or just use the IR remote attached to your micro.

author: michaelym
author_rank: Regular Contributor
timestamp: April 01, 2014, 06:44:34 pm
content: I am no professional in the area but I think what you are looking for is a "solid state relay".You can get one that you can drive from a microcontroller.Look in digikey for one with the correct input (DC ~3-5V) and output (AC ~120-220) ratings.Please confirm with someone who knows better before plating with the mains

author: con-f-use
author_rank: Unknown
timestamp: April 01, 2014, 07:11:59 pm
content: The sharp S202S02 (230VAC mains) and S102S02 (110VAC) solid state relays have zero-crossing and are quiet robust. They isolate the micro controller from the mains via an opto triac, basically an infra-red diode that activates two light sensitive transistors that turn conductive in opposite directions. Zero crossing is a nice thing to have: It switches only when the mains cycle reaches zero voltage which is nicer for both sides of the relay and avoids all sorts of problems. The switching voltage goes as low as 3V if I remember correctly, so ideal for micros. I can recommend them, though you might need a snubber circuit with hight power inductive loads.1. Get an extension cord2. Strip about 10" of the outer isolation layer in the middel of the cord3. Cut one of the lines that are not your ground wire4. Strip about 1" of isolation on both of the cut ends5. Put heatshrink over the isolation left on both the cut ends6. Solder each end on to one of the AC ~ terminals of the relay7. Shrink the heatshrink over each of the solder joints8. Solder + to the switching pin of your micro and - to its logical ground9. Put everything in some kind of flame retardant casing so nobody can touch it (and it looks nice)10. Secure the cable to the casing so when you trip over it, you won't rip off your nice solder jointsSwitching mains in general is not difficult, only dangerous. Just assemble your contraption without connection to anything, make sure it's very well isolated (everywhere! and will stay that way even when getting hot, moving or generally manhandled). Before connecting turn of the breaker/resettable household fuse, then connect it to mains, turn the breaker back on and see if it works.

author: Len
author_rank: Frequent Contributor
timestamp: April 02, 2014, 01:49:09 am
content: Sounds like this is what you're looking for:http://www.powerswitchtail.com/Also available here:http://www.adafruit.com/products/268You don't have to mess around with the mains-voltage wiring. The digital control line is isolated from the mains.I guess I should mention that it only comes in a 120V version, for North America. But you haven't set your country in your user profile, so I'm going to be annoyed at you if I've wasted my time posting this.

author: Legion
author_rank: Frequent Contributor
timestamp: April 02, 2014, 03:17:08 am
content: Quote from: Len on April 02, 2014, 01:49:09 amLooks like just the thing. Thanks.

author: electronics man
author_rank: Frequent Contributor
timestamp: April 02, 2014, 12:40:53 pm
content: Quote from: Len on April 02, 2014, 01:49:09 amDo they make one for the uk?

author: Len
author_rank: Frequent Contributor
timestamp: April 02, 2014, 06:51:49 pm
content: Quote from: electronics man on April 02, 2014, 12:40:53 pm*shrug* I don't see one on their web site. You should ask them, not me!