Inspiration

About 46 large earthquakes happen every single year around the world, and tons of tiny earthquakes happen almost every single hour. Earthquakes have taken around 750 thousand lives in recent decades, accounting for over 50% of the total lives taken by natural disasters. Around 125 million more people have been impacted with brutal injuries, the loss of housing, and sometimes the loss of family/friends. And, what makes this worse, is that earthquakes isolate that specific area from the rest of the world. This means that the people who survived must immediately start rescuing those who fell victim to this natural disaster. Diverging from human lives, earthquakes also lead to the destruction of many buildings. A strong example of this is the Turkey–Syria earthquakes, which led to the collapse of 84,000 buildings. This displaces millions of people and sets the countries back YEARS in economic and technological progress. In the area where I live, earthquakes are happening all the time. For example, the place that I live in faces over 1500 micro-quakes every single year. Living so close to the San Andreas fault, it makes it very necessary to have proper protection against earthquakes. And, what is most surprising, is that despite all of the damage that earthquakes do, they still remain a very overlooked aspect of the world.

When I looked at the tools people actually have, I noticed big gaps. Most earthquake apps only show a map or send an alert, and then they stop. They don't do anything physical to make a home safer, they don't tell you whether your building is safe to go back into, and they don't explain their answers. Checking a building after an earthquake is still mostly done by inspectors walking through it one by one, which can take days or weeks, while families and businesses wait outside. Professional structural monitoring systems exist, but they are expensive and built for skyscrapers and bridges, not for normal homes and schools.

Hence, I wanted to solve this problem by providing users with an all-in-one, AI-powered system that limits the effect that earthquakes have on society. It automatically calls 911 when it senses danger to account for the isolation that occurs, it physically shuts off dangerous utilities, and it uses machine learning and physics-based models to judge whether buildings are structurally safe after earthquakes to ensure that no further lives are lost. Earthquakes are a major problem in California, where they regularly strike near communities like Fortuna, CA. Locally, earthquakes are a major problem, and it would be really useful to solve the harm that these natural disasters do to our community.

What it does

My app is a native iOS app that is an advanced earthquake detection and safety platform combining low-cost physical hardware, real-world data, 3D simulation, and artificial intelligence. It helps users detect earthquakes, take automatic safety actions, understand their effects on buildings, monitor earthquake activity, and make informed safety decisions. AI is used throughout the app: machine learning models correct sensor readings and flag unusual behavior, a probabilistic reasoning engine estimates building damage with a confidence level, AI search agents gather real-world building and earthquake information, and a large language model explains every result in plain language.

Detection and automatic safety actions: The Arduino Mega is connected to an accelerometer, motion sensor, sound sensor, and stepper motor. The three sensors detect unusual shaking and movement and send information to the Arduino, where a sensor-fusion algorithm decides whether the shaking is a real earthquake. Most detectors rely on a single accelerometer, so a slammed door or a dropped box can set them off. Seismic requires two out of three different sensors to agree, which cuts down on false alarms. When an earthquake is detected, the Arduino activates the stepper motor, which rotates to symbolize shutting off water and electricity. I chose these utilities because electrical systems can become especially dangerous when water is present, creating additional hazards during earthquakes. Something most systems never do is check that the safety action actually worked. Seismic uses a photoresistor watching the power indicator to confirm that the power really turned off, and reports that confirmation to the phone.

Building safety assessment: The 3D simulation demonstrates how a building could respond to earthquake forces. Building movement is exaggerated by 40 times so users can clearly see potential damage. Information such as building height, weight, and construction material is entered into a complex physics and mathematics calculator that determines how the structure should respond. The app then combines the simulation with its AI assessment engine to calculate an estimated damage percentage and determine whether the building may be safe to re-enter. Instead of a plain "safe" or "unsafe," Seismic gives a confidence level and explains which evidence led to its answer. This gives people a fast first assessment while they wait for an inspector, instead of having nothing at all. Additional calculations occur in the background, while a settings toggle allows users to view detailed numerical information.

