Smart Home Multiple Relay Modules - Please Help

Hi there guys and girls,

I have been researching and reading for basically the last couple months and I am nearing the time when I am ready to bring my project into reality, I just have a few things that I need to double check with those that are far more intelligent than I.

My original plan was to have an electrician install a second switch for every single manual light switch in my house, all to a central place say my garage, where i could create an arduino hub for interfacing with 2 x 16 channel relays. I was then told that my idea would be very costly with the running of power lines around my roof by a professional, I began formulating another plan.

I have a whole bunch of leftover cat 6 cable, the plan now is to run cat 6 into every wall cavity that has a light switch. I have purchased a couple of breakout boards and rj45 socket adapters. The plan is to create little 1, 2,3 and 4 channel relays to install within a junction box, within the same wall cavity as the manual switch, I would then send the current to run and the message to trigger the relays through the cat 6 cable from a main controlling arduino mega controlled again by a raspberry pi (but thats another thing in itself).

Obviously, there is the usual warning of dealing with dc and how it should be handled by someone qualified to do so, I just want to check to see if how I picture it in my mind is right as well as a few questions if anyone has the time to help, I would be much appreciated.

Now I have done testing, using rj45 keystone jacks with jumper wires forced into the metal and I was successful in turning a relay on and off through a rj45 keystone port up into my room to my central ethernet hub where another keystone with jumpers was there to receive a message which toggled a lamp on and off. Now...

  1. The way i picture it in my head is:

