Last edited 28 August 2014 by Tom Igoe
In this lab you will learn about different types of switches and their terminology. You’ll use switches and pushbuttons frequently in physical computing projects, and it’s helpful to be aware of the terminology used in describing them when shopping for them or trying to understand tutorials that use them.
There are two common types of digital inputs: switches and pushbuttons. A switch is a mechanism that brings two pieces of metal together using some form of lever action. Think of everyday household light switches. A pushbutton brings two pieces of metal together when you push down on it. Think of elevator buttons.
Switches and pushbuttons can be normally open, meaning that when the switch is in its normal position (not being touched by a person) the contacts are not touching. Normally closed means that when the switch or pushbutton is in its normal position, the contacts are touching, or closed.
A switch can switch more than one set of contacts. A Single throw switch has only two contacts. The switch is open or closed. Dual Throw switches have three contacts, and switching the switch moves a center contact from one outer contact to the other outer contact.
Switches can have multiple poles as well. A Single pole switch has only one set of contacts that it closes or opens when it moves. Dual Pole switches have two sets of contacts being controlled by the same mechanism. With a dual pole switch, you can switch two separate circuits with the same mechanism. In a dual pole switch, the mechanism connecting the contacts is an insulator, so that the poles don’t connect. The knife switch in the image below is a dual pole, dual throw switch. When shopping for a switch, you should look for a DPDT switch.
Pushbuttons or momentary switches stay closed only as long as you hold them closed. Roller switches are pushbuttons with a lever and a roller attached. They’re useful when you need something to push against the switch gently to close it.
Toggle switches stay closed in one physical position and open in the other. Slide switches are similar to toggle switches.
Magnetic switches have two metal leaves in the end that are pulled together when a magnet is brought close to them. They’re useful when you can’t have wires on both sides of the switch mechanism. Magnetic snaps are useful when you’re making a soft circuit and need a fastener on the garment to close a switch.
Whisker switches are made from a piece of spring steel or piano wire, and a center post. An insulator such as a piece of electrical tape or shrinkwrap holds the two separate. When the wire is touched, the spring bends and touches the metal post, and closes the switch. Solarbotics sells some nice whisker switches.
Tilt switches contain a metal ball and contacts at one end. When you tilt the switch, the ball touches both contacts, and closes the switch. There are also mercury switches that do the same, but with a ball of mercury inside. Avoid these, since mercury is very poisonous.
A switch is nothing more than a mechanism to bring two pieces of conductive material together and separate them. You can make a switch from any two conductors and a little creativity.
All you need to do is arrange the two conductors in such a way that they can touch or not touch. Sometimes a spacer layered between the two conductors helps. For example, in this image you see three pieces of conductive fabric. Two of the pieces have non-conductive layers on top of them. When the non-conductive part is sandwiched between the conductive layers, you’ve got a switch that’s pressed by touching. The conductive parts touch when they’re pressed through the holes in the non-conductive part. These two switches would have different sensitivities because the hole-to-material ratio of the non-conductive layer is different.
Make your own switch. Find a way to turn a closing door into a switch, for example, or to close a switch when a person sits down. Or figure out how to turn a hat into a switch, or a cane, or a zipper. Or perhaps the pieces of a puzzle can be switches. Come up with an everyday activity to which you can add three or four custom switches that, when combined, turn on a light. For example, maybe the light comes on when you close the door, sit down, and open a book. Or when you walk upstairs, put your keys on a side table, and remove your hat. Combine your creativity with switches with what you learned in the electronics lab to make this happen. For more ideas on materials, check out How to Get What You Want. They have an excellent list of conductive materials and instructions.
In planning your switch project, consider what happens when you arrange switches in different ways. For example, try the following circuits.
Three switches in parallel. Any one of the three will turn on the LED.
Three switches in series. All three must be on to turn on the LED.
In a simple circuit, a motor is no different than an LED as a load. You can switch it as well. Make sure your power supply can supply the current and amperage that your motor requires and you are good to go.
With a dual pole switch, you could control both a motor and an LED like so:
|Switching a motor and an LED with a dual pole switch schematic||Switching a motor and an LED with a dual pole switch breadboard|