https://www.keyestudio.com/free-shippingkeyestudio-vibration-sensor-module-for-arduino-p0155.html
What's the simplest way to check vibration with Aduino? Well, use a vibration sensor from keyestudio. You can directly plug it on our sensor Shield V5, vibrate this sensor, and Aduino can receive a digital signal, making it easy to make computation and programs in Aduino.
Despite its simplicity, you can make full use of it with creative thinking, step counting, and crash warning light etc.
IO Type: Digital
Supply Voltage: 3.3V to 5V
#define SensorLED 13
#define SensorINPUT 3 //Connect the sensor to digital Pin 3 which is Interrupts 1.
unsigned char state = 0;
void setup()
{
pinMode(SensorLED, OUTPUT);
pinMode(SensorINPUT, INPUT);
attachInterrupt(1, blink, FALLING);// Trigger the blink function when the falling edge is detected
}
void loop()
{ if(state!=0)
{
state = 0;
digitalWrite(SensorLED,HIGH);
delay(500);
}
else
digitalWrite(SensorLED,LOW);
}
void blink()//Interrupts function
{ state++;
}
See product video: https://youtu.be/x0Zhf5AnzK4