Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Simple Earthquake Sensor Detection And Vibration Mode By Arduino Mega 2560
WhatsApp
Sr Karthiga
4y
9k
0
2
100
Article
earth.rar
Introduction
In my last article, I explained about
finding weather conditions using Arduino Mega 2560
. Now In this article, I will explain simple earthquake sensor detection and vibration mode with Arduino Mega 2560.
Parts Of Lists
Arduino
UNO/MEGA/PRO
1x Vibration Tilt Switch
1x LED
1x 220 k Resistor
1x 10k Resistor.
Connection
Connection from the Vibration Tilt Switch to Arduino Mega 2560:
Figure 1:
Vibration Tilt Switch
Sensor Board
Vcc------->5V.
Gnd------->Gnd.
Din-------->02.
Connection From Led To ArduinoMega2560:
Postive pin(Dout)-------->13
Negative pin------->Gnd.
Programming
int
Din = 2;
int
Dout = 13;
int
LEDStatus = HIGH;
int
Reading;
int
Previous = LOW;
long
DTime = 0;
long
Dbounce = 50;
void
setup()
{
pinMode(Din, INPUT);
digitalWrite(Din, HIGH);
pinMode(Dout, OUTPUT);
}
void
loop()
{
int
ReadingState;
Reading = digitalRead(Din);
if
(Reading != Previous)
{
DTime = millis();
}
if
((millis() - DTime) > Dbounce)
{
ReadingState = Reading;
if
(ReadingState == HIGH) LEDStatus = LOW;
else
LEDStatus = HIGH;
}
digitalWrite(Dout, LEDStatus);
Previous = Reading;
}
Explanation
It will explain the earth level where we have a fix.
When an earthquake occurs, LED will ON.
When it does not occur, LED will OFF.
Output
Figure 2
Read more articles on
Arduino
:
Controlling Fan/LED Using Arduino Uno
Intel Edison Or Arduino Control Using Windows Azure Mobile Services
Arduino
Arduino Mega 2560
Earthquake Sensor Detection
Internet of Things
IoT
Up Next
Ebook Download
View all
Raspberry Pi -Sensorial Symphony of Connectivity
Read by 693 people
Download Now!
Learn
View all
Membership not found