EARTHQUAKE DETECTION SYSTEM 1. Introduction Earthquakes are natural disasters that cause the ground to shake. Sometimes, even small shakes can be dangerous if we don’t get alerts on time. To help detect shaking early, we can build a simple earthquake detection system using sensors and electronics. In this project, we use: • ADXL345 sensor → It senses movement and shaking. • ESP8266 WiFi module → Sends the readings to the internet. • LED & buzzer → Give alerts when shaking is detected. • ThingSpeak website → Shows the shaking levels on a graph. This system helps us understand how earthquake detection works in a basic way. 2. Objective The main goals of this project are: 1. To detect small vibrations or shaking using the ADXL345 sensor. 2. To alert using LED and buzzer when shaking increases. 3. To send shaking data (X - axis & Y - axis values) to the ThingSpeak cloud platform. 4. To show the shaking levels on a graph online. 5. To understand how sensors and IoT (Internet of Things) work. 3. Components Used Component Purpose ESP8266 (NodeMCU ) Controls the project & sends data to WiFi ADXL345 accelerometer sensor Detects shaking, tilt, and vibration LED Alerts visually during shaking 220Ω resistor Protects the LED Buzzer Sound alert for stronger shaking Wires / Breadboard For connecting everything Thing Speak account For graphing sensor data online 4 . Working Principle 1. The ADXL345 sensor measures movement on three axes: o X - axis (left - right tilt) o Y - axis (forward - back tilt) o Z - axis (up - down movement, includes gravity) 2. When the ground shakes: o X and Y values change quickly. o ESP8266 reads these values. 3. If the values become large: o The LED blinks o The buzzer beeps to give warning 4. The ESP8266 also sends the X and Y values to Thing Speak every 15 seconds. 5. Thing Speak displays these values as line graphs so we can see: o How much shaking happened o When the shaking happened 5 . Advantages • Simple and low - cost earthquake detector • Teaches real IoT and sensor concepts • Works in real time • Data stored online safely • Can be monitored from anywhere 6 . Applications • Used in schools for learning earthquake science • Can be used in homes to detect vibrations • Helps understand building safety • Used in IoT and STEM projects • For research on small vibrations 7 . Future Scope In future versions, we can: • Send SMS alerts on phones • Add battery backup • Detect building collapse or tilt • Use more accurate earthquake sensors • Connect to emergency systems 8 . Conclusion This earthquake detection project helps young students understand how sensors, electronics, and the internet work together. It shows how shaking can be detected and displayed on a website in real time. This project is a great introduction to IoT (Internet of Things) and can be improved for more advanced earthquake monitoring. Appendix Code : #include <ESP8266WiFi.h> #include <ESP8266HTTPClient.h> #include <Wire.h> #include <Adafruit_Sensor.h> #include <Adafruit_ADXL345_U.h> const char* ssid = "YOUR_WIFI_NAME"; const char* password = "YOUR_WIFI_PASSWORD"; const char* apiKey = "YOUR_THINGSPEAK_WRITE_API_KEY"; int ledPin = D5; int buzzerPin = D6; Adafruit_ADXL345_Unified accel = Adafruit_ADXL345_Unified(12345); unsigned long lastUpdate = 0; unsigned long updateDelay = 15000; // ThingSpeak minimum 15 seconds void setup() { Serial.begin(115200); WiFi.begin(ssid, password); pinMode(ledPin, OUTPUT); pinMode(buzzerPin, OUTPUT); digitalWrite(ledPin, LOW); digitalWrite(buzzerPin, LOW); Wire.begin(D2, D1); if (!accel.begin()) { Serial.println("ADXL345 not detected!"); while (1); } accel.setRange(ADXL345_RANGE_4_G); Serial.print("Connecting to WiFi"); while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } Serial.println(" \ nConnected!"); } void loop() { sensors_event_t event; accel.getEvent(&event); float x = event.acceleration.x; float y = event.acceleration.y; Serial.printf("X: %.2f | Y: %.2f \ n", x, y); if (abs(x) > 5 || abs(y) > 5) { digitalWrite(ledPin, HIGH); digitalWrite(buzzerPin, HIGH); } else { digitalWrite(ledPin, LOW); digitalWrite(buzzerPin, LOW); } if (millis() - lastUpdate > updateDelay) { sendToThingSpeak(x, y); lastUpdate = millis(); } delay(200); } void sendToThingSpeak(float x, float y) { if (WiFi.status() != WL_CONNECTED) return; HTTPClient http; String url = "http://api.thingspeak.com/update?api_key=" + String(apiKey); url += "&field1=" + String(x, 2); // X - axis url += "&field2=" + String(y, 2); // Y - axis http.begin(url); int httpCode = http.GET(); if (httpCode > 0) { Serial.print("ThingSpeak Response: "); Serial.println(http.getString()); } else { Serial.println("Error sending data."); } http.end(); }