Vibration Sensor Module — SW-18010P
$17.1
$20.69
This Vibration Sensor use the SW-18010P from MEC to measure the vibration.It can triggerd from any angle, and often used for flex, touch, vibration and shock measurements.There is an on-board potentiometer to adjust the threshold of vibration.It outputs logic HIGH when this module not triggered while logic Low when triggered.Application IdeaAutomobie alarm.Movement detection.Vibration detecting ApplicationsFeaturesThe default state of the switch is openDigital outputSupply voltage:3.3V-5VOn-board indicator LED to show the resultsOn-board LM393 chipDimension: 3.2cm x 1.4cmSW-18010P Vibration Sensor Module PinoutThis Module has 4 pins:VCC: Module power supply – 3.3V to 5VGND: GroundD0: Digital OutputA0: Analog OutputCodeUpload the following code to your ArduinoArduino /* SW-18010P-Vibration-Sensor-Module */ #define Dig_pin 7 int Dig_out = LOW; int Ana_out = 0; void setup() { Serial.begin(9600); } void loop() { Dig_out = digitalRead(Dig_pin); Ana_out = analogRead(A0); Serial.print("Anaolog : "); Serial.print(Ana_out); Serial.print(" Digital :"); Serial.println(Dig_out); delay(500); }123456789101112131415161718192021 /* SW-18010P-Vibration-Sensor-Module*/ #define Dig_pin 7int Dig_out = LOW;int Ana_out = 0; void setup() { Serial.begin(9600);} void loop() { Dig_out = digitalRead(Dig_pin); Ana_out = analogRead(A0); Serial.print(“Anaolog : ”); Serial.print(Ana_out); Serial.print(“ Digital :”); Serial.println(Dig_out); delay(500);}
Motion