Earthquake Vibration Detection

Introduction

This experiment demonstrates how to detect earthquake-like vibrations using a vibration sensor.

Vibration Sensor

Components Needed

Circuit Setup

  1. Connect the vibration sensor to the Arduino using digital pins for the signal.

The sensor detects vibrations and sends a signal to the Arduino whenever the threshold is exceeded.

Vibration Detection Circuit Setup

Code for Vibration Detection

Upload the following code to your Arduino to detect vibrations:


const int sensorPin = 2;  // Pin connected to the vibration sensor
int sensorValue;

void setup() {
  pinMode(sensorPin, INPUT);
  Serial.begin(9600);
}

void loop() {
  sensorValue = digitalRead(sensorPin);
  if (sensorValue == HIGH) {
    Serial.println("Vibration Detected!");
  }
  delay(500);
}
            

Explanation

The vibration sensor detects any movement or vibrations and sends a high signal to the Arduino when motion is detected.

Troubleshooting