Momentary switch

From bildr

Jump to: navigation, search


Momentary Switches.JPG

A momentary switch is a switch that you have to hold down to keep an electronic circuit closed (or open with a push to break switch), they vary widely in shape and size and can be used for many purposes in many circuits. For example, most keyboards have over 100 momentary push switches, remote controls for TVs, DVD players etc. all have momentary switches.

Hooking it up

To use one of these with an MCU, the best way is to connect one side of the switch to an input pin on the MCU and the other side to ground, then connect that same pin through a resistor to +v.

With a 5 volt MCU a common 10k-ohm resistor will work fine.

Momentary Switch Schematic.png

Code

For a push to make switch with the configuration above the input pin will be high when it is not pressed and low when it is pressed.


This page is a Component on bildr. Components are pages about specific parts, and include connection details and code when available.

NOTE: All information contained within this article is pure opinion. Although this article is intended to help people, it may contain faulty or misleading information. This article is not to be considered professional opinion or advice, and is in no way a replacement for reading all safety/instructional documentation. Always remember to protect yourself when handling/using hazardous materials, as well as test new techniques before using them on projects/work intended to be handed in or used.

bildr and its contributers take NO responsibility for the information contained within.