

The KEY002 is a key switch manufactured by QIACHIP. It is a momentary push-button switch designed for user input in electronic circuits. When pressed, the switch closes the circuit, allowing current to flow, and when released, it opens the circuit, stopping the current flow. This simple yet versatile component is widely used in various applications, including control panels, embedded systems, and prototyping projects.








The following table outlines the key technical details of the KEY002 key switch:
| Parameter | Value |
|---|---|
| Manufacturer | QIACHIP |
| Part ID | KEY002 |
| Switch Type | Momentary (Normally Open) |
| Operating Voltage | 3.3V to 12V |
| Maximum Current | 50mA |
| Contact Resistance | ≤ 100mΩ |
| Insulation Resistance | ≥ 100MΩ |
| Operating Temperature | -20°C to +70°C |
| Mechanical Life | 100,000 cycles |
The KEY002 has two pins, as described in the table below:
| Pin | Description |
|---|---|
| Pin 1 | Connects to the positive side of the circuit (input) |
| Pin 2 | Connects to the negative side of the circuit (output) |
Wiring the Switch:
Testing the Switch:
Example Circuit:
+5V ----> [KEY002] ----> Microcontroller Pin
|
|
[10kΩ]
|
GND
The following example demonstrates how to use the KEY002 with an Arduino UNO to toggle an LED when the switch is pressed:
// Define pin connections
const int switchPin = 2; // KEY002 connected to digital pin 2
const int ledPin = 13; // Built-in LED on pin 13
// Variable to store the switch state
int switchState = 0;
void setup() {
pinMode(switchPin, INPUT_PULLUP); // Set switch pin as input with pull-up resistor
pinMode(ledPin, OUTPUT); // Set LED pin as output
}
void loop() {
// Read the state of the switch
switchState = digitalRead(switchPin);
// If the switch is pressed (LOW due to pull-up resistor)
if (switchState == LOW) {
digitalWrite(ledPin, HIGH); // Turn on the LED
} else {
digitalWrite(ledPin, LOW); // Turn off the LED
}
}
Note: The INPUT_PULLUP mode is used to enable the internal pull-up resistor of the Arduino, eliminating the need for an external pull-down resistor.
Switch Not Responding:
Unstable or Noisy Output:
Switch Fails to Close the Circuit:
Switch Works Intermittently:
Q1: Can the KEY002 be used with a 3.3V microcontroller?
Yes, the KEY002 operates within a voltage range of 3.3V to 12V, making it compatible with 3.3V systems.
Q2: Do I need an external pull-up or pull-down resistor?
If your microcontroller does not have an internal pull-up or pull-down resistor, you will need to add an external resistor (typically 10kΩ) to stabilize the signal.
Q3: How do I debounce the KEY002 in software?
You can use a simple delay or a debounce library in your microcontroller code to filter out noise caused by switch bouncing.
Q4: Can the KEY002 handle AC voltage?
No, the KEY002 is designed for low-voltage DC applications only. Do not use it with AC voltage.
By following this documentation, you can effectively integrate the KEY002 key switch into your electronic projects.