Skip to Content

Push Button Switch Module KY-004

The KY-004 Push Button Switch Module is a compact and reliable electronic component designed to easily integrate push button input into your microcontroller projects. It features a tactile micro switch that activates when pressed, offering a simple method to detect user interaction. With a built-in pull-up resistor, it connects directly to any microcontroller input pin, eliminating the need for external components.

Compatible with all major microcontroller platforms, this module is a versatile solution for various applications such as user interfaces, input detection, or control systems. It's ideal for beginners and professionals alike due to its plug-and-play design and straightforward setup.

Package Includes

  • 1 x KY-004 Push Button Switch Module

6.30 AED 6.30 AED Tax Included
6.30 AED Tax Included

Not Available For Sale

This combination does not exist.

Push Button Module

Terms and Conditions
30-day money-back guarantee
Shipping: 2-3 Business Days

 

Specifications

  • Material: FR4
  • Operating Voltage: 5V DC
  • Type: Push Button Key Switch
  • Max Operating Force: 180 / 230 ±20gf
  • Durability: 100,000 cycles
  • Dimensions: 25 x 16 x 10mm
  • Weight: 1.5g

Pin Connections

KY-004 Push Button Module

Pin Description Connection
- Ground Connect to Ground
+5V Positive Power Connect to 5V
S Digital Signal Connect to Digital Input on MCU

Applications

  • User Interfaces: As part of control panels to trigger commands or actions.
  • Sensor Inputs: Detecting physical input from users.
  • Alarm Systems: Acts as an emergency stop or panic button.
  • Robotics: Used for manual control or input in robotic systems.
  • Home Automation: Trigger actions like lighting or door control.

 

Sample Project

Circuit Connections

  • LED + → Pin 13
  • LED - → GND
  • Sensor Signal → Pin 10
  • Sensor +V → 5V
  • Sensor - → GND

KY-004 Circuit Example

Library

No external library is required to use this module.

Example Code

int Led = 13;     // Declaration of the LED output pin
int Sensor = 10;  // Declaration of the sensor input pin
int val;          // Temporary variable

void setup() {
  pinMode(Led, OUTPUT);       // Initialize LED pin
  pinMode(Sensor, INPUT);     // Initialize button pin
  digitalWrite(Sensor, HIGH); // Enable internal pull-up resistor
}

void loop() {
  val = digitalRead(Sensor);  // Read button state
  if (val == HIGH) {
    digitalWrite(Led, LOW);   // LED off if button not pressed
  } else {
    digitalWrite(Led, HIGH);  // LED on if button is pressed
  }
}

Reference