Home
Motion, Vibration & Proximity
KY-002 Vibration Switch Module
Arduino Vibration Switch Module KY-002 Keyes allows detection of shock and vibration. The KY-002 Vibration Switch Module consists of a conductive vibration spring and a 10k resistor, it will react to shock and vibration by closing the circuit.
Specifications:
Operating Voltage: 5V
Dimensions 18.5mm x 15mm [0.728in x 0.591in]
Connection Diagram
Connect the Power line (middle) and ground (-) to +5 and GND respectively. Connect signal (S) to pin 3 on the Arduino.
The following Arduino sketch produces a shock flasher. Pin 13 (LED) on the Arduino will flash when KY-002 detects movement. Pin 3 is used as input from KY-002.
int Led = 13 ; int shock = 3 int val;
void setup ( ) {
pinMode ( Led, OUTPUT ) ; pinMode ( shock, INPUT ) ; }
void loop ( ) {
val = digitalRead ( shock) ; if ( val == HIGH ) digitalWrite ( Led, LOW ) ;
} else {
digitalWrite ( Led, HIGH ) ;
}
}
Use left/right arrows to navigate the slideshow or swipe left/right if using a mobile device
{"id":6631308689494,"title":"KY-002 Vibration Switch Module","handle":"ky-002-vibration-switch-module","description":"\u003cp\u003e\u003cspan data-mce-fragment=\"1\"\u003eArduino Vibration Switch Module KY-002 Keyes allows detection of shock and vibration. The KY-002 Vibration Switch Module consists of a conductive vibration spring and a 10k resistor, it will react to shock and vibration by closing the circuit.\u003c\/span\u003e\u003c\/p\u003e\n\u003ch3\u003e\u003cspan data-mce-fragment=\"1\"\u003eSpecifications:\u003c\/span\u003e\u003c\/h3\u003e\n\u003cul\u003e\n\u003cli\u003eOperating Voltage: 5V\u003c\/li\u003e\n\u003cli\u003eDimensions 18.5mm x 15mm [0.728in x 0.591in]\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003ch3\u003eConnection Diagram\u003c\/h3\u003e\n\u003cdiv class=\"siteorigin-widget-tinymce textwidget\"\u003e\n\u003cp\u003eConnect the Power line (middle) and ground (-) to +5 and GND respectively. Connect signal (S) to pin 3 on the Arduino.\u003c\/p\u003e\n\u003cp\u003e\u003cimg alt=\"\" src=\"https:\/\/cdn.shopify.com\/s\/files\/1\/0014\/4313\/5560\/files\/Arduino_KY-002_Keyes_Vibration_switch_module_connection-diagram_600x600.png?v=1631817199\"\u003e\u003c\/p\u003e\n\u003ch3 class=\"widget-title\"\u003eExample Code\u003c\/h3\u003e\n\u003cdiv class=\"siteorigin-widget-tinymce textwidget\"\u003e\n\u003cp\u003eThe following Arduino sketch produces a shock flasher. Pin 13 (LED) on the Arduino will flash when KY-002 detects movement. Pin 3 is used as input from KY-002.\u003c\/p\u003e\n\u003cpre class=\"line-numbers language-arduino\"\u003e\u003ccode class=\"language-arduino\"\u003e\u003cspan class=\"token keyword\"\u003eint\u003c\/span\u003e Led \u003cspan class=\"token operator\"\u003e=\u003c\/span\u003e \u003cspan class=\"token number\"\u003e13\u003c\/span\u003e\u003cspan class=\"token punctuation\"\u003e;\u003c\/span\u003e\u003cspan spellcheck=\"true\" class=\"token comment\"\u003e \/\/ define the LED Pin\n\u003c\/span\u003e\u003cspan class=\"token keyword\"\u003eint\u003c\/span\u003e shock \u003cspan class=\"token operator\"\u003e=\u003c\/span\u003e \u003cspan class=\"token number\"\u003e3\u003c\/span\u003e\u003cspan spellcheck=\"true\" class=\"token comment\"\u003e \/\/ define the sensor Pin \n\u003c\/span\u003e\u003cspan class=\"token keyword\"\u003eint\u003c\/span\u003e val\u003cspan class=\"token punctuation\"\u003e;\u003c\/span\u003e\u003cspan spellcheck=\"true\" class=\"token comment\"\u003e \/\/ define a numeric variable val \n\u003c\/span\u003e\n\u003cspan class=\"token keyword\"\u003evoid\u003c\/span\u003e \u003cspan class=\"token important\"\u003esetup\u003c\/span\u003e \u003cspan class=\"token punctuation\"\u003e(\u003c\/span\u003e\u003cspan class=\"token punctuation\"\u003e)\u003c\/span\u003e \u003cspan class=\"token punctuation\"\u003e{\u003c\/span\u003e\n\t\u003cspan class=\"token selector\"\u003epinMode\u003c\/span\u003e \u003cspan class=\"token punctuation\"\u003e(\u003c\/span\u003eLed\u003cspan class=\"token punctuation\"\u003e,\u003c\/span\u003e \u003cspan class=\"token boolean\"\u003eOUTPUT\u003c\/span\u003e\u003cspan class=\"token punctuation\"\u003e)\u003c\/span\u003e\u003cspan class=\"token punctuation\"\u003e;\u003c\/span\u003e\u003cspan spellcheck=\"true\" class=\"token comment\"\u003e \/\/ LED pin as output \n\u003c\/span\u003e\t\u003cspan class=\"token selector\"\u003epinMode\u003c\/span\u003e \u003cspan class=\"token punctuation\"\u003e(\u003c\/span\u003eshock\u003cspan class=\"token punctuation\"\u003e,\u003c\/span\u003e \u003cspan class=\"token boolean\"\u003eINPUT\u003c\/span\u003e\u003cspan class=\"token punctuation\"\u003e)\u003c\/span\u003e\u003cspan class=\"token punctuation\"\u003e;\u003c\/span\u003e\u003cspan spellcheck=\"true\" class=\"token comment\"\u003e \/\/ input from KY-002 sensor\n\u003c\/span\u003e\u003cspan class=\"token punctuation\"\u003e}\u003c\/span\u003e \n\n\u003cspan class=\"token keyword\"\u003evoid\u003c\/span\u003e \u003cspan class=\"token important\"\u003eloop\u003c\/span\u003e \u003cspan class=\"token punctuation\"\u003e(\u003c\/span\u003e\u003cspan class=\"token punctuation\"\u003e)\u003c\/span\u003e \u003cspan class=\"token punctuation\"\u003e{\u003c\/span\u003e\n\tval \u003cspan class=\"token operator\"\u003e=\u003c\/span\u003e \u003cspan class=\"token selector\"\u003edigitalRead\u003c\/span\u003e \u003cspan class=\"token punctuation\"\u003e(\u003c\/span\u003eshock\u003cspan class=\"token punctuation\"\u003e)\u003c\/span\u003e\u003cspan class=\"token punctuation\"\u003e;\u003c\/span\u003e\u003cspan spellcheck=\"true\" class=\"token comment\"\u003e \/\/ read the value from KY-002\n\u003c\/span\u003e\t\u003cspan class=\"token keyword\"\u003eif\u003c\/span\u003e \u003cspan class=\"token punctuation\"\u003e(\u003c\/span\u003eval \u003cspan class=\"token operator\"\u003e==\u003c\/span\u003e \u003cspan class=\"token boolean\"\u003eHIGH\u003c\/span\u003e \u003cspan class=\"token punctuation\"\u003e)\u003c\/span\u003e \u003cspan spellcheck=\"true\" class=\"token comment\"\u003e{\/\/ when sensor detects shock, LED flashes \n\u003c\/span\u003e\t\t\u003cspan class=\"token selector\"\u003edigitalWrite\u003c\/span\u003e\u003cspan class=\"token punctuation\"\u003e(\u003c\/span\u003eLed\u003cspan class=\"token punctuation\"\u003e,\u003c\/span\u003e \u003cspan class=\"token boolean\"\u003eLOW\u003c\/span\u003e\u003cspan class=\"token punctuation\"\u003e)\u003c\/span\u003e\u003cspan class=\"token punctuation\"\u003e;\u003c\/span\u003e\n\t\u003cspan class=\"token punctuation\"\u003e}\u003c\/span\u003e \u003cspan class=\"token keyword\"\u003eelse\u003c\/span\u003e \u003cspan class=\"token punctuation\"\u003e{\u003c\/span\u003e\n\t\t\u003cspan class=\"token selector\"\u003edigitalWrite\u003c\/span\u003e \u003cspan class=\"token punctuation\"\u003e(\u003c\/span\u003eLed\u003cspan class=\"token punctuation\"\u003e,\u003c\/span\u003e \u003cspan class=\"token boolean\"\u003eHIGH\u003c\/span\u003e\u003cspan class=\"token punctuation\"\u003e)\u003c\/span\u003e\u003cspan class=\"token punctuation\"\u003e;\u003c\/span\u003e\n\t\u003cspan class=\"token punctuation\"\u003e}\u003c\/span\u003e\n\u003cspan class=\"token punctuation\"\u003e}\u003c\/span\u003e\u003c\/code\u003e\u003c\/pre\u003e\n\u003cp\u003e \u003cbr\u003e\u003c\/p\u003e\n\u003c\/div\u003e\n\u003c\/div\u003e","published_at":"2022-12-06T11:09:07+05:30","created_at":"2021-09-16T23:55:29+05:30","vendor":"ThinkRobotics.in","type":"Sensor","tags":["arduino sensor","ELC1","IN-MOD","KY-002","MTN-SNR","sensor","shock sensor","vibration sensor"],"price":6999,"price_min":6999,"price_max":6999,"available":false,"price_varies":false,"compare_at_price":8999,"compare_at_price_min":8999,"compare_at_price_max":8999,"compare_at_price_varies":false,"variants":[{"id":39542522642518,"title":"Default Title","option1":"Default Title","option2":null,"option3":null,"sku":"ELC1102","requires_shipping":true,"taxable":true,"featured_image":null,"available":false,"name":"KY-002 Vibration Switch Module","public_title":null,"options":["Default Title"],"price":6999,"weight":20,"compare_at_price":8999,"inventory_management":"shopify","barcode":"39542522642518","requires_selling_plan":false,"selling_plan_allocations":[]}],"images":["\/\/thinkrobotics.com\/cdn\/shop\/products\/H81116e96ee4b46caa9583036d3e248222.jpg?v=1631816752"],"featured_image":"\/\/thinkrobotics.com\/cdn\/shop\/products\/H81116e96ee4b46caa9583036d3e248222.jpg?v=1631816752","options":["Title"],"media":[{"alt":"KY-002 Vibration Switch Module","id":21297547968598,"position":1,"preview_image":{"aspect_ratio":1.0,"height":1000,"width":1000,"src":"\/\/thinkrobotics.com\/cdn\/shop\/products\/H81116e96ee4b46caa9583036d3e248222.jpg?v=1631816752"},"aspect_ratio":1.0,"height":1000,"media_type":"image","src":"\/\/thinkrobotics.com\/cdn\/shop\/products\/H81116e96ee4b46caa9583036d3e248222.jpg?v=1631816752","width":1000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":"\u003cp\u003e\u003cspan data-mce-fragment=\"1\"\u003eArduino Vibration Switch Module KY-002 Keyes allows detection of shock and vibration. The KY-002 Vibration Switch Module consists of a conductive vibration spring and a 10k resistor, it will react to shock and vibration by closing the circuit.\u003c\/span\u003e\u003c\/p\u003e\n\u003ch3\u003e\u003cspan data-mce-fragment=\"1\"\u003eSpecifications:\u003c\/span\u003e\u003c\/h3\u003e\n\u003cul\u003e\n\u003cli\u003eOperating Voltage: 5V\u003c\/li\u003e\n\u003cli\u003eDimensions 18.5mm x 15mm [0.728in x 0.591in]\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003ch3\u003eConnection Diagram\u003c\/h3\u003e\n\u003cdiv class=\"siteorigin-widget-tinymce textwidget\"\u003e\n\u003cp\u003eConnect the Power line (middle) and ground (-) to +5 and GND respectively. Connect signal (S) to pin 3 on the Arduino.\u003c\/p\u003e\n\u003cp\u003e\u003cimg alt=\"\" src=\"https:\/\/cdn.shopify.com\/s\/files\/1\/0014\/4313\/5560\/files\/Arduino_KY-002_Keyes_Vibration_switch_module_connection-diagram_600x600.png?v=1631817199\"\u003e\u003c\/p\u003e\n\u003ch3 class=\"widget-title\"\u003eExample Code\u003c\/h3\u003e\n\u003cdiv class=\"siteorigin-widget-tinymce textwidget\"\u003e\n\u003cp\u003eThe following Arduino sketch produces a shock flasher. Pin 13 (LED) on the Arduino will flash when KY-002 detects movement. Pin 3 is used as input from KY-002.\u003c\/p\u003e\n\u003cpre class=\"line-numbers language-arduino\"\u003e\u003ccode class=\"language-arduino\"\u003e\u003cspan class=\"token keyword\"\u003eint\u003c\/span\u003e Led \u003cspan class=\"token operator\"\u003e=\u003c\/span\u003e \u003cspan class=\"token number\"\u003e13\u003c\/span\u003e\u003cspan class=\"token punctuation\"\u003e;\u003c\/span\u003e\u003cspan spellcheck=\"true\" class=\"token comment\"\u003e \/\/ define the LED Pin\n\u003c\/span\u003e\u003cspan class=\"token keyword\"\u003eint\u003c\/span\u003e shock \u003cspan class=\"token operator\"\u003e=\u003c\/span\u003e \u003cspan class=\"token number\"\u003e3\u003c\/span\u003e\u003cspan spellcheck=\"true\" class=\"token comment\"\u003e \/\/ define the sensor Pin \n\u003c\/span\u003e\u003cspan class=\"token keyword\"\u003eint\u003c\/span\u003e val\u003cspan class=\"token punctuation\"\u003e;\u003c\/span\u003e\u003cspan spellcheck=\"true\" class=\"token comment\"\u003e \/\/ define a numeric variable val \n\u003c\/span\u003e\n\u003cspan class=\"token keyword\"\u003evoid\u003c\/span\u003e \u003cspan class=\"token important\"\u003esetup\u003c\/span\u003e \u003cspan class=\"token punctuation\"\u003e(\u003c\/span\u003e\u003cspan class=\"token punctuation\"\u003e)\u003c\/span\u003e \u003cspan class=\"token punctuation\"\u003e{\u003c\/span\u003e\n\t\u003cspan class=\"token selector\"\u003epinMode\u003c\/span\u003e \u003cspan class=\"token punctuation\"\u003e(\u003c\/span\u003eLed\u003cspan class=\"token punctuation\"\u003e,\u003c\/span\u003e \u003cspan class=\"token boolean\"\u003eOUTPUT\u003c\/span\u003e\u003cspan class=\"token punctuation\"\u003e)\u003c\/span\u003e\u003cspan class=\"token punctuation\"\u003e;\u003c\/span\u003e\u003cspan spellcheck=\"true\" class=\"token comment\"\u003e \/\/ LED pin as output \n\u003c\/span\u003e\t\u003cspan class=\"token selector\"\u003epinMode\u003c\/span\u003e \u003cspan class=\"token punctuation\"\u003e(\u003c\/span\u003eshock\u003cspan class=\"token punctuation\"\u003e,\u003c\/span\u003e \u003cspan class=\"token boolean\"\u003eINPUT\u003c\/span\u003e\u003cspan class=\"token punctuation\"\u003e)\u003c\/span\u003e\u003cspan class=\"token punctuation\"\u003e;\u003c\/span\u003e\u003cspan spellcheck=\"true\" class=\"token comment\"\u003e \/\/ input from KY-002 sensor\n\u003c\/span\u003e\u003cspan class=\"token punctuation\"\u003e}\u003c\/span\u003e \n\n\u003cspan class=\"token keyword\"\u003evoid\u003c\/span\u003e \u003cspan class=\"token important\"\u003eloop\u003c\/span\u003e \u003cspan class=\"token punctuation\"\u003e(\u003c\/span\u003e\u003cspan class=\"token punctuation\"\u003e)\u003c\/span\u003e \u003cspan class=\"token punctuation\"\u003e{\u003c\/span\u003e\n\tval \u003cspan class=\"token operator\"\u003e=\u003c\/span\u003e \u003cspan class=\"token selector\"\u003edigitalRead\u003c\/span\u003e \u003cspan class=\"token punctuation\"\u003e(\u003c\/span\u003eshock\u003cspan class=\"token punctuation\"\u003e)\u003c\/span\u003e\u003cspan class=\"token punctuation\"\u003e;\u003c\/span\u003e\u003cspan spellcheck=\"true\" class=\"token comment\"\u003e \/\/ read the value from KY-002\n\u003c\/span\u003e\t\u003cspan class=\"token keyword\"\u003eif\u003c\/span\u003e \u003cspan class=\"token punctuation\"\u003e(\u003c\/span\u003eval \u003cspan class=\"token operator\"\u003e==\u003c\/span\u003e \u003cspan class=\"token boolean\"\u003eHIGH\u003c\/span\u003e \u003cspan class=\"token punctuation\"\u003e)\u003c\/span\u003e \u003cspan spellcheck=\"true\" class=\"token comment\"\u003e{\/\/ when sensor detects shock, LED flashes \n\u003c\/span\u003e\t\t\u003cspan class=\"token selector\"\u003edigitalWrite\u003c\/span\u003e\u003cspan class=\"token punctuation\"\u003e(\u003c\/span\u003eLed\u003cspan class=\"token punctuation\"\u003e,\u003c\/span\u003e \u003cspan class=\"token boolean\"\u003eLOW\u003c\/span\u003e\u003cspan class=\"token punctuation\"\u003e)\u003c\/span\u003e\u003cspan class=\"token punctuation\"\u003e;\u003c\/span\u003e\n\t\u003cspan class=\"token punctuation\"\u003e}\u003c\/span\u003e \u003cspan class=\"token keyword\"\u003eelse\u003c\/span\u003e \u003cspan class=\"token punctuation\"\u003e{\u003c\/span\u003e\n\t\t\u003cspan class=\"token selector\"\u003edigitalWrite\u003c\/span\u003e \u003cspan class=\"token punctuation\"\u003e(\u003c\/span\u003eLed\u003cspan class=\"token punctuation\"\u003e,\u003c\/span\u003e \u003cspan class=\"token boolean\"\u003eHIGH\u003c\/span\u003e\u003cspan class=\"token punctuation\"\u003e)\u003c\/span\u003e\u003cspan class=\"token punctuation\"\u003e;\u003c\/span\u003e\n\t\u003cspan class=\"token punctuation\"\u003e}\u003c\/span\u003e\n\u003cspan class=\"token punctuation\"\u003e}\u003c\/span\u003e\u003c\/code\u003e\u003c\/pre\u003e\n\u003cp\u003e \u003cbr\u003e\u003c\/p\u003e\n\u003c\/div\u003e\n\u003c\/div\u003e"}
{
"product_id": 6631308689494,
"variant_id" : 39542522642518,
"variant_available" : false,
"inventory_quantity" : 0,
"inventory_management" : "shopify",
"inventory_policy" : "deny",
"image": "//thinkrobotics.com/cdn/shop/products/H81116e96ee4b46caa9583036d3e248222.jpg?v=1631816752",
"price": "6999",
"title": "Default Title",
"value": "Default Title"
}
India
---
Australia
Canada
India
Mexico
United States