Map: The Map feature uses APIs including Tavily, Serper, OpenWeather, and Wikidata to gather real-world information. Tavily and Serper act as AI search tools that find and summarize the latest earthquake reports and building information. The app combines this information into a large interactive map containing earthquake statistics and historical activity for different locations. The map can also identify buildings damaged by recent earthquakes and provide an estimated probability of future earthquake activity in an area using USGS aftershock forecast models. Most earthquake maps only show where shaking happened; Seismic also shows what it means for buildings and what might come next.

Home: The Home page summarizes information from other sections into clean, customizable widgets. Users can reorganize these widgets based on the information they want to see first.

Network: The Network feature allows multiple hardware systems to communicate across a city, state, or potentially an entire country. When one system detects an earthquake, it can notify other connected households within the affected area. This turns separate devices into a community warning network, which normally needs expensive government-run sensor systems.

Feed: The Feed provides a continuously updating tracker of earthquakes around the world, allowing users to monitor global seismic activity in real time.

Library: The Library allows users to import real-world buildings into the simulator. AI search APIs look up information about the building and provide statistics that can be entered into the physics simulation, so users don't need to be engineers or know their building's specifications to test it.

Settings: The Settings tab allows users to customize the app's background, haptics, and voice features. It also provides detailed explanations of the calculations, algorithms, and AI models used throughout the application. Most AI apps are a black box; Seismic shows its work.

The app supports Apple Login, Google Login, and traditional username-and-password authentication.

What makes Seismic different

It takes action, not just sends alerts: It shuts off utilities automatically and then verifies with a sensor that the shutoff actually happened.

It answers "is my building safe?": It gives a fast AI damage estimate with a confidence level, instead of leaving people waiting outside for days for an inspection.

It avoids false alarms: Two-out-of-three sensor voting stops single-sensor glitches, and a machine learning temperature model stops normal hot and cold days from being mistaken for damage.

It explains itself: Every result comes with plots, the evidence behind it, and a plain-language explanation from a large language model.

It is low-cost: It uses an Arduino and common sensors instead of the expensive professional monitoring systems usually only used on skyscrapers and bridges.

It connects neighbors: Devices warn each other across a community.

It works without setup: Built-in demo data lets the whole app run without API keys or an internet connection.

It lets you hear your building: The simulator turns a building's vibration into sound by shifting its natural frequencies up six octaves, a feature I haven't seen in other earthquake apps.

How we built it

I have designed and coded the Seismic iOS app in Swift, SwiftUI, and Swift Package as a cross-cutting platform that unifies seismic-hazard detection, structural health monitoring, geospatial analysis, embedded systems, machine learning, and three-dimensional simulation in a single engineering platform. The application is organized as seven distinct software modules called SeismicCore, SeismicSignal, SeismicGeo, SeismicStructures, SeismicDevice, SeismicData, and SeismicServices. Each module implements particular functions ranging from mathematical, signal-processing, and machine learning algorithms to structural analysis, device communication, data storage, and third-party services messaging. The overall design is aimed to decouple the algorithmic code from the application logic so that any algorithm could be validated in isolation without launching the iOS simulator.

I have designed a seismic signal-processing pipeline that implements a set of industry-standard algorithms. These include waveform conditioning, event detection based on short-term average/long-term average thresholding, matched filtering, power spectral density estimation with Welch's method, spectral peak picking, Hilbert envelope analysis, damping estimation, and response spectrum calculation. These are the same kinds of methods professional seismologists use, packed into a phone app. This pipeline also acts as the feature-extraction stage for the app's machine learning models: it turns raw vibration recordings into clean numbers, such as natural periods, damping and peak shaking, that the models learn from. The pipeline plots the spectrogram that visualizes the time-varying spectral content and illustrates the peaks' prominence to extract the most prominent modes. In addition, three different natural period estimation approaches are implemented, and comparing them side by side makes the result more reliable than trusting a single method. All calculations are visualized in plots that help the user understand the process's logic and see the data that influence the outcome.

