Existing Wall Light Switch Mod

I haven't seen anything that really answered my question about this idea. What I want to do is modify an existing wall light socket so that I can make it wireless. I don't want to buy another light switch just modify the existing one. Someone mentioned the idea of putting a relay with wireless control behind a light switch that actually controlled the light and the switch just sent a signal to the relay that its state changed or whatever and the relay would change the light. This makes the light controllable both via wireless and the physical switch. My questions are:

  • What kind of relay or whatever would be able to control this type of setup?
  • Would I be able to have this run off the AC power that it is controlling?
  • Would this setup be small enough to place behind the switch itself?

I can setup a web interface and do all that stuff pretty easily my issues reside in the electrical aspect of this. My father (who actually knows what he is doing when it comes to electricity) will be assisting me with this project so no need to warn about safety. I am looking for part suggestions and any advice/flaws in my project. I would like this to be as cheap as possible (looking to make this scale to the whole house in the future).

What kind of relay or whatever would be able to control this type of setup?

How do you want the two switches to interact with each other? Does one override the other? Are they placed in serial similar to how to light switches are wired when they are used to control the same light? Depending on how you want to set it up, your type of relay and hardware will need to account for that. You also have to take into consideration the power requirements to make sure the relay can handle the current.

Would I be able to have this run off the AC power that it is controlling?

Yes, it's possible, as long as you have both the Hot/Nuetral lines going into the junction box.

Would this setup be small enough to place behind the switch itself?

Probably, but it depends on the setup.

I would like this to be as cheap as possible (looking to make this scale to the whole house in the future).

The best I've been able to do is about $10-15 per module. That includes the custom board (~$1), the transceiver (~$6), the relay (~$1), the micro (~$1), the power transformer (~$2) + various passive components.

There is a standard called [u]X-10[/u]. You can replace the wall switch with an X-10 switch/dimmer, and then you get an X-10 controller to remotely turn the switch on & off. You can get X-10 products made by the X-10 company, or X-10 compatible products made by other companies. The actual X-10 products are usually cheaper. Check out [u]SmartHome.com[/u], or just Google "Home Automation". (There is an X-10.com website, but it's a terrible website with pop-ups, and it's hard to find stuff.)

One complication is that most X-10 compatible switches require hot & neutral, and sometimes just the hot & ground runs-through the switch box.

You can get all kinds of switches & controllers... I have a X-10 compatible programmable controller that turns lights on & of at pre-progrmmed times.

DVDdoug: There is a standard called [u]X-10[/u]. You can replace the wall switch with an X-10 switch/dimmer, and then you get an X-10 controller to remotely turn the switch on & off. You can get X-10 products made by the X-10 company, or X-10 compatible products made by other companies. The actual X-10 products are usually cheaper. Check out [u]SmartHome.com[/u], or just Google "Home Automation". (There is an X-10.com website, but it's a terrible website with pop-ups, and it's hard to find stuff.)

One complication is that most X-10 compatible switches require hot & neutral, and sometimes just the hot & ground runs-through the switch box.

You can get all kinds of switches & controllers... I have a X-10 compatible programmable controller that turns lights on & of at pre-progrmmed times.

Just some caution with this, is that x-10 is notoriously unreliable for houses without the ideal wiring setup. It's probably the cheapest, simplest option, so it may be worth a try, but I wouldn't put all my eggs in that basket.

My plan is to have the relay actually control the light the actual wall switch will no longer control anything. The wall switch just enacts a state change to the relay. If there are more then one switch in a room I'm going to link them all together but that can be done in the interface and I'm not worried about that right now. Basically the relay would switch a 0 or 1 bit for on or off in the web interface. So the wall switch doesn't override anything it just signals the relay which controls what the switch normally would control to change its state. That way if I turn the light on through a web interface someone could physically turn it off by flipping the switch and vice versa. So the relay will have to also realize that the wall switch changed state as well as poll a database (or file or whatever I end up using in the web interface) to see a bit change there and turn on or off the lights accordingly. If I'm being confusing let me know and I'll clarify I hope this helps.

Arrch: Just some caution with this, is that x-10 is notoriously unreliable for houses without the ideal wiring setup. It's probably the cheapest, simplest option, so it may be worth a try, but I wouldn't put all my eggs in that basket.

Yeah I looked at the x10 stuff before and didn't really like what I saw. I'd like to test this out at my house which is older so I don't really want any compatability problems. If I can do it without using those I will.

