Replace wall switches with relays


I read a few similar topics, but still have doubts. I've just moved into a new house and am thinking to add some home automation projects here and there. One of the things I would like to achieve is to be able to control my lights from a centralized arduino board. Right now I'm planning to fish cat5 cables from the attic down to all/some of the wall switches' sockets (not considering the outlets so far). I then plan to replace the switch with a relay and use this cat5 cable's wires to power and control it. I can also install some kind of switch to send signals back to arduino if I decide I need an option to control those lights manually - since I'll have 8 wires in each cat5 to play with, that shouldn't be a problem.
If at some point (selling the house for instance) I decide to revert everything, all I will need to do is to reconnect the AC from the relay back to the switch and just leave the cat5 cables sticking inside the wall socket. Are there any downsides to this plan? Am I missing anything?

Building codes may need to be considered. A lot of places frown on unlicensed people messing with the mains wiring. Also your insurance. If unauthorized work causes a problem the insurance may balk at paying. Just some things to check.

Before you get too far, do some research into existing home automation systems/protocols. They use RF wireless or RF over the AC wiring so you don't need additional control-wiring. (And, they use momentary switches so you can operate the switch/dimmer manually or remotely.)

Plus, there are several engineering & construction challenges involved in fitting the electronics into an electrical outlet-box and keeping everything safe & isolated. If you want to build a controller, that's OK. But, I strongly recommend that you buy the switches/dimmers and controlled outlets and then build a controller with a compatible protocol.

I've had an [u]X-10 system[/u] for many years (now combination X-10 and Insteon). I didn't build any of it myself... I've got about 10 controlled lights & outlets, a master timer-controller, several wired & wireless manual controllers, and one motion sensor transmitter/controller. My system doesn't work over the Internet or with a Cell phone, but those features could be added with the appropriate hardware (if I wanted to do that).

No practical experience, but a project like this is on my back-burner.
Search for "Livolo" on ebay.
Some of the touch wall switches are (RF) remote controlled.
That (RF control) can also be done with an Arduino and a $2 433Mhz transmitter.
I think there is even a Livolo library.
Search through the "Home Automation and Networked Objects" tab on this site.

I appreciate all of the advise, but I would like to try to achieve this by using arduino first.
I am not planning to mess with the AC cables, basically the hot wire instead of being connected/disconnected by the switch is going to be connected/disconnected by the relay (NO to be safe). I am not going to rewire anything or add any new AC cables into the walls/attic. How is this messing with the AC wiring? Or am I wrong here?
I am also not planning to put anything other than the relay inside the wall socket, so I don't think there should be any issues with fitting it in or any safe concerns, are there?


There are at least two possible problems with your approach.

First you are running low voltage cables into a house AC wiring box, which is forbidden by some building codes.
An inadvertent connection between high and low voltage wiring in that cramped space can lead to fatal accidents or fires.

Second, the relay might overheat in a small enclosure, causing the relay to malfunction, possibly leading to a fire.

There are radio frequency controlled wall switches and sockets that are electrically and building code approved. An Arduino can be used to transmit control information to them using the RFSwitch library. That is by far your best and safest option.

Have a look at Moteino. They have some great modules that replace standard wall switches easily and safely.