To support structural health monitoring, I have implemented a pipeline that estimates temporal trends of the structure's natural period, residual displacement, and tilt. A common problem in structural monitoring is that temperature changes a building's vibration frequency, which can look like damage. To fix this, a building-specific temperature-frequency regression model is trained for each building, so the app learns how that particular building normally behaves and removes the temperature effect. To mitigate the effect of outliers, a robust regression with outlier detection is applied to the same data sets, which works as an anomaly detector that flags readings that don't fit the building's learned behavior. To combine the trends and provide an overall assessment of structural performance, I have designed an evidence-based reasoning engine that utilizes multiple evidence sources and applies different weights and textual annotations to the outcomes of each process step. This engine generates a structural assessment and produces a confidence interval as an estimate of certainty about the structural performance. Furthermore, I have implemented a Coordinate Modal Assurance Criterion analysis that compares the structural characteristics in two different states and designed a structural response-analysis engine that evaluates the structure's seismic response.

I have designed and coded an interactive three-dimensional building simulator that utilizes the building description and historic seismic trace to visualize the impact of ground shaking on the structure. The application allows the user to select a building of interest and explore the building's description, analyze the seismic response, and compare the simulation traces. The simulator includes a visualization of the vibration modes, response spectra with a building-specific natural period, comparison of building frequencies, animated spectrogram, and audio version of the seismic trace with natural periods shifted up by six octaves to hear the fundamental tones.

I have built an Arduino MEGA 2560 sensor node that communicates with the iOS application over Bluetooth Low Energy using a custom protocol. The sensor node is designed to monitor ground shaking, tilt, sound, temperature, and occupancy with multiple sensors. The node implements a multi-sensor fusion algorithm that uses a two-out-of-three voting scheme, provides real-time telemetry, countdown visualization, audible alerts, transistor-controlled power relays, and a stepper motor driver for a water-main shut-off valve. The node records audio and motion data with an MPU6050, senses tilt, sound, temperature, and occupancy, and transmits this information to the iOS app over Bluetooth serial lines using a custom protocol. The communication protocol uses newline-delimited JSON, and messages are protected by a checksum, so corrupted data is caught instead of silently trusted. Furthermore, the node utilizes a chunked recording approach with selective chunk retransmission upon request, so if part of an earthquake recording is lost over Bluetooth, only the missing piece is resent instead of losing the whole recording. The power-down state is monitored with a photoresistor to ensure that the power indicator switch is activated.

I have designed the geospatial module for earthquake mapping, network analysis, geometry operations, and source localization. The application utilizes USGS earthquake data, including aftershock forecasts, OpenStreetMap mapping data, and building data from Wikidata services. The network-inversion tools are implemented to localize earthquakes based on sensor data and illustrate the relative location of the earthquake and the sensor network. In addition, the application stores historical earthquake information, building data, and synthetic sensor data to provide an overview of the system's capabilities when launched for the first time.

I have designed the system with persistent data storage, tamper-evident measurement logging, configurable API tokens for third-party services, an AI-powered analysis module, and a deterministic on-device narration system. The tamper-evident log means recorded measurements can't be quietly changed later, which makes the data trustworthy if it is ever shared with inspectors or insurance. The user interface is unified around a Live Activity and Dynamic Island countdown, real-time sensor visualization, community earthquake map, structural-health assessment panel, and automated walkthrough upon launch. I have written nine hundred and sixty-six tests across seven software modules to validate the correct operation of algorithms, interfaces, numeric calculations, communication protocols, data storage, and network-client behavior. The tests help ensure the reliability of each individual algorithm while building confidence in the overall design that ties together scientific computing, machine learning, embedded systems, and structural-engineering algorithms.

Also, as a side note, we did use Claude for debugging and writing the code when the calculations involved complex differential equations and matrix calculations. Apart from that, overall most of the work was mine!

AI Implementation

AI and machine learning power the main decisions in Seismic. Here is each part, what it does, and what it improves:

Machine learning regression (temperature compensation): Each building gets its own regression model that learns how its natural frequency changes with temperature. What it fixes: a hot or cold day is no longer mistaken for damage, which is one of the most common false alarms in structural monitoring.

Anomaly detection (robust regression with outlier detection): The app learns each building's normal behavior and flags readings that don't fit. What it fixes: sensor glitches and bad readings don't throw off the results, while real unusual changes still get noticed.

