ESP32 KY-002 Vibration Switch Module

KY-002 Vibration Switch Module image

KY-002

Protocol: Digital

Overview

The KY-002 is a vibration switch module that detects shocks and vibrations through a conductive spring mechanism. Upon movement, it sends a digital signal, making it suitable for motion detection applications in various electronic projects.

About KY-002 Vibration Switch Module

The KY-002 is a vibration switch module designed to detect shocks and movement. Using a conductive spring mechanism, it closes the circuit momentarily upon detecting vibrations, sending a digital signal to microcontrollers like ESP32 and Arduino. This makes it ideal for motion detection in security systems, interactive devices, and monitoring equipment.

Key Features

  • Shock & Vibration Detection – Activates when movement or impact is detected.
  • Simple Digital Output – Easily interfaces with ESP32, Arduino, and other MCUs.
  • Compact & Low Power – Suitable for battery-powered projects.
  • Versatile Applications – Used in security alarms, motion-sensitive devices, and monitoring systems.

With its reliable motion detection capabilities, the KY-002 is an excellent choice for interactive and security-based applications. 🚀

Where to Buy

KY-002 Vibration Switch Module

Starting from

$2 per unit

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

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

Technical Specifications

Operating Voltage 3.3V to 5V
Dimensions 18.5mm x 15mm
Detection Mechanism Conductive spring
Output Type Digital signal

Pinout Configuration

The VCC pin is used to supply power to the sensor, and it typically requires 3.3V or 5V (refer to the datasheet for specific voltage requirements). The GND pin is the ground connection and must be connected to the ground of your ESP32.

  • Pin (-): Connects to Ground (GND).
  • Pin (middle): Connects to VCC (3.3V or 5V).
  • Pin (S): Outputs a digital signal when vibration is detected.

Wiring with ESP32

  • KY-002 Pin (-): Connect to ESP32 GND.
  • KY-002 Pin (middle): Connect to ESP32 3.3V or 5V.
  • KY-002 Pin (S): Connect to a GPIO pin on ESP32 (e.g., GPIO4).

Troubleshooting Guide

Common Issues

❌ No Response from KY-002 Module

⚠️ False Triggering of Vibration Detection

Debugging Tips

🔍 Serial Monitor

⚡ Voltage Checks

Code Examples

Arduino Example

C++
🔧

ESP-IDF Example

C++
🏠

ESPHome Example

YAML
🛠️

PlatformIO Example

C++
🐍

MicroPython Example

Python

Conclusion

The ESP32 KY-002 Vibration 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.

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

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