The problem
The IoT-Based Earthquake Detection System with Accelerometer and Early Warning Alerts using ESP32 is a building-mounted sensor node that listens for the sudden ground vibration of an earthquake and raises an alarm within seconds. Earthquakes strike without warning, and in a classroom, hostel or small office the seconds between feeling the first tremor and the stronger shaking that follows are often lost because nobody is watching for them. Existing low-cost warning options are usually either slow slope-monitoring systems that track gradual tilt creep over days, or phone apps that depend on a distant seismic network. This project fills the gap with a single self-contained node: a MEMS accelerometer fixed to the building structure, an ESP32 that judges each vibration as it arrives, a buzzer and LED strobe for everyone in the room, and GSM text alerts for people elsewhere. It is an academic prototype that demonstrates seismic sensing, embedded trigger logic and multi-channel alerting, not a certified warning system.
Accelerometer on the building measures ground motion.
Follow the working sequence
How it works
End to end, the system turns ground motion into an alarm in six stages. The MPU-6050 is fixed rigidly to the building or model base so it moves with the structure, and its tiny internal mass-on-springs shifts whenever the ground accelerates, changing capacitance that the chip converts into three-axis acceleration readings. The ESP32 samples those readings, keeps a running background level, and watches for a sudden rise that matches the fast P-wave arrival of a tremor. When the rise is confirmed over a short window, the node fires the buzzer and LED strobe, sends SMS alerts through the SIM800L, and records the event with a timestamp and an approximate magnitude estimate to the cloud log. A test button replays the whole chain on demand without waiting for a real tremor.
- The MPU-6050 module is mounted rigidly on the building structure or model base and wired to the ESP32 over I2C; on power-up the firmware records a resting baseline for all three axes.
- The ESP32 samples three-axis acceleration continuously (design target: 100 samples per second) and maintains a long-term background average of vibration. Builder note from the demo build: with the MPU-6050 set to the ±2g range, a firm tap on the bench pushed the Z-axis reading clearly above its resting 1g baseline while X and Y stayed near zero, which is how the firmware tells a vertical jolt apart from a slow tilt.
- A short-term average is compared against the long-term background (STA/LTA-style trigger logic, design target); a sudden rise that persists across the confirmation window counts as a tremor onset.
- On a confirmed trigger the ESP32 drives the buzzer and flashes the red LED strobe for local warning, and latches the alarm state until it is reset.
- The SIM800L GSM module sends an SMS alert to each registered number with the event time and the approximate magnitude estimate, using AT commands over UART.
- The ESP32 uploads the event record (timestamp, peak acceleration, approximate magnitude estimate) over Wi-Fi to the cloud log, where the event history can be reviewed.
Tech stack:
- ESP32 development board
- MPU-6050 accelerometer · gyroscope module
- SIM800L GSM module
- Arduino IDE · C/C++ firmware
- I2C sensor interface
- ThingSpeak cloud event log
- SMS alerts via AT commands
- 5 V USB power · Li-ion backup
| Parameter | Value |
|---|---|
| Controller | ESP32, dual-core, 240 MHz (datasheet) |
| Accelerometer | MPU-6050, ±2g to ±16g programmable full-scale range (datasheet) |
| Gyroscope | MPU-6050, ±250 to ±2000 °/s programmable range (datasheet) |
| Sensor resolution | 16-bit ADC, 16384 LSB/g at ±2g range (datasheet) |
| Sensor interface | I2C, address 0x68 (datasheet) |
| GSM module | SIM800L, quad-band 850/900/1800/1900 MHz (datasheet) |
| GSM supply | 3.4 V to 4.4 V, typical 4.0 V, peak current up to 2 A (datasheet) |
| Sampling rate | 100 samples per second (design target) |
| Alert response | Under 2 seconds from confirmed trigger to buzzer and SMS (design target) |
| Local alert | Buzzer plus red LED strobe |
| Remote alert | SMS to registered numbers via SIM800L |
| Event log | Cloud record with timestamp, peak acceleration and approximate magnitude estimate |
| Power | 5 V USB adapter with 3.7 V Li-ion battery backup (design) |
| Mounting | Rigid fixing to building structure or model base (required for sensing) |
Project features
The system combines four capabilities that together make a complete early-warning demonstrator: sudden-vibration sensing, a two-stage trigger check, loud local alerting, and remote notification. The MPU-6050 accelerometer measures ground motion on three axes, the ESP32 compares short-term vibration against a longer-term background level so a single knock does not set it off, and once the trigger confirms, the buzzer and LED strobe fire immediately while the SIM800L sends SMS alerts to registered numbers and the event is logged to the cloud. A manual test button, adjustable sensitivity and a battery-backed supply round out a node that can be demonstrated on a bench, mounted on a building model, and explained end to end in a viva. The node is built around parts a student can source and wire on a bench, and every stage of the chain can be shown working during a demonstration.
- [Sudden-vibration trigger] The firmware compares a short-term average of acceleration against a longer-term background level (STA/LTA-style logic, design target), so a genuine tremor onset triggers the alarm while ordinary background vibration does not.
- [MPU-6050 three-axis sensing] The MEMS accelerometer measures ground motion on X, Y and Z axes with a programmable full-scale range of ±2g to ±16g and a gyroscope range of ±250 to ±2000 °/s (datasheet values), read over I2C at 16-bit resolution.
- [Buzzer and LED strobe alarm] On a confirmed trigger the node sounds a loud buzzer and flashes a red LED strobe, giving everyone in the room an immediate audible and visible warning.
- [GSM SMS alerts] The SIM800L module sends text alerts to registered phone numbers over the 2G GSM network, so people away from the building are warned even when Wi-Fi is down.
- [Cloud event log] Each triggered event is recorded to the cloud with a timestamp and an approximate magnitude estimate, labelled as a design-target estimate and never as a measured magnitude.
- [False-trigger filtering] A confirmation window requires the vibration to persist across successive samples before the alarm fires, so a single dropped object or door slam does not raise a false alarm.
- [Test mode and adjustable sensitivity] A push-button replays the full alarm-and-SMS chain on demand for demonstration, and the trigger threshold is adjustable in firmware for the mounting location.
What is included
- Working earthquake detection prototype (ESP32, MPU-6050, SIM800L, buzzer, LED strobe, building-model base)
- Complete firmware source code (Arduino IDE, C/C++)
- Circuit and wiring documentation with connection table
- Threshold-tuning and test-button demonstration procedure
- Cloud event-log setup guide
- Project report PDF (background, seismic-sensing theory, trigger logic, methodology, results)
- PPT presentation for final review
- Viva Q&A preparation document (MEMS sensing, P-wave and S-wave physics, STA/LTA logic, GSM alerts)
Limitations & prerequisites
- This is an academic prototype, not a certified earthquake early-warning system; it must never be presented as life-safety equipment.
- A single sensor node cannot locate an epicentre or measure true magnitude; the magnitude figure is an approximate design-target estimate from local peak acceleration only.
- Warning lead time depends on distance from the epicentre and is a design target only; no lead-time figure is claimed as measured.
- GSM alerts need a working 2G network, a valid SIM and balance; the cloud log needs Wi-Fi, though the local alarm and SMS work without it.
- Nearby machinery, heavy traffic or construction vibration can cause false triggers; the threshold must be tuned for the mounting location.
- The SIM800L needs a dedicated 4.0 V supply capable of 2 A peaks; powering it from the ESP32 board regulator causes resets.
- Detection depends on rigid mounting; a loosely fixed sensor measures its own movement, not the building's.
Frequently Asked Questions
Is this project suitable for a final-year project?
Yes — it suits final-year students in IoT & Embedded, Electronics & Telecommunication and Electrical Engineering, because it demonstrates MEMS accelerometer sensing, embedded trigger logic, GSM communication, Wi-Fi cloud logging and multi-channel alerting in one build, with clear viva theory in P-wave physics, STA/LTA detection and sensor interfacing.
How is this different from a landslide or tilt-monitoring system?
A landslide system watches slow change: it tracks gradual tilt creep against a stored baseline over days, using soil-moisture and rainfall data to judge slope stability, while this project watches for sudden vibration and triggers on a fast rise in acceleration within seconds. It has no soil-moisture sensing, rainfall counting, LoRa slope link or tilt-baseline monitoring at all.
Can it really warn before an earthquake arrives?
It cannot predict an earthquake, and no warning time is claimed as measured — the system only reacts once ground motion reaches the sensor. The physics it uses is real: fast P-waves travel roughly twice as fast as the slower, stronger S-waves, so a sensor close to the shaking can detect the P-wave first. Any lead time in this single-node prototype is a design target of seconds at most, and the system is an academic demonstrator, not a certified warning service.
Does it work without internet or Wi-Fi?
Yes — the core warning works without Wi-Fi, because the local buzzer and LED strobe need no network at all and SMS alerts travel over the GSM mobile network. That independence matters because the disruption that follows a tremor is exactly when a warning is needed most. Only the cloud event log needs Wi-Fi; if the network is unavailable, events are still announced locally and by SMS, and the log simply misses that entry.
What power supply is needed?
The ESP32 and sensor run from a 5 V USB adapter with a 3.7 V Li-ion battery as backup, while the SIM800L GSM module needs its own regulated supply because its datasheet specifies 3.4 V to 4.4 V, typically 4.0 V, with peak currents up to 2 A during transmission. It must not be powered from the ESP32 board regulator.
Can this project be customized?
Yes, realistic options include swapping the MPU-6050 for an ADXL345 accelerometer, adding more sensor nodes that report to one log, replacing SMS with Telegram or app push alerts, adding a small display for live acceleration readings, or extending the cloud log into a simple status page. Each option is quoted separately based on feasibility and timeline.
Components & software requirements
- ESP32 development board
- MPU-6050 accelerometer · gyroscope module
- SIM800L GSM module
- Arduino IDE · C/C++ firmware
- I2C sensor interface
- ThingSpeak cloud event log
- SMS alerts via AT commands
- 5 V USB power · Li-ion backup
Delivery information
Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.
Support terms
Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.
Download free synopsis (PDF)
Enter your name and WhatsApp number — the synopsis PDF downloads immediately. We may send occasional project updates on WhatsApp; no spam.