Devices & Components
Arduino Uno Rev3
USB Cable for Arduino UNO
jumper wires for arduino
Grove - Vibration Sensor (SW-420)
HC-05 Bluetooth Module
9V Battery Supply
Hardware & Tools
Proteus Circuit Simulator
Android Smartphone
Software & Tools
MIT App Inventor 2
Proteus 8
Arduino IDE
Project description
Code
Vibration Detection System using Arduino
cpp
Code
1#include <SoftwareSerial.h> 2 3// Create SoftwareSerial on pins 10 (RX), 11 (TX) 4SoftwareSerial bluetooth(10, 11); // RX, TX 5 6const int vibrationPin = 2; // Vibration sensor connected to D2 7const int buzzerPin = 8; // Buzzer connected to D8 8 9bool vibrationDetected = false; // To track state 10 11void setup() { 12 pinMode(vibrationPin, INPUT); 13 pinMode(buzzerPin, OUTPUT); 14 15 Serial.begin(9600); // Serial Monitor 16 bluetooth.begin(9600); // HC-05 Bluetooth module 17 18 19} 20 21void loop() { 22 int sensorValue = digitalRead(vibrationPin); 23 24 if (sensorValue == HIGH && !vibrationDetected) { 25 vibrationDetected = true; 26 digitalWrite(buzzerPin, HIGH); 27 Serial.println("Vibration Detected"); 28 bluetooth.print("Vibration Detected\n"); 29 delay(500); 30 digitalWrite(buzzerPin, LOW); 31 delay(500); 32 } else if (sensorValue == LOW) { 33 vibrationDetected = false; // Reset state when no vibration 34 } 35 36 delay(200); // Small delay for stability 37}
Downloadable files
Vibration Detection System using Arduino, HC-05 & MIT App | Proteus + Real Hardware | Step-by-Step DIY
Learn how to build a smart Vibration Alert System
https://overalltechnicalgyan.com/vibration-alert-system-arduino-mit-app-inventor-35
Vibration Detection System using Arduino, HC-05 & MIT App | Proteus + Real Hardware | Step-by-Step DIY
Download Arduino Code + MIT App (.aia + APK)
vibration_alert_system.zip
Comments
Only logged in users can leave comments