You have a normal switch. One state the light is on (when the connection to hot is made), the other the light is off when it is severed. To set this up, you would unwire the wire leading from the switch to the light, you would then get a 3 wire, connect the middle of one end to the hot leading to the light, the other two outer wires to the two manual switch states, then connect the other end of the three wire to the relay (preferably in a formation that that allows the manual switch to be in an off position, with the relay powered down and the light switch is off. (I know I have just confused everyone with that attempt at an explanation, but I hope it made snense)

  1. Is there an issue with this kind of setup, IE using cat 6 to send perform this kind of task, how about when I have a relay setup for every light switch in the house, could it be too strenuous on the cat 6 cable. the longest cable will be around 15 metres I would estimate.

  2. I feel as if this is the type of scenario where I would definitely need to externally power the relays, even whilst doing this, will the arduino struggle to be able to provide pin high to all of the relays in the system at once, is there anything I can do to help it along and or protect the machine in case of a fail.

  3. Having 1,2,3 and 4 channel relays, I havent doubled checked this, but I am pretty sure that they are all 5v relays. Now this is the important one. From talking to people and researching it...is it true that I can potentionally power multiple or even all of the relays from the one 5v power supply, if it has the amps to handle the load? Would a 5v 2A charger be enough to run around 20 relays at the same time. I was also thinking of attaching a current sensor module to each switch, so that I can calculate light usage and check to see whether a light is turned on. Will this have a large affect on my power supply drain.

Lastly, probably a stupid question 5. Say I have a power supply plugged in running at 5v or 12v or whatever it is, if a relay or a door strike or something connected, but it is not currently being used in the circuit is it:

a. using the same amount of electricity as normal
b. using way less, not noticeable amount of electricity and therefore can be left on at all times
3. Either way, its 5v or 12v and its not very much electricity and I shouldnt notice it compared to my oven?

Sorry for the novel and thank you in advance for any help or guidance.

Michael - Keen to learn

Diagram

Arduino Mega -> cat 6 -> rj45 socket adapter ->breakout Board ->custom perfboard (within junction box screwed to faceplace within wall) --> relay -->Return to arduino through ground

Ps. When I externally power a module do I need common ground or what? People seem to be pretty vague about that...or atleast confusing and everyone says something different.

Thanks again

Forget about using the relays that come on modules for hobbyists. Those are non-latching relays and will continuously suck power to hold one position. Horrible for actual home usage.

Do not think about throwing stuff into the junction boxes until you read up on your local code/regulations. You may need to add new work junction boxes next to those switches to hold whatever contraption you end up with.

You are seeking 3-way functionality, where either the Arduino or the manual light switch will toggle the light. I think you have the idea in your ramble that you need 3-way switches. These are SPDT, where either switch position runs the common to some connection, never floating as the SPST would have for "off". You may need to simply replace the switches with the correct SPDT/3-way style. I'm surprised they even bother making SPST's since the cost difference is negligible and SPDT's can be used either way.

I've kept SPST switches by only using them as a button input to a microcontroller, so the hot line to the light goes through a relay. This relay is then controlled by either the manual switch (which no longer handles mains, just the 5V logic level) or the microcontroller, for 3 way functionality. This might give you an idea of what is possible if you ditch the idea of running lines from your garage hub and instead go with a wireless solution.
For my setup, I have an internet connected base station that has an RF transmitter, and my relays have microcontrollers with RF receivers by the manual switches. I bought a cheap Android tablet and using an MQTT protocol, all of the switches can be controlled from the tablet on widgets. Also works from my phone, my computer, or even any device with a browser from anywhere in the world.

I would recommend investigating such wireless solutions, as running such long wires from the Arduino will be problematic in terms of wire impedence, noise from basically being bigass antennas in an AC wired house, and lack of flexibility. And since this Arduino would only be sending signals to the relay and not power, you're not saving yourself any work.

Your scheme would probably work though if toggling a relay remotely you wouldn't know if you turned the light on or off, that would depend on the position of the 3 way local switch. :confused:

Which is another reason to forget about those hobby relay modules.

With my setup using a dual coil latching relay, the commands that are sent are absolutes. One signal turns the light on, whether it's already on or off, another signal turns the light off, whether it's on or off. So the newest desired state overrides instead of toggles.

Forget about using the relays that come on modules for hobbyists. Those are non-latching relays and will continuously suck power to hold one position. Horrible for actual home usage.

Do not think about throwing stuff into the junction boxes until you read up on your local code/regulations. You may need to add new work junction boxes next to those switches to hold whatever contraption you end up with.

You are seeking 3-way functionality, where either the Arduino or the manual light switch will toggle the light. I think you have the idea in your ramble that you need 3-way switches. These are SPDT, where either switch position runs the common to some connection, never floating as the SPST would have for "off". You may need to simply replace the switches with the correct SPDT/3-way style. I'm surprised they even bother making SPST's since the cost difference is negligible and SPDT's can be used either way.

I've kept SPST switches by only using them as a button input to a microcontroller, so the hot line to the light goes through a relay. This relay is then controlled by either the manual switch (which no longer handles mains, just the 5V logic level) or the microcontroller, for 3 way functionality. This might give you an idea of what is possible if you ditch the idea of running lines from your garage hub and instead go with a wireless solution.
For my setup, I have an internet connected base station that has an RF transmitter, and my relays have microcontrollers with RF receivers by the manual switches. I bought a cheap Android tablet and using an MQTT protocol, all of the switches can be controlled from the tablet on widgets. Also works from my phone, my computer, or even any device with a browser from anywhere in the world.

I would recommend investigating such wireless solutions, as running such long wires from the Arduino will be problematic in terms of wire impedence, noise from basically being bigass antennas in an AC wired house, and lack of flexibility. And since this Arduino would only be sending signals to the relay and not power, you're not saving yourself any work.

I have 30 of these that I was planning to use to interface with the relays within the wall.

Do you have links that you can provide to the device you are using to send and receive the rf signals and also very importantly, how do you power the relays within the wall cavity?

My idea is similar to yours I would wager except, rather than using rf to trigger the relays i am using cat 6.

Where do i get these two state relays you mentioned? Are they expensive andd I would send the 5v through the cat 6 as I heard it is well capable of dealing with 5v under 100 metres of cable. Its in my mind the ebst way to deal with powering and controlling electronics in the wall without empoloying some kind of crazy new age electrician.

In my current plan, the hot from the manual light switch goes through one side of relay and the other goes through the other. So that the relay and the swittch can both turn on and turn off the light.

Thank you for your help and guidance.

These are the perfboards I would make into the microcontrollers that appear in the wall.

http://www.ebay.com.au/itm/331627685381?_trksid=p2060353.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT

Your scheme would probably work though if toggling a relay remotely you wouldn't know if you turned the light on or off, that would depend on the position of the 3 way local switch.

Was going to use a hall current sensor module to calcualte when a light is turned off.

The hot will run through manual, through relay and then through current sensor into light globe. The hall current sensor will be able to check to see whether the manual or relay is turned on

Which is another reason to forget about those hobby relay modules.

With my setup using a dual coil latching relay, the commands that are sent are absolutes. One signal turns the light on, whether it's already on or off, another signal turns the light off, whether it's on or off. So the newest desired state overrides instead of toggles.

How do I power this device, where do I buy, is it expensive and will the rf signal go through plaster board into wall cavity?

Thank you in advance

Look at Latching Relays here
http://www.digikey.com/product-search/en/relays/power-relays-over-2-amps/1049447?k=relay

Solid State relays here
http://www.digikey.com/product-search/en/relays/solid-state-relays/1048664?k=relay

Mikie_lomas:
In my current plan, the hot from the manual light switch goes through one side of relay and the other goes through the other. So that the relay and the swittch can both turn on and turn off the light.

I can't envision what it is you're describing.
Initial single hot wire goes into light switch, light switch has 2 wire outputs. These 2 wire outputs go into the NO and NC terminals of a relay (called Set/Reset for dual coil latching), and there is a single hot out wire from the COM of the relay that goes on to your light.

This is the relay I like. It only takes a short pulse of energy to change states.

And if you're going with CAT cable, and thinking of doing the extraneous hall sensor stuff, I think you can just scrap that whole idea. Instead just use 2 of those wires and hook them up to the wall switch, and have your Arduino read the switch directly as I have done. With proper isolation/shielding, you're just turning the wall switch into what a button on a breadboard would be. There is no need to waste wires powering and reading a hall sensor (which probably wouldn't be workable with long wires).

So rather than going at it by thinking about different routes of handling the hot mains line, you'd instead be thinking about different routes of switching the relay. It's a safer approach, it's more flexible, it's simpler than the sensor idea.

Thanks guys for your continued correspondence.

And if you're going with CAT cable, and thinking of doing the extraneous hall sensor stuff, I think you can just scrap that whole idea. Instead just use 2 of those wires and hook them up to the wall switch, and have your Arduino read the switch directly as I have done. With proper isolation/shielding, you're just turning the wall switch into what a button on a breadboard would be. There is no need to waste wires powering and reading a hall sensor (which probably wouldn't be workable with long wires).

So rather than going at it by thinking about different routes of handling the hot mains line, you'd instead be thinking about different routes of switching the relay. It's a safer approach, it's more flexible, it's simpler than the sensor idea.

I am very interested in these latching relays you have been talking about. I am jsut wondering how I would set it up. Is it a difficult process to attach the relay you provided to say a perboard and then connect it to my manual switch in the method that you have described, for a beginning solderer? Obviously my 2 x 16 channel relay boards, and multiple 1,2,3 and 4 channel relays are also useless now if i decide to go down this path. But, i guess thats all part of the experience and I definitely see the pros of using this method.

You confused me a bit with the above quote, The hall current sensor modules I have are placed in series with the dc lightning connecting and then current can be calculated from the modules output. Are you saying there is a better way to acheive the exact same result? Which is essentially seeing if the light is turned on.

As i wrote this I just re read two aprts of your quote. So, correct me if I am wrong my friend. You are saying, I should gut the manual light swtiches completely and add a method that will allow the state of the switch to be read by the arduino controller. E.G. Light switch on state sends message to arduino which will then in turn trigger the relay to change states? This is a better option because reading the output from the sensor module could lose credibility over long ethernet wires?

Soo would I still run cat 6 into every wall cavity in order to trigger the relays, but just use these latching terminals as the main switch, which is controlled by my arduino which can read the state of the recently gutted manual switches to decide what state to throw the dual latching relays into?

thank you everyone for your help

PS. I also noticed that the relay you provided has a rating of 250VAC and 24VDC. Would that be sufficient in switch Mains lighting In Australia?

Search for "Livolo" on ebay.
Some models have RF remote control.
Arduino should be able to take over that function.
Leo..

Search for "Livolo" on ebay.
Some models have RF remote control.
Arduino should be able to take over that function.
Leo..

Thanks for heads up, I shall look into them. Will they work with Australian circuitry?

Would a double latch low signal relay like this work? I tried digikey and the postage was 30 dollars in itself.

Mikie_lomas:
Will they work with Australian circuitry?

Never used them, but I think there are 110volt (US) and 230volt (EU) switches.
The EU model should work in OZ.
Not sure if you are allowed to use them there. Rules could be strict.
I would order one first, and see how it works.
There is a Livolo thread in the "Home Automation and Networked Objects" part of this forum.
Maybe someone can answer your questions there.
Leo..

Mikie_lomas:
6pcs Ea2-12tnj - NEC - Low Signal Relays - PCB 12vdc Double Latch for sale online | eBay

Would a double latch low signal relay like this work? I tried digikey and the postage was 30 dollars in itself.

Here are some criteria that you want

-5V Coil voltage (that one is 12V, which isn't a deal breaker if you want to send 12V over your CAT as well)
-Coil type: Dual latching
-Switching current = more than what you need. 2A at least for a single bulb fixture. Ideally 8A minimum for future proofing in case a multibulb fixture goes in. I use 16A for reliability and not worrying about running a relay at its upper end.

I posted the relay link just to show the model number and type of specs you should look for. If you put in a little effort you can of course find them elsewhere, they are not a Digikey exclusive.

Never used them, but I think there are 110volt (US) and 230volt (EU) switches.
The EU model should work in OZ.
Not sure if you are allowed to use them there. Rules could be strict.
I would order one first, and see how it works.
There is a Livolo thread in the "Home Automation and Networked Objects" part of this forum.
Maybe someone can answer your questions there.
Leo..

Thank you wawa, i am on the lookout for some cheap Livolla online, so i can test out one of the switches.

Here are some criteria that you want

-5V Coil voltage (that one is 12V, which isn't a deal breaker if you want to send 12V over your CAT as well)
-Coil type: Dual latching
-Switching current = more than what you need. 2A at least for a single bulb fixture. Ideally 8A minimum for future proofing in case a multibulb fixture goes in. I use 16A for reliability and not worrying about running a relay at its upper end.

I posted the relay link just to show the model number and type of specs you should look for. If you put in a little effort you can of course find them elsewhere, they are not a Digikey exclusive.

Thank you INTP for your continued help.

I am not sure how much voltage and current drop i will get with 15 metres cat 6 cable, do you think the cat 6 will struggle with high voltages (iE heat and voltage drop), I remember reading somewhere that cat 6 should be capable of 48 v and anything below that is acceptable...But it could just be a random thing I read online, but another option I have recently come across, that I just want to double check with the profesionals. Powering my wall modules from mains with a step down module for arduino.

Unless I am reading it wrong, these modules say they can convert mains to 5v 700ma, which sounds pretty spot on for far away and hard to reach modules inside wall. What are your thoughts on connecting my relays and modules in the wall to this in order to power it...or do you think powering with cat 6 as I have said is still the superior method?

I also purchased a couple of these to test them out (This is along the line sof what you were talking about in that it is using RF to send signals to the arduino. This is superior to infared I would wager as it wont be prevented by the plaster board.

I also came across a couple of latching relay 5v modules which are affordable. I would love to know your thoughts on these two if you guys have time:

http://www.ebay.com.au/itm/191102466370?_trksid=p2060353.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT
(Dual latch, low trigger voltage, arduino input control)

http://www.ebay.com.au/itm/321778249850?_trksid=p2060353.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT
(Dual latch, low trigger voltage, arduino /RF control, 4 channels)

Once again thank you everyone for your continued help.

You have to be careful for the relays. The ones you just posted are NOT latching relays. They simply have latching behavior which is handled by the module.
Most of the hobby relay modules like the ones you had originally are momentary behavior. They are "ON" as long as the Arduino is telling them to be on, and they suck power constantly to keep that coil energized. Once the signal stops, the relay turns off. These "latching" relay modules don't turn off automatically, they stay on, until a new signal is received. But just like the momentary ones, they need to keep that coil energized the whole time. It's just momentary and toggle behavior, but regardless of which mode the module is doing, the relay coil eats power to stay energized and holds one position.
"latching" relay modules are not the same as true latching relays.

And that AC-DC converter, would work just fine. It's basically a cell phone charger without the terminals. If you can find a tiny USB cell phone charger block thing for the same or cheaper, I'd go that route so you at least get a case, and maybe just keep the USB plug to plug into Arduinos if you imagine using Arduinos at the switches.

You have to be careful for the relays. The ones you just posted are NOT latching relays. They simply have latching behavior which is handled by the module.
Most of the hobby relay modules like the ones you had originally are momentary behavior. They are "ON" as long as the Arduino is telling them to be on, and they suck power constantly to keep that coil energized. Once the signal stops, the relay turns off. These "latching" relay modules don't turn off automatically, they stay on, until a new signal is received. But just like the momentary ones, they need to keep that coil energized the whole time. It's just momentary and toggle behavior, but regardless of which mode the module is doing, the relay coil eats power to stay energized and holds one position.
"latching" relay modules are not the same as true latching relays.

And that AC-DC converter, would work just fine. It's basically a cell phone charger without the terminals. If you can find a tiny USB cell phone charger block thing for the same or cheaper, I'd go that route so you at least get a case, and maybe just keep the USB plug to plug into Arduinos if you imagine using Arduinos at the switches.

Thank you again for reply. Could you perhaps point me in the direction of an ebay entry for these latching relays that stay latched on ebay. I have looked for hours and these were the closest I could find.

It makes complete sense to use altching as sending a pulse to change the state of a switch is definitely a better options than continuously energising a magnet to keep it in a position.

I do have USB 5v converters, except within my wall, I do not a powerpoint to plug it into and therefore cannot power it.

When my bathroom got replaced, they repalced the downlights with LED that are plugged into a powerpoint that was created and attached to the mains and put into roof.

Perhaps an option such as this is the best way of powering deviced that require 5 v in the wall. But if the voltage drop over 15 metres of cat 6 is unnoticebale. Maybe I should still go down this track.

Is there any chance of a device like this starting a fire in my wall. Or is it like a blanket, do this at your own risk?

Thank you so much for your help and expertise.

Just to clarify:

The altching relays I posted will:

rather than stay in a position when unenegised (like theya re meant to), it will not fall to either state but somewhere in between? Where as tthe ones I need Litterally, you pulse them to one state and they state in that state until pulsed into another?