KY-004 Key Switch Module

KY-004 Key Switch Module image

View on Amazon

Overview

The KY-004 is a key switch module equipped with a tactile push-button. It provides a digital output signal when pressed, making it ideal for user input applications in various electronic projects.

About KY-004 Key Switch Module

The KY-004 is a simple push-button switch module that provides digital input for microcontrollers. When pressed, it connects the signal pin to ground, sending a LOW signal to trigger an event. It operates within 3.3V to 5V, making it compatible with ESP32, Arduino, and other microcontrollers.

Key Features

  • Push-Button Activation – Sends a LOW signal when pressed.
  • Operating Voltage – Works with 3.3V to 5V, ensuring broad compatibility.
  • Simple Digital Output – Easy integration with ESP32, Arduino, and similar boards.
  • Versatile Applications – Used for reset functions, menu navigation, and input controls.

With its compact design and easy-to-use interface, the KY-004 is perfect for user input, interactive devices, and control applications. 🚀

Where to Buy

Get Your KY-004

KY-004 Key Switch Module

Starting from

1$ per unit

Amazon com
Amazon.com Ships worldwide
Amazon de
Amazon.de Ships to EU
Aliexpress
AliExpress Best value option

Prices are subject to change. We earn from qualifying purchases as an Amazon Associate.

Technical Specs

KY-004 Specifications

Complete technical specification details for KY-004 Key Switch Module

📊 Technical Parameters

Operating Voltage 3.3V to 5V
Dimensions 15mm x 26mm x 10mm
Button Type Tactile push-button
Output Type Digital signal
Operating Temperature -25°C to 105°C
Durability 100,000 cycles
Pin Configuration

KY-004 Pinout

The **KY-004** is a 3-pin tactile push-button switch module:

Visual Pinout Diagram

Pinout Diagram Primary
KY-004 Key Switch Module pinout
3
Total Pins

Pin Types

Power
2
Communication
1

Quick Tips

🔌

**Interface**: Digital output (active low when pressed),🔘 **Button**: Tactile push-button switch

💡

**Operation**: Signal pin pulled LOW when pressed,⚡ **Power**: 3.3V or 5V operation

🔋

**Pull-up**: Built-in pull-up resistor on module,🎯 **Applications**: User input, reset buttons, menu navigation, control interfaces

Pin Descriptions

Pin NameTypeDescriptionNotes
1 Pin (-)
Power

Ground connection

2 Pin (+)
Power

Power supply

3.3V or 5V

3 Pin (S)
Communication

Digital signal output

Goes LOW when button pressed (active low)

Connection Guide

Wiring KY-004 to ESP32

To interface the **KY-004** with an **ESP32** for button input:

Visual Wiring Diagram

Wiring Diagram Recommended
KY-004 Key Switch Module wiring with ESP32
3
Connections

Connection Status

Required
3

Protocol

Digital

Pin Connections

KY-004 PinConnectionESP32 PinDescription
1 Pin (-) Required
GND

Ground

2 Pin (+) Required
3.3V or 5V

Power supply

3 Pin (S) Required
GPIO4

Digital input (any GPIO)

💡

**GPIO Selection**: Any digital GPIO pin works, GPIO4 is just an example

**Voltage**: Use 3.3V for ESP32 compatibility

🔘

**Debouncing**: Software debouncing recommended for clean button press detection

🎯

**Active Low**: Signal is LOW when pressed, HIGH when released

Help & Support

KY-004 Troubleshooting

Common issues and solutions to help you get your sensor working

Common Issues

Debugging Tips

Code Examples

KY-004 Programming Examples

Ready-to-use code examples for different platforms and frameworks

Summary

Wrapping Up KY-004

The ESP32 KY-004 Key Switch Module is a powerful KY-0xx module sensor that offers excellent performance and reliability. With support for multiple development platforms including Arduino, ESP-IDF, ESPHome, PlatformIO, and MicroPython, it's a versatile choice for your IoT projects.

Best Practices

For optimal performance, ensure proper wiring and follow the recommended configuration for your chosen development platform.

Safety First

Always verify power supply requirements and pin connections before powering up your project to avoid potential damage.

Ready to Start Building?

Now that you have all the information you need, it's time to integrate the KY-004 into your ESP32 project and bring your ideas to life!

Similar Options

Explore Alternative Sensors

Looking for alternatives to the KY-004? Check out these similar sensors that might fit your project needs.

KY-031 Knock Sensor Module

KY-031 Knock Sensor Module

KY-0XX MODULE Digital

The KY-031 is a knock sensor module that detects physical impacts or vibrations. Upon detecting a knock, it outputs a digital signal, making...

View Details
KY-034 Automatic Flashing Color LED Module

KY-034 Automatic Flashing Color LED Module

KY-0XX MODULE Digital

The KY-034 is an automatic flashing color LED module that emits a sequence of seven colors when powered. It's suitable for decorative and...

View Details
KY-035 Analog Hall Magnetic Sensor Module

KY-035 Analog Hall Magnetic Sensor Module

KY-0XX MODULE Analog

The KY-035 is an analog Hall magnetic sensor module based on the AH49E linear Hall-effect sensor. It provides an analog output voltage...

View Details