Probabilistic damage assessment (evidence-based reasoning engine): Instead of trusting one number, the engine combines several lines of evidence, such as natural-period shifts, residual displacement and tilt, gives each one a weight, and outputs a damage estimate with a confidence interval. What it improves: users see not just "safe" or "unsafe," but how sure the system is and why.

Large language model analysis: An AI-powered analysis module uses a large language model to turn the technical results (spectra, frequency shifts, confidence intervals) into clear, plain-language explanations and safety guidance. What it creates: expert-level analysis that anyone can understand, not just engineers.

AI search agents: Tavily and Serper are AI search APIs that find, filter and summarize real-world information, including recent earthquake reports, damaged buildings and building statistics, which feeds the map and the building simulator. What it improves: users can test real buildings without knowing their specifications.

Predictive modeling: The map uses USGS aftershock forecast models to estimate the probability of future earthquake activity in an area. What it adds: people can see the risk of what might come next, not just what already happened.

Sensor fusion and signal processing: STA/LTA detection, matched filtering, Welch power spectral density and spectral peak picking turn raw sensor data into the features the models use, and a two-out-of-three voting system on the Arduino decides when shaking is a real earthquake.

Together, these turn raw sensor readings into a decision: Is this an earthquake? Is this building safe? How sure are we?

Challenges we ran into

Overall, this project took a TON of continuous building, dedication, and tinkering to land upon a final result. Along the way, I faced MANY problems, and I will list the major ones here:

BLE Connection with Phone: I used Bluetooth Low Energy to connect my hardware with my phone. One of the main errors was that the data being sent was bugged with errors. I spent countless hours re-working the hardware because I believed that the issue was with the data being sent. However, the main problem was that the BLE kept cutting out some of the data because the numbers were too big to send. Hence, I had to use a system that would constantly rotate between sending data at rapid speeds. While this increased the tempo of the data being sent, it prevented data corruption and ensured stability. This is also what led me to add checksums and selective retransmission, so the app always knows if data arrived correctly.

Lag on Phone: This problem was created by the solution to the previous problem. As the cycle occurred with fast reiterations, the constant data in my phone made the app lag. I once remember keeping the app open for 30 seconds and watching my phone crash as it was overwhelmed with the data that the Arduino sent. To fix this, I created a "middle" stage in the process of the data transfer. I figured much of the lag was happening with the rendering of the graph and the translation of the numbers into human-readable text. Hence, I made a "storage" space where the iPhone would store the raw numbers of the data. It would then slowly take data from that storage and compress it into chunks, which would then be translated into the graph and the sentences/statistics of information.

Simulation Spatial Rendering: For the early stages of the simulation feature in my app, I continuously tested and compared the simulations with those in another project that I have made. I constantly noticed errors in the motion and the output data. What happened was an error in the rendering of the data, and hence the simulation was skewed. To fix this, I made a separate hidden simulation that used spatial linear averages and regression lines to calculate the average structural points of the building. After finding those important points, I incorporated their 3D coordinates and the vectors of the force, and then used differential equations to ensure that the simulation was rendered accurately.

Training Models on Limited Data: Machine learning models need data, but real earthquake damage data for a specific building is rare. To get around this, I used physics-based simulations and synthetic sensor data to test the models, and I used robust regression so that a few bad readings would not throw off what the models learned.

Accomplishments that we're proud of

One of my proudest achievements was evolving Seismic from an initial concept into a cohesive engineering platform that weaves together iOS-native development, embedded electronics, structural engineering, scientific computing, geospatial analysis, and artificial intelligence. Instead of an application that simply alerts the user to an earthquake, I designed an interconnected suite in which sensors detect seismic activity, the hardware takes and verifies safety actions, algorithms analyze measurements, machine learning models learn each building's normal behavior, a 3D simulator acts as a test bed, and an evidence-based assessment engine compiles findings about likely building damage. My proudest achievement was bringing together these disparate fields of engineering into a unified application that does what usually takes several separate tools, or isn't available to regular people at all.

