Switch
Back
Switches, buttons, officially known as tactile switches, are a small component found where ever input from a human is needed (except for touch screens in modern electronics ofcourse). Usually covered by a plastic top or some other aesthetically pleasing enclosure, tactile switches are rarly seen themselves. They come in many different sizes, lengths, amount of travel, and clicky-ness.
Diagrams

Wiring diagrams for open (top) and closed (bottom) switches. When a switch is open, electricity is not able to flow through. When closed, electricity can travel across the switch. The switches in our lab are normally-open, so you have to press them to close the circuit.

Lab Schematics

In our lab schematics, switches are shown like this. Notice how there are two pins per side of the switch that are connected together on the inside. This means that compnents connected either side of the switch are connected together by the switch but compnents across are only connected when the switch is closed.

Appearance

Wiring diagrams for open (top) and closed (bottom) switches. When a switch is open, electricity is not able to flow through. When closed, electricity can travel across the switch. The switches in our lab are normally-open, so you have to press them to close the circuit.

Wiring

To wire a tactile switch to an Arduino, there are two methods:

Pull-Up Method:

The idea behind this method is, when the switch is closed, the pin on the Arduino is set to +5V, when the switch is open, the pin on the Arduino is GND. This represents a 1 in binary inside the Arduino, and therefor the code should be written to get the Arduino to do something when the input is 1.





Pull-Down Method:

This is the method we'll be using in the labs. When the switch is closed, it is brought to GND, when the switch is open, it is +5V. The Arduino should be coded to do something when it receives a 0 instead of a 1.

Additional Resources