

The Momentary Switch (Manufacturer Part ID: COM-00097) by SparkFun Electronics is a simple yet versatile electronic component. It is a type of switch that remains in the "on" position only while being pressed and automatically returns to the "off" position when released. This behavior makes it ideal for applications requiring temporary activation, such as doorbells, keyboard keys, or reset buttons in electronic circuits.








Below are the key technical details for the SparkFun Momentary Switch (COM-00097):
| Parameter | Value |
|---|---|
| Manufacturer | SparkFun Electronics |
| Part ID | COM-00097 |
| Switch Type | Momentary (Normally Open) |
| Contact Rating | 50 mA at 12 VDC |
| Contact Resistance | ≤ 100 mΩ |
| Insulation Resistance | ≥ 100 MΩ |
| Operating Temperature | -20°C to +70°C |
| Actuation Force | ~160 gf |
| Dimensions | 6 mm x 6 mm x 5 mm |
| Mounting Type | Through-hole |
The momentary switch has four pins, but only two are electrically connected. The other two pins are for mechanical stability. Below is the pin configuration:
| Pin Number | Description |
|---|---|
| Pin 1 | Switch terminal 1 (Normally Open) |
| Pin 2 | Switch terminal 2 (Normally Open) |
| Pin 3 | Mechanical support (not connected) |
| Pin 4 | Mechanical support (not connected) |
Below is an example of how to connect and use the momentary switch with an Arduino UNO to toggle an LED:
// Define pin numbers
const int switchPin = 2; // Pin connected to the momentary switch
const int ledPin = 13; // Pin connected to the LED
// Variable to store the LED state
bool ledState = false;
// Variable to track the last switch state
int lastSwitchState = LOW;
void setup() {
pinMode(switchPin, INPUT_PULLUP); // Configure switch pin as input with pull-up
pinMode(ledPin, OUTPUT); // Configure LED pin as output
digitalWrite(ledPin, LOW); // Ensure LED is off initially
}
void loop() {
// Read the current state of the switch
int currentSwitchState = digitalRead(switchPin);
// Check if the switch was pressed (transition from HIGH to LOW)
if (currentSwitchState == LOW && lastSwitchState == HIGH) {
delay(50); // Debounce delay
if (digitalRead(switchPin) == LOW) { // Confirm stable press
ledState = !ledState; // Toggle the LED state
digitalWrite(ledPin, ledState ? HIGH : LOW); // Update LED
}
}
// Update the last switch state
lastSwitchState = currentSwitchState;
}
Q: Can I use this switch for high-current applications?
A: No, the switch is rated for a maximum of 50 mA at 12 VDC. For higher currents, use a relay or transistor in conjunction with the switch.
Q: How do I debounce the switch in hardware?
A: Place a small capacitor (e.g., 0.1 µF) across the active pins of the switch to filter out noise.
Q: Can I use this switch with a Raspberry Pi?
A: Yes, the switch can be used with a Raspberry Pi. Connect it to a GPIO pin configured as an input, and use a pull-up or pull-down resistor as needed.
Q: Are the mechanical support pins necessary?
A: While not electrically connected, the mechanical support pins provide stability when soldered to a PCB and should be used for reliable mounting.
This concludes the documentation for the SparkFun Momentary Switch (COM-00097).