connect Arduino MEGA ADK to wall switch

Hi guys , I am pretty new to Arduino stuff . I am a software engineer and doing a hardware project of home automation over arduino + hc-06 bluetooth , which gets command from android app which I have designed.The devices are traditionally connected to relays.

I am confused with the controls , I want to control light bulb from my android app as well as the light's traditional wall switch .. for example :

I turned ON a light from my android app , the light turns ON. but the wall switch for that button remains OFF while the light is ON.

so there is a conflict in turning light ON & OFF from my android app as well as wall switches installed.

I need a solution for this problem

You could help by reading this http://forum.arduino.cc/index.php?topic=148996.0

I turned ON a light from my android app , the light turns ON. but the wall switch for that button remains OFF while the light is ON.

It's possible to wire a relay in parallel with the wall switch, and that creates an OR condition where either the switch or relay can turn the light on.

It's also possible to wire a SPDT relay and a SPDT switch as a "3-Way" switch (like where you have one switch at the top of the stairs and another switch at the bottom of the stairs, and sometimes up is on and sometimes up is off). The problem with that arrangement is that the software doesn't "know" if the light is on or off, so it doesn't know which way to switch the relay. It' possible to detect if the power is on or off and feed that back to the microcontroller, but probably not practical to do it that way.

But typically with home automation, the light switch is replaced by a special momentary switch/receiver so you have both manual control and automatic control, and the last command takes precedence. [u]Here[/u] are some switches that can be controlled by [u]X-10[/u] or other home automation protocols.

I don't know if there are any wall switches that can be directly controlled by bluetooth, but you can probably find a controller that accepts bluetooth commands and translates them to one of the more common home automation protocols. There are home automation controllers that work with Ethernet or Wi-Fi. Again, the switches themselves don't use Ethernet/Wi-Fi directly. The Ethernet/Wi-Fi signal goes to a home automation controller and the controller sends-out a signal to the switch.

I've got an X-10 timer/controller that's programmed via a serial connection from the computer. It can be directly controlled from the computer, but it normally runs as a stand-alone unit. This particular unit doesn't have any software for remote/network control, so I can't control it from a phone.

This doesn't really sound like an Arduino related issue.

You'd really be better posting it to a forum dedicated to home automation.

i.e You are looking for some sort of mechanical switch that can be pushed normally e.g. by a human, but is also driven mechanically by some electronics.

I suspect there will be some solutions that have a momentary push button that toggles the state of a relay, and has an indication e.g. LED next to the switch to indicate whether the switch is in the On or Off state.

Whether some system exist to read and control such a switch really sounds like the realm of a specialist forum.

You could build such a device, but I suspect it would be illegal to wire it in, normally all equipment like this has to be certified and approved though various complex and expensive processes.

Hi guys , I am pretty new to Arduino stuff . I am a software engineer and doing a hardware project of home automation over arduino + hc-06 bluetooth , which gets command from android app which I have designed.The devices are traditionally connected to relays.

I am confused with the controls , I want to control light bulb from my android app as well as the light's traditional wall switch .. for example :

I turned ON a light from my android app , the light turns ON. but the wall switch for that button remains OFF while the light is ON.

so there is a conflict in turning light ON & OFF from my android app as well as wall switches installed.

I need a solution for this problem

I like home automation too. I've thought a LOT about this problem and got a good and easy idea IMO.

-Disconnect the wall switch from the light bulb circuito, and convert it to a logic circuit. Connect it to one INPUT pin (use 10k pullup and 5V). Now Arduino will read the state of the wall switch. -About the bulb, connect its circuit to a relay driven by Arduino.

The rest of the job is code.

-When you command instruction via bluetooth, you can change bulb actual state (ON/OFF). -When you change the wall switch, Arduino detects event switch and changes actual state.

The con (it's not a con for me but may be for others) of this solution is: the wall switch will no longer have a determinated position for off and on, to turn on you just have to move the switch, same to turn off.

This is the exact same question you posed here.

We had discussion about a setup like this a while back.
May have morphed into something else.
Arduino can turn the light on by turning on the transistor to drive the relay, light switch can turn the light on the same way.
Or maybe have switch send a signal to the arduino to tell it to turn the light off or on.

@ziad4369, please don't crosspost. Ask the question, have a little patience.