Alberto Zanon
Published © GPL3+

Vibration Sensor Module

I will explain how connect Arduino with Vibration sensor and LED.

IntermediateFull instructions provided107,911
Vibration Sensor Module

Things used in this project

Hardware components

Vibration Sensor Module
×1
Male/Female Jumper Wires
Male/Female Jumper Wires
×3
LED (generic)
LED (generic)
×1
Arduino UNO
Arduino UNO
Or Arduino Mega
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Vibration Sensor Module

Code

Vibration Sensor Module (Code)

Arduino
int vib_pin=7;
int led_pin=13;
void setup() {
  pinMode(vib_pin,INPUT);
  pinMode(led_pin,OUTPUT);
}

void loop() {
  int val;
  val=digitalRead(vib_pin);
  if(val==1)
  {
    digitalWrite(led_pin,HIGH);
    delay(1000);
    digitalWrite(led_pin,LOW);
    delay(1000);
   }
   else
   digitalWrite(led_pin,LOW);
}

Credits

Alberto Zanon

Alberto Zanon

1 project • 12 followers
I create projects with Arduino and Raspberry Pi. Recently I have made two application for business.

Comments