eric91: My plan is to have the relay actually control the light the actual wall switch will no longer control anything. The wall switch just enacts a state change to the relay. If there are more then one switch in a room I'm going to link them all together but that can be done in the interface and I'm not worried about that right now. Basically the relay would switch a 0 or 1 bit for on or off in the web interface. So the wall switch doesn't override anything it just signals the relay which controls what the switch normally would control to change its state. That way if I turn the light on through a web interface someone could physically turn it off by flipping the switch and vice versa. So the relay will have to also realize that the wall switch changed state as well as poll a database (or file or whatever I end up using in the web interface) to see a bit change there and turn on or off the lights accordingly. If I'm being confusing let me know and I'll clarify I hope this helps.

So in other words the light switch no longer will act as a binary switch, but a toggle switch. That's easy to wire up to the micro.

So when choosing a relay, your main concerns will be the current/voltage ratings for the contact and coil. The contact voltage/current will depend on where you live and what kind of lights you're driving. The coil voltage/current will depend on the power source you use. I usually just cannibalize small USB chargers for this.

With respect to interfacing, polling is one option or you can just have the server push the data. Ultimately how you do it will depend on what wireless medium you go with.

Arrch: So in other words the light switch no longer will act as a binary switch, but a toggle switch. That's easy to wire up to the micro.

So when choosing a relay, your main concerns will be the current/voltage ratings for the contact and coil. The contact voltage/current will depend on where you live and what kind of lights you're driving. The coil voltage/current will depend on the power source you use. I usually just cannibalize small USB chargers for this.

With respect to interfacing, polling is one option or you can just have the server push the data. Ultimately how you do it will depend on what wireless medium you go with.

can you give any suggestions of what to use? Or at least the name of what I need to use so I can search them? Pretty new to arduino and not great with electricity so any suggestions would be awesome! That way I know what I'm looking for and checking it out.

This is the equipment that I use:

Small wall wart to cannibalize. Output of about 5.3 to the system.
http://www.amazon.com/gp/product/B0038HYPZS/ref=oh_details_o00_s00_i01

ATtiny84 as the brain for each unit.
http://www.digikey.com/product-detail/en/ATTINY84A-PU/ATTINY84A-PU-ND/2774082

Transceiver for communication:
http://www.embeddedwirelesssolutions.com/rfm12b

Relay to act as the switch
http://www.digikey.com/product-detail/en/G5LA-14%20DC5/Z2560-ND/1164329

Here are a few related websites/posts that may be worth a read:

Good article on doing it with wall switches, although the way they’ve done it is extremely expensive, it might give you other ideas:
http://arduino.cc/forum/index.php/topic,108906.0.html

Helped give me an idea of how to interface the tiny with the RFM12B.
http://arduino.cc/forum/index.php/topic,104203.0.html

JeeLabs has some amazing information as well as a pretty nice library for the transceiver modules. It’s all about home automation and I find it a great place to get information and inspiration:
http://jeelabs.org/

One thing to note is that the RFM12 is supposed to run on 3.3 volts. It will work on 5v, but I wouldn’t recommend relying on that forever. I’m working on getting some LDO regulators to help provide the Tiny and the rfm to 3.3v while still giving the relay 5.

Awesome thank you so much for your help I really appreciate it!

A relay will generally have a Normally Open and Normally Closed option.

Wire your relay thru a normally closed option. This way electricity flows to the light when light switch is on. You can switch is off using an arduino.

You don't need your switch to signal its state to the relay.

eric91: My plan is to have the relay actually control the light the actual wall switch will no longer control anything. The wall switch just enacts a state change to the relay. If there are more then one switch in a room I'm going to link them all together but that can be done in the interface and I'm not worried about that right now. Basically the relay would switch a 0 or 1 bit for on or off in the web interface. So the wall switch doesn't override anything it just signals the relay which controls what the switch normally would control to change its state. That way if I turn the light on through a web interface someone could physically turn it off by flipping the switch and vice versa. So the relay will have to also realize that the wall switch changed state as well as poll a database (or file or whatever I end up using in the web interface) to see a bit change there and turn on or off the lights accordingly. If I'm being confusing let me know and I'll clarify I hope this helps.

I'm using a bulb that I got from superbriteleds.com in my bedroom. It was such an inconvenience to get out of bed to turn off the light after reading or studying.

Initial cost was a bit pricey as I needed a wifi hub for the bulbs, but I can control 4 rooms. They are standard A19 sized bulbs, but do not emit heat, are more efficient than CFL bulbs, and I can get any RBG color I want. There is also a dimmer as well as some functions built in (color strobe, slow strobe, rapid strobe, etc.

But now I can control the lights in my room from my phone. If you set the bulb, manually turn off the switch, and then turn the switch back on the bulb remains in it's state. If you set it to max brightness, blue and turn off the switch, come back and turn it on, it will be max brightness blue again.

Might be easier than trying to shoehorn a relay or motor into a wall outlet.

Just be aware that in many countries there are fairly stiff penalties for unqualified people found "playing" with high voltage wiring.