Sorry for my ignorance, I am fairly new to electronics. I have been working on a terrarium controller and the next step is to control the rain system, heater, etc. using the arduino based on the inputs from my DHT22's. I have been looking into how to control an outlet using relays but am not sure on which way to go. I want to control 4 different outlets and am looking at these two relay boards, http://www.amazon.com/SainSmart-4-CH-4-Channel-Relay-Module/dp/B0057OC5O8/ref=sr_1_1?ie=UTF8&qid=1393690370&sr=8-1&keywords=4-channel+relay and http://www.amazon.com/SainSmart-4-Channel-Duemilanove-MEGA2560-MEGA1280/dp/B0079WI37Y/ref=sr_1_1?ie=UTF8&qid=1393690386&sr=8-1&keywords=4-channel+relay+ssr. I have read posts from people saying that the SSR relays are safer but have seen people control 110V outlets with the standard relays. Can anyone give me a solid reason why the SSR would be safer and a better choice than going with the cheaper model? Also on the SSR model there are two ground pins on the side that connects to the arduino, what is the point of having two grounds connected to the arduino or is one to connect to the ground of the outlets? Probably my stupidest question is how can I go about hooking up all the cords to go to one plug in the wall, basically making a power strip with all the outlets on the strip controlled individually but only one cord to the wall?
Thanks for any help
I've gotten relay boards off of ebay and they work great!
If you are willing to wait a few weeks you can get great deals from China.
I know this doesn't answer your question about whether or not SSR's are cheaper, but I figured I would throw my two cents in regarding purchasing the standard relays. I use mine for controlling my water top off and automatic water change system on my saltwater reef aquarium.
mosely:
Probably my stupidest question is how can I go about hooking up all the cords to go to one plug in the wall, basically making a power strip with all the outlets on the strip controlled individually but only one cord to the wall?
What I did to make my holiday light controller was take a big gauge extension cord from the home improvement store and cut off the end, giving me a plug on one end and 3 wires on the other. I used some 14 gauge wire and some connectors like these:
http://www.idealindustries.com/prodDetail.do?prodId=in-sure&div=0&l1=push-in
that I got at the local electrical supply house to take the power into the relays and some standard 2 gang outlet boxes with run of the mill standard outlets. Plastic outlet boxes are cheap. Outlets are like US 39 cents. Who knew? Anyway, all that was mounted in/on and tacked to a piece of plywood. One could get fancier and make a plywood box if one wanted- it would turn out to be a box with four outlets and a cord coming out of it. The relay module, Arduino, and whatever else mounted inside the box. Maybe a hinged lid or something.
Just one idea. Other people can make things like this small and compact and neat. I work in 1/2 inch plywood and a leftover paint, so take that for what it is worth.
mosely:
..... question is how can I go about hooking up all the cords to go to one plug in the wall, basically making a power strip with all the outlets on the strip controlled individually but only one cord to the wall?
get a power strip that is large enough for you to mount your relays
mount the relays in the power strip and add your parts inside of that.
I would HIGHLY recommend you use power from the strip to power the relays and use opto-isolators on the cable to the Arduino.
or, buy some electrical boxes that you can connect together to make a larger box, put your receptacles in that.
you may know that you cut the bars on the sides of a standard receptacle (in the US) to make a double receptacles into two separate circuits.
Those push in connectors look cool but I can't find them in a smaller pack than 50. Would it be unsafe to simply wire nut them together? I had thought about using standard outlet boxes for this but did not know I could make them separate circuits. It sounds like that is the cheapest way to go. Dave, can you explain why it would be bad to power the relays with the arduino. As for the relays I was planning on getting them through amazon because I have a gift card there, but I think I will buy a nice soldering station with it and get the relays on eBay.
You can switch the relay modules with Arduino, but you want to power the relay modules from a power source- not through the Arduino. Too much current. Too much bad.
I used the 5 port 30-087J connectors:
and could only ever find them in a jug of 150, so I have enough connectors for the rest of my life now. I liked them because I hate trying to put 4 wires into one wirenut. I'd just buy a jug. Have them for future projects, give to friends, put up a ceiling fan, rewire your house, etc.
"I had thought about using standard outlet boxes for this but did not know I could make them separate circuits"
Like Dave says, yep. There are tabs on the side you separate off and it makes that standard US one above the other outlet into two separately powered outlets. I didn't know that either until I made my controller so don't feel any more stupid than the rest of us.
mosely:
Dave, can you explain why it would be bad to power the relays with the arduino.
the relays will take more power than you can get from the board. so you will be forced to power them from a different source.
if you use 5V, and power them from the same power supply as the arduino, you will need to extend your 5V to the relay location, so you will have 5v in the same box as 120vac..
if you install a second power supply, you still have to run signal wires. I am a huge fan of isolation. a darlington opto isolator might be the best, and you get to power that from the arduino without risk.
just make sure your AC and your DC do not mix.
Generally those relay modules have optoisolation which is cool. And yes, whn I made my little box, one set of outlets is for the 120 AC stuff I control, and one outlet is for a 5v wall wort that power the arduino and the relay modules. 120AC into the box, part of it gets siphoned off to run the low voltage DC stuff. Works fine.
Dave is right. AC/DC might be a good rock band but you don't want to mix things up here.
I found the Arduilay instructable (http://www.instructables.com/id/Arduilay/?ALLSTEPS) and am wondering why he did not use an optoisolator. Is it because the sainsmart relay already has them installed? I basically want to make the Arduilay half size.
mosely:
I found the Arduilay instructable (http://www.instructables.com/id/Arduilay/?ALLSTEPS) and am wondering why he did not use an optoisolator. Is it because the sainsmart relay already has them installed? I basically want to make the Arduilay half size.
yes.one opto is all you need
bigred1212:
Generally those relay modules have optoisolation which is cool.
But - they are in fact, not actually isolated, because the ground connection is common.
dave-in-nj:
you may know that you cut the bars on the sides of a standard receptacle (in the US) to make a double receptacles into two separate circuits.
Actually, cut the bar on one side - you want the neutral to be common unless you propose to use double-pole relays - which isn't always a good idea for a couple of reasons.
Paul__B:
Actually, cut the bar on one side - you want the neutral to be common unless you propose to use double-pole relays - which isn't always a good idea for a couple of reasons.
Actually when I made mine I fully separated them. Hot and neutral to each outlet, each switched by a standard relay.
So I went ahead and purchased a Sainsmart 4-channel relay which should be here by the weekend. My last question is about hooking up the "hot" wire to the system. In the Arduilay tutorial (http://www.instructables.com/id/Arduilay/?ALLSTEPS) it states in step 9 to connect "the hot wire to one of the power (staples) relay terminals" which I assume just means any of the "normally closed" terminals on the relay board. However in step 10 when he later added the fuse the picture looks like there are at least 3 wires coming out of the fuse and I am not sure what they are attached to. Can I simply put one wire coming from the fuse to any of the "normally closed" terminals like he did in step 10?
Thanks for everyone's help.
The relay is going to have three screw shield positions: a common, a normally open and a normally closed.
The AC power will have three wires- typically black for hot, white for neutral, green for ground.
The outlets either have screws on the side or push in places on the back. Typically the places on the outlets are marked as to which is hot/neutral. Sometimes that is with writing, sometimes with the color of the screws- black/brass, silver/white. Look at yours.
What I did was take black from power into the outlet, white out of the outlet, into NO of the relay, white out of the COM on the relay back to power. Connecting the grounds as well.
In that Instructable that looks like just an inline fuse on the black. The 3 wires coming in from power would be together and then split up to go their routes. So the fuse will have one wire coming in and out but will go back to 3 wires on the power side. I didn't use a fuse on mine- I didn't know those inline fuses existed until just now. Probably should have done that.
Standard warning not to kill yourself and leave me all your stuff if you do.
Edit: Looking at that box in the Instructable- I couldn't do that, fixing the relay board over the top of the outlets with the Arduino and everything all tucked in like that. Mine is laid out on 1/2 ply with room for my clumsy fat ass fingers and bad eyes.
bigred1212:
In that Instructable that looks like just an inline fuse on the black. The 3 wires coming in from power would be together and then split up to go their routes. So the fuse will have one wire coming in and out but will go back to 3 wires on the power side. I didn't use a fuse on mine- I didn't know those inline fuses existed until just now. Probably should have done that.Standard warning not to kill yourself and leave me all your stuff if you do.
That is how I thought it would hook up. Just have the fuse on the hot wire, however in the picture it looks like the wire coming out of the fuse, to the relays, is spliced into at least 3 separate wires. I spoke with a friend who is an electrical engineer and was told not to worry about that and to simply have the fuse with one wire coming out and going to the relays. Thanks again for everyone's help, I should be getting what I need in the mail soon to start this project. Bigred, you have been added to my will in the event that anything goes wrong.
mosely:
Bigred, you have been added to my will in the event that anything goes wrong.
Woot! Woot!
No wait...
Nevermind.