Maker Pro
Arduino

Simple Earthquake Detector with Vibration Sensor

November 04, 2022 by CIRCUITS DIY
Share
banner

In this Tutorial, We are Going To Make an Simple Earthquake Detector with Vibration Sensor & using ESP01

Earthquakes cause catastrophes. Not only does it destroy and harm places, but it also takes lives. Moreover, considering that we live in a time with numerous high-rise buildings, there is a higher probability they can get damaged in the earth quack events. Therefore, it is essential to take precautions. Thus, in this post, we'll explain how to create a Simple Earthquake Detector with Vibration Sensor & using ESP01


Because the absence of these sensors might result in significant damage, earthquake sensors are integrated into high-rise buildings. The high-rise buildings and other structures are protected from earthquake damage by the earthquake detection sensors, which detect long-period seismic motion.

Hardware Table

Schematic

Code

int BUZZER = 0;      // Digital Pin 0 define Buzzer interface
int VIBRATION = 2;   // Digital Pin 2 define vibration sensor interface
int VAL;             // Define the variable as VAL
void setup()
{
Serial.begin(9600);  
pinMode(BUZZER,OUTPUT); //The defined Output as Buzzer
pinMode(VIBRATION,INPUT); //The defined input as Vibration
}
void loop()
{
VAL=digitalRead(VIBRATION);
if(VAL==HIGH)        // If the sensor detects a vibration Buzzer will be HIGH
{
Serial.print("Vibration Detected : ");  
Serial.println(VAL);
digitalWrite(BUZZER,HIGH);
delay(1000); 
}
else
{
Serial.println(VAL);   
digitalWrite(BUZZER,LOW); //if detects no vibration Buzzer stay in LOW
}
}

Related Content

Categories

Comments


You May Also Like