Working with Microswitches

From BYOAC New Wiki
Jump to navigation Jump to search

General Microswitch Concept

First, try to understand how the whole Microswitch thing works.:

  • The Encoder constantly sends a small amount of electricity through a wire that runs from the encoder to the first Microswitch, to the next Microswitch, to the next Microswitch, and so on. This wire is called the Ground Wire. You can think of it as a water pipe in your house. There is a constant flow of water in there waiting for you to turn on the faucet.
  • For what we are going to do, you can think of the Microswitch as the faucet. Most of the time it is closed, and no water flows. Same thing here, most of the time the Microswitch is not pressed so the electricity does not flow. The moment you press the button, and thereby “turn on the faucet” electricity begins flowing.
  • Finally, there is the receiving end of the Encoder. Each Microswitch has an individual wire, the Hot Wire, which runs directly back to a spot on the Encoder that is assigned to that Microswitch. Its job is to sense when electricity flows from the Microswitch and let the Encoder know which “faucets” are turned on and which ones are turned off. When one is turned on, the Encoder sends a signal back to the computer that looks just like a press on a keyboard.

So, suppose you only have 1 encoder and 1 Microswitch and that Microswitch is assigned to the number “1.” There is a Ground Wire carrying electricity from the Encoder to the Microswitch, and another to carry electricity back from the Microswitch to the “1” input on the Encoder. As long as the Microswitch is not pushed, the electricity goes from the Encoder to the Microswitch, but it stops there – in terms of our analogy the faucet is closed so there no way for the water to get out of the pipe. However, when the button is pressed (think of the faucet as open and water running) electricity can run from the Encoder, to the Microswitch, and back to the “1” input on the Encoder. The Encoder then sends a signal to the computer that looks just like you pressed the “1” key on your keyboard.

The Anatomy of a Microswitch

Each Microswitch has three little metal prongs sticking out of it

  • Normally Open (aka NO),
  • Normally Closed (aka NC), and
  • Common (aka COM).

For our purposes, just forget about Normally Closed. In the Microswitch world “Closed” means that electricity can flow freely. We would use it if we wanted to create a situation where our “faucet” was usually left turned on with water flowing and only turned off as long as we held the button down. That is not what we want, so we are going to forget about NC and focus on NO and COM.

Our goal is to allow a small amount of electricity to flow from the Encoder, through the Ground Wire, into the COM prong on the Microswitch, and (when activated) back out of the NO prong, through the Hot Wire, and finally back into a specific input on the Encoder.

For information on how exactly to do this see Wiring Push Buttons and Conventional Digital Joysticks.