# Logic inside a 3 or 4 way light switch?

I'm trying to understand what is the logic or mechanism used in 3 way or 4 way switches, in order for all swtches to work so that no matter the position of each switch, the lights go on or off without any other switch affecting the others.

So, are they internally using any logic gate that work connecting each swtich, or is it using any kind of flip flop latch or anything like that?

Sorry for this question that might look stupid, but I am trying to learn electronics by myself and came up with this question.

• They are simply inclusive OR switches wired in series to behave as EXclusive OR toggle switches. (XOR = A*B + A!*B!) both high or low Nov 25, 2019 at 2:40
• What Dave Tweed says - noting that you can use ALL DPDT switches for any number of positions, if desired. (Switch slightly more complex, only one part to stock). Nov 25, 2019 at 3:29
• People upvoting Dave's excellent answer should presumably upvote the question which lead to it unless there is some good reason not to. No? Nov 25, 2019 at 3:30
• For visitors to this question - more home wiring info is available over on HomeImprovement.SE. Nov 25, 2019 at 16:03

A "3-way" switch is SPDT. A "4-way" switch is DPDT inside. They're used like this:

simulate this circuit – Schematic created using CircuitLab

The 4-way switch is simply crossing the connections, or connecting them straight through — sort of an XOR function.

If you only need two switches, just connect SW1 and SW2 directly to each other. If you need 3 or more switches, add any number of 4-way switches in between as shown.

## Hot or not

Here is how they work; it is simplicity itself. You have 2 traveler wires. One is hot, and one is not. Any 3/4 way switch alternates which one is hot or not.

At the ends, an SPDT will do the trick.

However in the middle, you need to exchange the travelers. This is done by a reversing switch.

A reversing switch isn't quite a DPDT. But you can make one out of a DPDT by wiring an "X" connecting the non-common terminals, then attaching the wires to the one side of the "X" and of course the commons.

## Mains wiring gotchas

The usual place people get into trouble with 3-ways in household wiring is failing to properly identify the travelers. These live on the 2 "traveler" or non-"common" terminals, and in North American practice are colored brass. Notably, physical position of the terminals on the switch is meaningless; every switch is different. I like to use yellow wire or mark the wires with yellow tape. Doing so makes working with 3-ways easy; failing to do so makes it a nightmare. Most homes are wired in cable, and so you get a box with a 3-way and other stuff going on, and you have 9 wires with every one being black, white or red. What a tangle!

man, I really shoulda marked those travelers with yellow tape...

• @ElliotAlderson They are from here diy.stackexchange.com/a/145189/47125 and here diy.stackexchange.com/q/110572/47125 Sep 23, 2020 at 5:48
• Interesting to see how things vary around the world. Here in the UK the positions of the terminals are generally the best guide to which terminal is which (the labelling varies between manufacturers and we don't use different colored terminals here). Sep 23, 2020 at 17:39
• @peter yeah in the US, the only thing you can count on is screw color. Sep 23, 2020 at 20:22

Normally (excluding stuff like intelligent dimmers), the switches are just switches.

What American electricians refer to as a "3 way switch" and British electricians refer to as a "2 way switch"* is what electronics guys would call a SPDT switch. It has three terminals, one of which is a "common" which depending on the position of the switch connects to one of the other two terminals.

There are two main wiring arrangements that can be used to control a light from multiple locations.

The first system and the easiest to understand is the system described in Dave's and Harper's answers. The permanent live is fed into the common terminal of one switch, the live to the light is fed. from the common terminal of the other switch. The other terminals of the switches are connected together by the "travellers". If the two switches are switched to the same traveller the light is on, if they are switched to different travellers the light is off.

The second system, which is the norm in the UK nowadays and which Americans call "California 3 way" or "coast 3 way", is to connect all three terminals of the switches together. Permanent live is taken from one non-common terminal and switched live is taken from the other. If both switches are switched to the permanent live line or both are switched to the switched-live line then the light is off. If one switch is switched to permanent live and the other to switched live then the light is off.

Which system is more convenient depends a lot on the design of your wiring accessories, if your accessories can only take one wire per terminal (which I understand is the norm in America), then the first system means less splicing. On the other hand if your accessories can take multiple wires per terminal (as is the norm in the UK) then the second system can avoid the need to splice.

To expand to more than two locations we use what American electricians call a Four way switch and British electricians call an intermediate switch. This swaps the travelers over and can be used to extend either of the above two systems.

There is also a third system, known by american as "Carter 3 way" but it is dangerous and should not be used. In this system the switches are used to switch between live and neutral. If the light gets two lives or two neutrals it is off, if it gets one of each it is on. This arrangement has several safety problems. Firstly it can leave the light "off but live". Secondly depending on the switch design it can lead to arcs between live and neutral. Thirdly in the case of ES lampholders it can leave the shell of the lamp live.

* Americans use the term "two way switch" to reffer to a simple on-off switch.