The SW-18020P is a miniature push-button switch designed for user input in electronic devices. Its compact design and reliable performance make it a popular choice for applications requiring tactile feedback and precise control. This switch is commonly used in consumer electronics, industrial control panels, and DIY electronics projects. Its small size allows it to fit into space-constrained designs, while its durability ensures long-term functionality.
The SW-18020P is a simple, normally open (NO) push-button switch. Below are its key technical details:
Parameter | Value |
---|---|
Operating Voltage | 12V DC (maximum) |
Operating Current | 50mA (maximum) |
Contact Resistance | ≤ 100mΩ |
Insulation Resistance | ≥ 100MΩ |
Operating Force | 180 ± 50gf |
Mechanical Durability | 100,000 cycles (minimum) |
Operating Temperature | -25°C to +85°C |
Dimensions | 6mm x 6mm x 5mm (typical) |
The SW-18020P has two pins, as it is a simple single-pole, single-throw (SPST) switch. The pin configuration is as follows:
Pin | Description |
---|---|
Pin 1 | Connects to one side of the circuit |
Pin 2 | Connects to the other side of the circuit |
When the button is pressed, the circuit between Pin 1 and Pin 2 is closed, allowing current to flow.
Below is an example of how to connect and use the SW-18020P with an Arduino UNO:
// SW-18020P Example Code for Arduino UNO
// This code reads the state of the push-button switch and turns on an LED
// connected to pin 13 when the button is pressed.
const int buttonPin = 2; // Pin connected to the SW-18020P
const int ledPin = 13; // Pin connected to the LED
void setup() {
pinMode(buttonPin, INPUT_PULLUP); // Set button pin as input with internal pull-up
pinMode(ledPin, OUTPUT); // Set LED pin as output
}
void loop() {
int buttonState = digitalRead(buttonPin); // Read the button state
if (buttonState == LOW) { // Button pressed (LOW due to pull-up resistor)
digitalWrite(ledPin, HIGH); // Turn on the LED
} else {
digitalWrite(ledPin, LOW); // Turn off the LED
}
}
Button Not Responding
Erratic Behavior When Pressed
Switch Fails to Close the Circuit
Button Feels Stiff or Unresponsive
Q: Can I use the SW-18020P with a 3.3V microcontroller?
A: Yes, the SW-18020P can operate at lower voltages like 3.3V, as long as the current does not exceed 50mA.
Q: Do I need an external pull-up resistor if my microcontroller has internal pull-ups?
A: No, you can use the microcontroller's internal pull-up resistor by configuring the input pin accordingly.
Q: How do I clean the SW-18020P if it gets dirty?
A: Use compressed air or a small brush to remove debris. Avoid using liquids, as they may damage the switch.
Q: Can the SW-18020P handle AC voltage?
A: No, the SW-18020P is designed for DC voltage only. Using it with AC voltage may damage the switch or cause unsafe operation.