Ec Project REP
Ec Project REP
(Wah Campus)
PROJECT Report
Earthquake Detector Alarm with Seismic
Graph Plotter
INTRODUCTION
In this project, we will design Arduino Earthquake Detector Alarm with Seismic Graph. We will used ADXL335
3 axis Accelerometer as a sensor for detecting tilting, trembling, or any shaking movement of an earthquake.
We will an interface ADXL335 Accelerometer with Arduino and LCD display for designing Arduino Earthquake
Detector Alarm with Seismic Graph.
COMPONENTS
one for Arduino to detect an earthquake and another for Processing IDE to plot the earthquake vibrations
over the graph on Computer.
The most commonly used device is the piezoelectric accelerometer. As the name suggests, it uses the
principle of piezoelectric effect. The device consists of a piezoelectric quartz crystal on which an accelerative
force, whose value is to be measured, is applied.
Due to the special self-generating property, the crystal produces a voltage that is proportional to the
accelerative force. This voltage signal is then read by microcontroller to draw graph and detect earthquake.
Project
Processing IDE GRAPH
ARDUINO CODE
#include <LiquidCrystal_I2C.h>
#include<Wire.h>
/*variables*/
int xsample=0;
int ysample=0;
int zsample=0;
long start;
int buz=0;
/*Macros*/
#define samples 50
#define maxVal 2 // max change limit
#define minVal -2 // min change limit
#define buzTime 5000 // buzzer on time
void setup()
{
lcd.begin(); //initializing lcd
Serial.begin(9600); // initializing serial
delay(1000);
lcd.print("EarthQuake ");
lcd.setCursor(0,1);
lcd.print("Detector ");
delay(2000);
lcd.clear();
lcd.print("BY");
delay(500);
lcd.clear();
lcd.print("Muhammad Hamad");
delay(1000);
lcd.setCursor(0,1);
lcd.print("Omar Shafique");
delay(1500);
lcd.clear();
lcd.print("Munim Ijaz");
delay(1000);
lcd.setCursor(0,1);
lcd.print("Muhammad Wasif");
delay(1500);
lcd.clear();
lcd.print(" CALIBRATING");
delay(500);
lcd.clear();
lcd.print(" CALIBRATING.");
delay(500);
lcd.clear();
lcd.print(" CALIBRATING..");
delay(500);
lcd.clear();
lcd.print(" CALIBRATING...");
delay(500);
pinMode(buzzer, OUTPUT);
pinMode(led, OUTPUT);
buz=0;
digitalWrite(buzzer, buz);
digitalWrite(led, buz);
for(int i=0;i<samples;i++) // taking samples for calibration
{
xsample+=analogRead(x);
ysample+=analogRead(y);
zsample+=analogRead(z);
}
delay(450);
lcd.clear();
lcd.print("Device Ready!");
delay(2000);
lcd.clear();
lcd.print("X Y Z");
}
void loop()
{
int value1=analogRead(x); // reading x out
int value2=analogRead(y); //reading y out
int value3=analogRead(z); //reading z out
else
{
lcd.clear();
lcd.print("X Y Z ");
}