Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO Based Vibration Detection System with Alert Indicators

View and Edit Project In Cirkit DesignerImage of Arduino UNO Based Vibration Detection System with Alert Indicators

Circuit Documentation

Summary

This circuit is designed around an Arduino UNO microcontroller and includes a 9V battery for power, a SW-420 vibration sensor for detecting vibrations, a red two-pin LED as an indicator, and a buzzer for audible alerts. The Arduino UNO reads the state of the vibration sensor and activates the LED and buzzer when vibrations are detected. The circuit is powered by the 9V battery connected to the Arduino's Vin pin, and the ground connections are shared among all components.

Component List

Arduino UNO

9V Battery

SW-420 Vibration Sensor

LED: Two Pin (red)

Buzzer

Wiring Details

Arduino UNO

9V Battery

SW-420 Vibration Sensor

LED: Two Pin (red)

Buzzer

Documented Code

// Define pins
const int vibrationPin = 2;  // Pin connected to the vibration sensor
const int ledPin = 13;       // Pin connected to an LED (optional)
const int buzzerPin = 9;     // Pin connected to the buzzer

void setup() {
  // Initialize the vibration sensor pin as input
  pinMode(vibrationPin, INPUT);
  
  // Initialize the LED pin as output (optional)
  pinMode(ledPin, OUTPUT);
  pinMode(buzzerPin, OUTPUT);
  
  // Start serial communication for debugging
  Serial.begin(9600);
}

void loop() {
  // Read the state of the vibration sensor
  int vibrationState = digitalRead(vibrationPin);
  
  // If vibration is detected
  if (vibrationState == HIGH) {
    // Turn on the LED (optional)
    digitalWrite(ledPin, HIGH);
    digitalWrite(buzzerPin, HIGH);
    
    // Print vibration detected to Serial Monitor
    Serial.println("Vibration detected!");
    delay(5000); // Delay to keep the LED and buzzer on for a period

  } else {
    // Turn off the LED (optional)
    digitalWrite(ledPin, LOW);
    digitalWrite(buzzerPin, LOW);
    // Print no vibration to Serial Monitor
    Serial.println("No vibration.");
  }
  
  // Small delay to avoid spamming Serial Monitor
  delay(500);
}

This code is designed to be uploaded to the Arduino UNO microcontroller. It initializes the necessary pins, reads the state of the vibration sensor, and activates the LED and buzzer when a vibration is detected. Serial communication is also established for debugging purposes.