Page 1 of 1

how to replace a switch with relay in a 2 switch circuit

Posted: Fri Nov 27, 2015 5:17 pm
by Hacker'n'Tinker guy
I want to control lights from rpi or arduino and the same time i want to have local control of the light through a physical wall switch.
Below is a double switching circuit

Image

so how do i replace one of the switches with the outputs of a relay no nc and com.

The relay switching will be controlled by the Arduino or raspberry pi.

Re: how to replace a switch with relay in a 2 switch circuit

Posted: Fri Nov 27, 2015 5:22 pm
by Laurens-wuyts
Just connect NO to L1 of 1 switch and NC to L2 of the switch.
Com goes to COM of the switch.

Laurens

Re: how to replace a switch with relay in a 2 switch circuit

Posted: Fri Nov 27, 2015 5:37 pm
by rpdom
If you replace that switch with a relay like that the Pi won't know if it is turning the light on or off.

Say the relay is "off" then Com (COM) is connected to NO (L1). The light may be on or off, depending on the position of the switch. Change the switch and the light will change - your program won't know that.

All you can do is to get it to toggle the existing state OFF to ON or ON to OFF.

Re: how to replace a switch with relay in a 2 switch circuit

Posted: Fri Nov 27, 2015 6:14 pm
by Hacker'n'Tinker guy
rpdom wrote:If you replace that switch with a relay like that the Pi won't know if it is turning the light on or off.

Say the relay is "off" then Com (COM) is connected to NO (L1). The light may be on or off, depending on the position of the switch. Change the switch and the light will change - your program won't know that.

All you can do is to get it to toggle the existing state OFF to ON or ON to OFF.
i was planning to use a current sensor or a relay with a 240v trigger 5 v output to the arduino after the switches

Re: how to replace a switch with relay in a 2 switch circuit

Posted: Fri Nov 27, 2015 9:28 pm
by RaspISteve
Tinker,
If you can come up with a change-over relay that swaps L1a -> L1b and L2a -> L2b for L1a -> L2b and L2a -> L1b you can then have any number of Pi's capable to changing the current ON/OFF state of the lamp. You can also buy those cross-over switches from the bigger distributors.

If you think about it this switching arrangement is an XOR gate (Exclusive OR) set up. As distinct from series switches being AND gates and parallel switches being an OR gate.