Another achievement of which I am particularly proud was designing the application's scientific computing engine. Within Seismic, I implemented 74 algorithms for signal processing, machine learning, structural engineering, statistical analysis, geospatial computing, and mathematical modeling. These include STA/LTA-based earthquake detection, matched filtering, Welch power spectral density, spectral peak picking, Hilbert-envelope analysis, damping estimation, response-spectrum calculation, and COMAC analysis. In addition, I implemented three independent algorithms to estimate a building's natural vibration period. Rather than presenting the user with an unexplained number, I provided interactive visualizations that exposed the underlying waveforms, spectra, peaks, and calculations.

I am also incredibly proud of the contribution that I made to Seismic's AI-driven structural health monitoring system. Rather than use a naive approach that relied on a single metric, I designed an algorithm that used diverse lines of evidence to evaluate buildings. First, I implemented a machine learning temperature-frequency regression model that accounted for temperature-induced shifts in resonance frequencies. Second, I applied anomaly detection techniques to remove outliers. Third, I designed an evidence-based assessment algorithm that weighted natural-period shifts, residual displacement, and tilt meters. With this approach, I provided interactive explanations for every metric while estimating the likelihood of damage with a confidence interval. In doing so, I had to reconcile mathematical precision with real-world engineering intuition.

Another accomplishment that I made was designing the application's interactive 3D simulator. Within the application, I designed a system that allowed the user to load building models, query building information, select past earthquakes, and view the resulting response. In addition, I implemented visualizations of vibration modes, response spectra, animated spectrograms, and comparisons of natural frequencies. I also synthesized an audio representation of the building's vibrations by shifting its natural frequencies up six octaves while preserving amplitude ratios, so users can actually hear how a building responds. Finally, I tied together these disparate elements into a simulator that allowed the user to interact with the building model and grasp the connections between building response and earthquake physics.

I am also proud of the contribution that I made to the software-hardware integration that powers Seismic. In particular, I designed the sensor fusion logic that feeds into the application's AI analysis engine. Specifically, I fused together the data from an accelerometer, tilt switch, sound sensor, thermistor, photoresistor, and occupancy sensor in a custom sensor array. A microcontroller within an Arduino MEGA 2560 acted upon this information and communicated with the smartphone over Bluetooth Low Energy. In particular, I implemented a custom newline-delimited JSON-based protocol that allowed the smartphone to process sensor data, receive seismic recordings, send countdown information, provide alarms, manage power switching with transistors, and control stepper motors that emulate utility switches. Perhaps my most creative contribution to the system, however, was implementing photoresistor feedback to the smartphone in order to verify that the on/off state of the power indicator has changed. Most automatic systems assume their action worked; Seismic checks.

In addition to the application itself, I am also incredibly proud of the seven software modules that comprise it. These independent modules manage the core mathematics, signal processing, machine learning, geospatial analysis, structural health monitoring, device communication, persistence, and services that power the application. In addition to developing original algorithms, I also integrated USGS earthquake feeds and aftershock forecasts, OpenStreetMap maps and building information, AI search APIs, historical earthquake data, and local demonstrations. Finally, I designed the application to demonstrate its core capabilities without API keys or external service access by virtue of local data and demonstration data sets that populated the simulator at launch.

Finally, I am proud of the work that I did to implement the application's automated testing framework. The application's test suite contains 966 assertions across all seven modules. In addition to testing core algorithms, I also performed unit tests and visual assertions across the app's mathematical, signal-processing, machine learning, geospatial, structural health monitoring, data persistence, and device communication modules. Furthermore, I implemented automated demonstrations that tied together the building simulator, earthquake sequences, hardware telemetry, building response, and geospatial analysis. All in all, my contributions to Seismic went well beyond simply designing an application. By virtue of my work, I built an end-to-end engineering platform that touches upon diverse fields of mathematics, electronics, artificial intelligence, software development, and real-world earthquake preparedness.

What we learned

There were many things that I took away. Many of the items that I took away were technical, but some were also non-technical.

