Pages created and updated by
Terry Sturtevant
Date Posted:
May 12, 2017
DIP
switches can be used to select between 0 and 5 volts
on circuit boards. However, for prototyping, their
small size makes them inconvenient. For that reason, we have
created prototype switches which are in the lab and
work exactly like DIP switches, although they are bigger so they're
easier to manipulate by hand.
Since the switch does not have
any power or ground connectors
this must be done externally.
In the picture below, the DIP switch is on the right and the
prototype switch is on the left.
If we want a high (5V) when then switch is turned on, each input pin we are using must be connected to power. When the switch is off we want a low (0V); but remember when the switch is off it is in a floating state. To resolve our floating pins issue we need to add a resistor to the output pins.
Here's an active high configuration. When a switch is closed, the signal will be connected to power. When a switch is open, the signal will be connected to ground through the resistor.
Note the signal comes from the same side of the switch as the resistor. I've shown all four switches connected.
Here's an active low configuration. When a switch is closed, the signal will be connected to ground. When a switch is open, the signal will be connected to power through the resistor.
Note the signal comes from the same side of the switch as the resistor. I've shown all four switches connected.
Wilfrid Laurier University
© 2019 Wilfrid Laurier University