daA switch is any component that can connect or disconnect a connection in a circuit. There are many kinds of switches and there is some tricky vocabulary involved in describing them, so I wanted to help demystify some of that here before giving some examples of how we can use them. First, some terminology.
Left: Push-button switch. Right: Slide switch.
The first thing we need to clear up is what we mean when we say open and closed. This can be confusing sometimes for beginners.
An open switch means that current does not flow. We sometimes refer to the switch as being OFF. This may seem counterintuitive at first, but it makes sense when you think about it. A circuit needs a “closed path” for current to flow. If any part of that circuit is “open” (i.e., the wires are not connected), no current can flow.
On the other hand, a closed switch is one that allows current to flow. This is also referred to as ON.
Now that we have that down, we can define normally open and normally closed. These simply refer to what position the switch is in if you do not press it. A normally open switch is open until it is pressed, which closes it. Conversely, a normally closed switch will be closed until it is pressed, at which point it will become open.
Next, we will define poles and throws, which are helpful for describing different kinds of switches.
Poles refers to the number of connections being controlled. A single pole (SP) switch means that pressing the switch changes just one connection, while double pole (DP) means that two different connections are affected by pressing one switch.
Throws refer to how many terminals a single switch can connect to. A single throw (ST) means that the switch is either connected to a terminal or to nothing at all. A double throw (DT) means that it switches between two terminals.
The four most common switch configurations
NOTE: For simplicity, we have been assuming thus far that the switches are push-button switches, meaning that they are activated when pushed but return to their initial position when released. There are also toggle switches, which stay in the position they are switched to until they are switched back.
Alright, enough of the boring stuff. Let’s talk about how we can use switches to implement simple logic. We will use an LED to indicate that a connection has been made. Here is the circuit we will be using with a single normally open, SPST switch to start.
Left: Open switch, LED off. Right: Closed switch, LED on.
Know how switches are use to create the Logic States
Now, let’s see how we can create different logic states with a combination of switches.
AND condition: If we put two switches in series, they would both need to be closed for current to flow. Similarly, you could put any number of switches in series and they would all need to be closed for current to flow. This is called an AND condition because you need switch 1 and switch 2 to be closed for the LED to turn on.
OR condition: If we put two switches in parallel, current could flow through either path so long as at least one of them is closed. Similarly, with any number of switches in parallel, only one needs to be closed for current to flow. This is called an OR condition.
Three-way switch (XOR condition): Most homes have lights that can be activated by two different switches (often on opposite sides of a room or hallway). Both switches when flipped change the state of the lights (i.e., turn them on or off), regardless of the position of the other switch. Ever wondered how this is achieved? The answer is the three-way switch!
A three-way switch employs two SPDT toggle switches, which both connect to two different wires. This means that when they are both connected to the same wire, the LED is on, but if they are connected to different wires, the LED is off. This means that each time you flip either switch, the LED is guaranteed to switch from being on to off or vice versa.