Electronic – arduino – how to connect relay and physical switch to control light

arduinoparallelserialswitcheswifi

I am new in this kind of stuff so please excuse me for my lack of knowledge. I have successfully connected blackwidow (wifi + arduino) with a relay to control a 220V light bulb.

Now, I want to embed all this circuitry in my room for each and every socket.
The problem is that I don't want to remove my physical switches from the wall. I want them to be there and always function normally.

How should I connect both elements so that I can control the lighting from both the switches?

  • Arduino hardware
  • Physical switch which has been there for a long time

And how can I achieve the following?

  • Turn on the light with the physical switch, then turn off the same by my android which is connected to the blackwidow via local network
  • and vice versa

Thanks in advance

Best Answer

If you want to control a light from 2 points you need the following circuit (the top one):

enter image description here

Chances are that your current switch is just on/off (SPST or Single Pole Single Throw) instead of the SPDT (Single Pole Double Throw) switch used in the diagram. You really need the SPDT, but you use it just like the other one. The second switch (B) is your relay, which also has to be SPDT.
If you want to switch from 3 or more points you need the center circuit. Switch A and B remain the same, but you need switch C (repeat C for every additional switch). The center and bottom circuit are the same, they just show switch C in both their states.