Technical: On this journey to making this project, I learned a lot about coding. When I say a lot, I mean a LOT. Although this seems pretty obvious, I learned the many wonders of coding native iOS apps, initializing a Google Sign-in, sending the live data from the app to servers on Supabase, and using the various APIs and learning about their functions. I also learned how machine learning works in a real system: how to turn raw sensor signals into features, how regression models learn a building's normal behavior, how to detect anomalies, and how to combine several uncertain pieces of evidence into one decision with a confidence level. I also learned how to use large language models and AI search APIs to make complex results understandable. Also, I learned how to do much more complex projects with the Arduino, including using capacitors, resistor chains, and displays to show information. Last but not least, another major technical item that I learned was how to establish reliable connections between the hardware and the software using BLE.

Non-Technical: I always thought that making an app was something simple. Something that could be done in hours. However, making this application took far longer than I expected, and it goes to show the true dedication that all the engineers around the world have. The true dedication that it takes to make all of these projects. Each application on the App Store was made by countless developers, each website on the internet was made by countless developers, and an OS or a computer itself was made by countless developers. Making hardware and software applications truly takes a next level of dedication from the human race. Additionally, I learned more about the statistics and physics of earthquakes. I spent a lot of time simply researching information about the effects of earthquakes and the causes of earthquakes. To make this app, I had to use many of my learnings about earthquakes, like the rhythmic frequencies, the structural integrity of buildings and many other calculations. I also learned that the best solutions come from finding what existing tools are missing, not just copying what already exists.

Overall, while making this project gave me many teachings about the technical side, it also gave me a lot of learning on the other side. In addition to learning more about coding, AI, and hardware, I also learned more about earthquakes and the effort that it takes to make applications. This truly was a beautiful learning experience for me and I would definitely do it again.

What's next for Seismic

Overall, though this application was complex, I still believe there is tons of room for improvement!

Smarter Earthquake Detection: Right now, earthquake detection uses signal processing and a two-out-of-three sensor vote. Next, I want to train an on-device machine learning classifier (with Core ML) that learns the difference between real earthquakes and everyday vibrations like doors slamming, footsteps, or trucks driving by, so false alarms drop even further.

AI Damage Localization: Right now, the app estimates whether a building is damaged. Next, I want it to find where the damage is. I am researching this with a random forest model that uses vibration sensors plus low-cost pressure sensors at a structure's supports to pinpoint damage locations, and I would like to bring that into Seismic.

Worldwide Accessibility: Right now, all the words and sentences of my application are in English. This is mainly because the API is only accurate in English and the built-in algorithms are only meant to work in English. If this application was meant to work for the entire world, I would need to ensure that there are multiple language features in the application. Large language models could help translate the app's safety explanations into many languages and native dialects so that this application is open to everyone around the world.

Hardware/Arduino Appearance: Right now, the Arduino side of the project looks like a jumble of wires. It is very hard to differentiate the connections and identify errors. If I had access to a 3D printer, I would CAD (computer-aided design) a container that could organize the position of the sensors, sort and position the wires to ensure easy connection readability, and protect the device from any external forces. If I ever want to monetize the hardware, I would have to ensure that it comes in a proper package and ensures a 100% success rate of wire connections and other sensor functions. Also, the Arduino currently remains connected to my MacBook. To ensure the Arduino's easy mobility, it must be connected to a battery that is preferably rechargeable. Also, the Arduino must send signals to the phone to recharge the battery whenever it feels that the power is low.

Hardware/Software Connection: As of right now, the connection between my Arduino and my iPhone is pretty weak. I would have to figure out a way to ensure that the connection between the two can remain strong throughout the whole house, and even maybe the neighborhood. Sometimes after shutting off my iPhone, the connection with the hardware disappears. This simply cannot happen, as that would mean that closing your phone completely destroys the Arduino's purpose. I would have to use devices apart from Bluetooth to ensure a long-range and stable connection.

UI/App Fixes: The functionality of the app works well, but other people might have other preferences and would sometimes consider the UI overwhelming. Hence, I believe I must clean up the UI a bit to ensure higher readability for the user.

Side Note

Unfortunately, my app is built on Native iOS through Xcode. This means that I don't have a working URL. However, to see it the website in action, please look at the uploaded video. Also, the screenshots of my application are in the additional info section in the document that I uploaded.

Built With

Share this project:

Updates

Submission history