int OUTPUT_LED = 10; //Digital Pin 10 define LED interface int VIBRATION = 3; //Digital Pin 3 define vibration sensor interface int VAL; // Define the variable as VAL int BLINK; void setup() { pinMode(OUTPUT_LED,OUTPUT); //The defined Output as LED pinMode(VIBRATION,INPUT); //The defined input as Vibration } void loop() { VAL=digitalRead(VIBRATION); if(VAL==HIGH) // If the sensor detects a vibration digital pin 10 will be HIGH note! you can change whatever output you want { digitalWrite(OUTPUT_LED,BLINK); //if detects vibration LED BLINK } else { digitalWrite(OUTPUT_LED,HIGH); } }