The KY-031 Knock / Vibration Sensor Module is a compact, low-cost impact detection board designed for Arduino, ESP32, Raspberry Pi, STM32, and other microcontroller projects. It uses a spring-based vibration sensor to detect knocks, taps, impacts, and vibrations, providing a clean digital output that can trigger alarms, count events, or activate actions in your project. It is an ideal solution for knock-activated switches, vibration monitoring, tamper detection, and interactive electronics.
At the heart of the module is a spring-type vibration sensor (also called a shock sensor or knock sensor). The sensor consists of a conductive spring surrounding a central metal pin. In the resting state, the spring does not touch the central pin, so the circuit is open. When the module is tapped, knocked, or subjected to vibration, the spring momentarily contacts the central pin, closing the circuit and generating a brief digital pulse. This simple mechanical design provides reliable impact detection without the need for complex calibration.
The module includes signal conditioning circuitry that converts the brief contact pulses into a clean digital output compatible with microcontroller logic levels. The output is typically LOW when no vibration is detected and pulses HIGH (or LOW, depending on variant) when a knock or impact occurs. The pulse duration depends on the intensity and duration of the vibration, but is generally short (milliseconds). An LED indicator provides visual feedback when an impact is detected, making it easy to verify operation during setup and troubleshooting.
The module features a 3-pin interface (VCC, GND, OUT) for easy connection to microcontrollers. The OUT pin can be connected directly to a digital input or interrupt pin on your microcontroller, allowing you to count impacts, trigger alarms, or wake the MCU from sleep. The compact form factor with mounting holes allows easy integration into door knockers, security devices, and interactive installations.
The KY-031 operates from a 3.3V to 5V DC supply, making it compatible with both modern low-power microcontrollers and traditional 5V systems. The low power consumption makes it suitable for battery-powered vibration monitoring projects.
The KY-031 is widely used in knock-activated switches, vibration monitoring systems, tamper detection, impact counters, interactive toys, security alarms, wearable devices, and educational STEM projects. It is also popular in DIY electronics and maker projects where impact or vibration detection is required.
Important Note: The KY-031 uses a mechanical spring sensor, so it may produce multiple pulses from a single knock due to contact bounce. Implement a debounce routine in your code or use a hardware debounce circuit to count impacts reliably. The sensor is not waterproof and should be kept dry. Avoid exposing the module to extreme shock or continuous vibration, as this may cause the spring to deform or fail over time.
Whether you are building a knock-activated light, a vibration alarm, or an impact counter, the KY-031 Knock / Vibration Sensor Module provides a reliable, affordable solution for impact detection. It is suitable for individual makers, students, and businesses purchasing in bulk for product development or educational programs.
Features
-
Spring-based vibration sensor — Detects knocks, taps, impacts, and vibrations
-
Digital output — Clean HIGH/LOW pulse for easy MCU integration
-
Interrupt-friendly output — Suitable for wake-on-impact and event counting
-
LED indicator — Visual feedback when impact is detected
-
Wide voltage range — 3.3V to 5V DC, compatible with Arduino, ESP32, Raspberry Pi
-
Low power consumption — Suitable for battery-powered applications
-
Compact form factor — With mounting holes for easy integration
-
Simple interface — 3-pin connection (VCC, GND, OUT)
-
Wide application range — Knock switches, vibration monitoring, tamper detection, interactive toys
-
Cost-effective — Affordable solution for impact detection in volume production
Technical Specifications
| # | Parameter | Specification |
|---|---|---|
| 1 | Module Model | KY-031 |
| 2 | Sensor Type | Spring-based vibration / knock sensor |
| 3 | Output Type | Digital (pulse when impact detected) |
| 4 | Operating Voltage | 3.3V – 5V DC |
| 5 | Detection Method | Mechanical spring contact |
| 6 | Indication | LED indicator |
| 7 | Pin Count | 3 pins (VCC, GND, OUT) |
| 8 | Module Dimensions | Compact PCB with mounting holes |

















