KY-002 Vibration Switch Module Arduino Circuit

Introduction

The KY-002 Vibration Switch Module detects knocking and shaking. When the module is pushed, then the spring mechanism will close the circuit transmitting a short high signal. Which means activating the circuit

It can be interfacing with a variety of microcontrollers like Arduino, ESP32, Raspberry Pi, and others microcontrollers.

KY-002-Vibration-Switch-Module-with-Arduino

Hardware Required

You will require the following Hardware Components for the Interfacing of the KY-002 Vibration Switch Module.

Components#Buy From Amazon
Arduino UNO1Buy Link
KY-002 Vibration Switch Module1Buy Link
LED ( Red )1Buy Now
Jumper WiresBuy Link
Breadboard1Buy Link

Specifications

This module contains a 10k resistor, a conductive spring, and 3 male header pins. Shaking or Knocking the module will result in the spring to shortly close the circuit.

Operating Voltage5V
Board Dimensions18.5mm x 15mm [0.728in x 0.591in]

Pinout

KY-002-Vibration-Switch-Module-Pinout

Pin Configuration

Pin NamePin Type
SSignal Pin
middle pinVcc (+5)
( – )Ground

Circuit Diagram

The following circuit shows you the connection of the KY-002 Vibration Switch Module with Arduino Please make the connection carefully according to the circuit diagram

Circuit Connections

Place the module on the Breadboard and connect the signal pin (S) of the module to pin 3 of the Arduino. then link the power pin (middle) and ground (-) of the module to +5V and GND of the Arduino respectively.

ArduinoKY-002 ModuleRed LED
+5vMiddle
GNDGNDLED -Ve
Pin 3Signal
Pin 13LED +Ve

Installing Arduino IDE Software

First, you will require to Download the updated version of Arduino IDE Software and Install it on your PC or laptop. if you Learn How to install the Arduino step-by-step guide then click on how to install Arduino Button given Blow

Code

The following Arduino code creates a shock flasher. The LED on Arduino pin 13 will blink when the KY-002 is shaken or knocked. and Pin 3 obtains the signal from the module.

int Led = 13; // define the LED Pin
int shock = 3 // define the sensor Pin 
int val; // define a numeric variable val 
void setup () {
	pinMode (Led, OUTPUT); // LED pin as output  
	pinMode (shock, INPUT); // input from KY-002 sensor
} 
void loop () {
	val = digitalRead (shock); // read the value from KY-002
	if (val == HIGH ) {// when sensor detects shock, LED flashes  
		digitalWrite(Led, LOW);
	} else {
		digitalWrite (Led, HIGH);
	}
}

Downloads Files

  • KY-002 Vibration Switch Module Fritzing Part:
  • KY-002 Vibration Switch Module Datasheet:

Applications

  • Vibration Sensing
  • Impact Sensing
  • Trigger for Fall state

Leave a Comment


error: