Inspiration
About 46 large earthquakes happen every year around the world, and thousands of smaller ones ripple through the Earth's crust every single day. Between 1998 and 2017, earthquakes killed nearly 750,000 people, more than half of all deaths caused by natural disasters in that period. Another 125 million people were affected in the same timeframe through brutal injuries, the loss of their homes, and sometimes the loss of family and friends. What makes this even worse is that earthquakes cut the affected area off from the rest of the world. Roads crack, cell towers go down, and emergency services are overwhelmed within minutes. That means the people who survive the shaking instantly become the first responders, and they have to start rescuing the people trapped around them immediately.
Beyond human lives, earthquakes destroy the buildings people depend on. The 2023 earthquakes in Turkey and Syria killed more than 55,000 people, and roughly 84,000 buildings collapsed or were left too damaged to save. That displaced millions of people and set both countries back YEARS in economic and technological progress. And most of those deaths didn't come from the ground moving. They came from buildings failing, and from people walking back into buildings that looked fine but weren't.
In the area where I live, the ground is never truly still. My area alone experiences over 1,500 micro-quakes every year. Living this close to the San Andreas Fault makes proper protection against earthquakes a necessity, not a luxury. What surprised me most when I started researching is that, despite all the damage earthquakes cause, they remain one of the most overlooked parts of home safety. Most homes have a smoke detector on every ceiling. Almost none have anything that can tell you whether your house just took structural damage.
So I set out to build an all-in-one system that limits the effect earthquakes have on society at every stage of the event: before, during, and after the shaking. It automatically calls 911 when it senses danger, to counter the isolation that follows a major quake, and it determines whether a building is structurally safe to re-enter afterward, so that no more lives are lost to the aftershock that brings down an already weakened wall. I kept coming back to one question: what would it take to give every household the kind of seismic monitoring that today only exists in skyscrapers, bridges, and government research networks? Seismic is my answer.
This problem isn't abstract for me. Earthquakes are a major threat across California, and as I apply for this challenge, an earthquake struck just this morning about 43 miles from Fortuna, CA. Locally, earthquakes are a constant problem, and reducing the harm these disasters do to our community is something I care about deeply.
What it does
Seismic is a native iOS app paired with a custom hardware sensor node that together form an advanced earthquake detection, response, and structural-safety platform. It combines physical sensing hardware, real-world data, physics-based 3D simulation, and a layered AI and machine-learning stack to help users detect earthquakes, respond automatically while the shaking is still happening, understand what those forces did to their building, monitor seismic activity around them, and make informed decisions about when it is safe to go back inside.
Seismic works as a closed loop: Sense → Decide → Act → Assess → Share. The hardware senses the shaking, an on-device detection pipeline decides whether it's a real earthquake or just a slammed door, the node acts by cutting utilities and starting the emergency countdown, the app assesses structural damage, and the network shares the event with every connected household nearby. Every stage feeds the next one, so the system gets smarter about a building the longer it watches it.
Hardware Node: The Arduino Mega 2560 is connected to an accelerometer, motion sensor, sound sensor, tilt switch, thermistor, photoresistor, and stepper motor. The sensors detect unusual shaking and movement and stream that information to the Arduino. 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 become especially dangerous when water is present, creating additional hazards during earthquakes. The node never trusts a single sensor. A detection only counts when at least two of three independent sensing channels agree (vibration, tilt, and sound), and that vote is then checked by a lightweight machine-learning classifier trained to tell real seismic waveforms apart from household noise like footsteps, slammed doors, washing machines, and dropped objects. In my bench testing, this two-stage design cut false triggers from roughly 1 in 9 household disturbances to fewer than 1 in 140. After the utilities are cut, a photoresistor watches the power indicator to physically confirm that the shutoff actually happened, instead of just assuming it did.
Automatic Emergency Response: When Seismic confirms a dangerous earthquake, it starts an emergency countdown on the iPhone's Dynamic Island, the Live Activity on the lock screen, and the hardware's display. If nobody cancels it, because the user is unresponsive or trapped, the app automatically calls 911. The cancel window means a false alarm never ties up emergency lines, while a real emergency never depends on someone being able to reach their phone.
3D Simulation: 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. Behind the visuals is a multi-degree-of-freedom shear-building model: every floor is treated as a mass connected to the floor below it by a spring and a damper, and the app solves the equations of motion step by step through a real recorded earthquake using Newmark-beta time integration. The peak interstory drift (how far each floor moves relative to the one beneath it) is mapped onto FEMA HAZUS-style fragility curves, which give the probability of slight, moderate, extensive, and complete damage. The app combines those into an estimated damage percentage and determines whether the building may be safe to re-enter, using the same green, yellow, and red tagging language that real post-earthquake building inspectors use. Because a full physics solve takes a moment, Seismic also runs a neural surrogate model, a small network I trained on 50,000 building-and-earthquake pairs generated by my own solver, which predicts the damage percentage in about 4 milliseconds. The user sees an instant estimate while the full physics calculations run in the background to confirm it, and the two agree within about 3% on buildings the model never saw during training. A settings toggle allows users to view all of the detailed numerical information.
Map: The Map feature uses APIs including Tavily, Serper, OpenWeather, and Wikidata to gather real-world information. It 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. Under the hood, the Map runs an AI-powered damage-intelligence pipeline. After an earthquake, Tavily and Serper pull live news and reports, a large language model running on Cerebras inference hardware extracts structured facts from the text (building name, damage type, severity, and location), Wikidata and OpenStreetMap match each report to a real building footprint, and duplicate reports are merged so that one collapse doesn't show up as five separate pins. Every pin carries a confidence score and a link to its source. The probability of future activity isn't a guess either: Seismic combines USGS aftershock forecasts with a Gutenberg-Richter model that it fits to the local earthquake catalog using maximum-likelihood estimation, then converts that rate into the probability of at least one quake above a chosen magnitude over the next day, week, or year.
Home: The Home page summarizes information from every other section into clean, customizable widgets. Users can reorganize these widgets based on the information they want to see first. Every widget updates live, so the Home page acts as a single command center for the building's health, the latest nearby quakes, the hardware's status, and the network around you.
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. Each node's alert carries a precise timestamp and its classifier's confidence score, so when several homes trigger at once, Seismic uses the differences in arrival time between nodes to estimate where the earthquake started, the same network-inversion idea that professional seismic networks use. It also uses that agreement between nodes to confirm that an event is regional rather than one noisy sensor. Alerts are routed in real time to the households inside the affected zone.
Feed: The Feed provides a continuously updating tracker of earthquakes around the world, allowing users to monitor global seismic activity in real time. Each event is enriched with its distance from the user and whether any connected Seismic node felt it.
Library: The Library allows users to import real-world buildings into the simulator. APIs search for information about the building and provide statistics that can be entered into the physics simulation. Importing a building launches an AI research agent: the language model plans a set of searches, reads the results, extracts height, number of floors, year built, structural system, and construction material into a strict data schema, and cross-checks every value against multiple sources. When a value can't be found (almost no building publishes its weight), a regression model estimates it from floor area, floor count, and material, and the field is clearly labeled as estimated. Tested against 60 buildings I checked by hand, the agent filled 92% of fields correctly.
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. Transparency was a core design principle: every number Seismic shows can be traced back to the exact algorithm that produced it.
Authentication: The app supports Apple Login, Google Login, and traditional username-and-password authentication, with user data synced securely to the cloud.
How Seismic compares to existing technology: Earthquake safety tools already exist, but each one solves only one slice of the problem. Seismic is the first system I could find that covers the entire event in one loop, from the first wave to the moment someone decides whether to walk back through their front door.
MyShake and ShakeAlert: The USGS ShakeAlert system and UC Berkeley's MyShake app are excellent, government-backed early-warning tools that can give people a few seconds of notice before shaking arrives, but they only cover California, Oregon, and Washington, and they only alert for quakes of roughly magnitude 4.5 and up. More importantly, their job ends at the warning. They don't shut off anything in your home, they don't call for help if you're trapped, and they can't tell you whether your building is safe once the shaking stops. Seismic picks up exactly where they leave off.
Android Earthquake Alerts: Google's system turns millions of Android phones into crowdsourced seismometers, which is a brilliant idea, but phones sitting in pockets, purses, and on tables are noisy sensors. During the 2023 Turkey earthquake, Google later admitted the system estimated the magnitude 7.8 quake at only about 4.5 to 4.9, and sent its highest-level "Take Action" alert to just 469 people, even though roughly 10 million people lived within 158 km of the epicenter. Seismic's node is a fixed sensor mounted to the structure itself, with three independent sensing channels, a voting system, and a trained classifier, so it never depends on where someone left their phone.
Seismic Gas Shutoff Valves: Automatic earthquake valves are required in many California jurisdictions and are a proven safety device, but they are purely mechanical. A ball drops when shaking reaches a threshold of around magnitude 5.2, it protects only one utility, and it sends no notification and records no data. Seismic controls both water and electricity electronically, physically verifies that the shutoff worked, logs the event, and tells your phone exactly what happened.
Post-Earthquake Building Inspections (ATC-20): After a major earthquake, trained inspectors walk through buildings and tag them green (inspected), yellow (restricted use), or red (unsafe). It's the gold standard, but after a large quake there can be tens of thousands of buildings and only a limited number of inspectors, so families can wait days or longer. Seismic gives a preliminary, data-backed assessment within minutes using the same green, yellow, and red language, and it can help decide which buildings inspectors should check first. It is designed to support licensed inspectors, not replace them.
Commercial Structural Health Monitoring: Professional monitoring systems run the same family of algorithms that Seismic uses (event detection, spectral analysis, modal comparison, and temperature compensation), but they are priced for skyscrapers and bridges. Installed systems in tall buildings have historically cost more than $5,000 per sensing channel, and one well-known bridge monitoring system cost about $1.3 million for 86 accelerometers. The Seismic node is built from roughly $85 of parts.
The Seismic Difference: No existing product I found does all of this together: detect the earthquake with fused sensors and machine learning, act by cutting utilities and calling for help, assess the building with physics and AI, and share the event with a whole network of homes. Seismic brings that full loop into a regular household, at a price a regular household can afford.
How we built it
I designed and coded the Seismic iOS app in Swift, SwiftUI, and Swift Package Manager 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 into seven distinct software modules: SeismicCore, SeismicSignal, SeismicGeo, SeismicStructures, SeismicDevice, SeismicData, and SeismicServices. Each module implements a particular set of functions, ranging from mathematical and signal-processing algorithms to structural analysis, device communication, data storage, and third-party service messaging. The overall design decouples the algorithmic code from the application logic so that any algorithm can be validated in isolation without launching the iOS simulator. The modules have a strict one-way dependency graph (SeismicCore depends on nothing, and the UI depends on everything), which kept a codebase this large from collapsing into spaghetti and let me swap or retrain any model without touching the rest of the app.
I 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 (STA/LTA) thresholding, matched filtering, power spectral density estimation with Welch's method, spectral peak picking, Hilbert envelope analysis, damping estimation, and response spectrum calculation. Raw accelerometer data is first detrended and band-pass filtered to remove sensor drift and electrical hum. The STA/LTA detector compares a 1-second short-term energy window against a 20-second long-term background window and fires when their ratio crosses an adaptive threshold that rises automatically in noisy environments. The pipeline plots a spectrogram that visualizes the time-varying spectral content and uses peak prominence to extract the most important vibration modes. Damping is estimated two independent ways: the half-power bandwidth of the spectral peak and the logarithmic decay of the Hilbert envelope. The response spectrum is computed by running hundreds of single-degree-of-freedom oscillators at 5% damping across periods from 0.05 to 10 seconds. In addition, three different natural-period estimation approaches are implemented (Welch spectral peak picking, autocorrelation of the free-vibration response, and the ASCE 7 empirical height formula) so that the results of each method can be compared side by side. All calculations are visualized in plots that help the user understand the logic behind each step and see the data that influences the outcome.
I built a dedicated machine-learning layer that sits on top of the signal pipeline. The first model is the on-device earthquake classifier. For every triggered window, Seismic extracts a 38-feature vector, including Welch band energies, dominant frequency, STA/LTA ratio, envelope rise time, kurtosis, zero-crossing rate, tilt change, sound energy, and motion-sensor occupancy, and feeds it into a gradient-boosted decision-tree model exported to Core ML. The model is only about 40 KB and runs in under a millisecond on the iPhone. I trained it on roughly 22,000 labeled two-second windows: real earthquake waveforms from the Stanford Earthquake Dataset (STEAD), resampled and rescaled to match my MPU6050 accelerometer, combined with more than 4,000 household-noise recordings I captured myself. To make it robust, I augmented the training data with injected sensor noise, random amplitude scaling, and time shifts. The second model is the neural damage surrogate, a three-layer neural network that takes building properties (height, floors, mass, material, damping, and natural period) along with ground-motion intensity measures (peak ground acceleration, peak ground velocity, and spectral acceleration at the building's fundamental period) and predicts the damage percentage. Because I trained it entirely on data generated by my own physics solver, it is effectively a physics-informed model: it inherits the physics, but runs about 400 times faster. The third is the regression model in the Library that estimates missing building properties like total mass.
To support structural health monitoring, I implemented a pipeline that tracks temporal trends in the structure's natural period, residual displacement, and tilt. When a building is damaged, it loses stiffness, so its natural period gets longer; tracking that period over time is one of the most powerful damage indicators in structural engineering. The challenge is that temperature does the same thing: a building's frequency can drift a few percent between a cold morning and a hot afternoon, which can look exactly like damage. To solve this, a building-specific temperature-frequency regression model is learned for each building, using the node's thermistor together with outdoor temperature from the OpenWeather API. To mitigate the effect of outliers, a robust regression with outlier detection is applied to the same data. To combine all of these trends into one overall assessment, I designed an evidence-based reasoning engine that works like a Bayesian evidence-fusion system. It starts from a prior damage probability supplied by the simulator's fragility curves, then updates that belief with each independent line of evidence (period shift, residual displacement, and tilt), applying different weights and plain-language annotations to every step. The engine produces a structural assessment along with a confidence interval computed by bootstrap resampling, so the user always knows how certain the system is. Furthermore, I implemented a Coordinate Modal Assurance Criterion (COMAC) analysis that compares the structure's mode shapes in two different states, before and after an event, to help pinpoint where a change occurred, and I designed a structural response-analysis engine that evaluates the structure's seismic response.
I designed and coded an interactive three-dimensional building simulator that uses the building description and historical seismic traces to visualize the impact of ground shaking on the structure. The user can select a building of interest, explore the building's description, analyze its seismic response, and compare simulation traces. The simulator includes visualizations of the vibration modes, response spectra marked with the building's natural period, comparisons of building frequencies, an animated spectrogram, and an audio version of the seismic trace with frequencies shifted up by six octaves so you can hear the building's fundamental tones. Buildings sway at frequencies far below human hearing, roughly 0.1 to 10 Hz, so shifting them up six octaves (multiplying every frequency by 64) brings them into the audible range: a building swaying at 1.2 Hz becomes a 77 Hz hum, and you can literally hear the pitch drop when a damaged building loses stiffness.
I 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, and it 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 samples motion data from the MPU6050 at 200 Hz into a circular buffer, so when an event triggers, Seismic captures not just the shaking but the seconds right before it. It also senses tilt, sound, temperature, and occupancy, and transmits this information to the iOS app using a custom protocol. The communication protocol uses newline-delimited JSON, and every message is protected by a checksum and a sequence number. Because Bluetooth Low Energy packets are tiny (only about 20 bytes of usable data by default), recordings are split into numbered chunks, and the app requests selective retransmission of only the chunks that arrived corrupted or missing. The power-down state is monitored with a photoresistor to verify that the power indicator actually switched off, giving the system closed-loop confirmation instead of blind trust.
I designed the geospatial module for earthquake mapping, network analysis, geometry operations, and source localization. The application uses USGS earthquake data, including aftershock forecasts, OpenStreetMap mapping data, and building data from Wikidata. The network-inversion tools localize earthquakes from sensor data by solving for the epicenter and origin time that best explain the arrival times at each node, using an iterative least-squares solver, and then illustrate the relative location of the earthquake and the sensor network. In tests on simulated six-node networks, the localizer placed the epicenter within a median of 2.7 km of the true location. Distances are computed on the curved Earth using the haversine formula, and nodes are grouped with geohashes so that alerts reach only the households inside the affected zone. In addition, the application stores historical earthquake information, building data, and synthetic sensor data, so it can show off its full capabilities the first time it is launched.
I designed the system with persistent data storage, tamper-evident measurement logging, configurable API tokens for third-party services, an optional AI-powered analysis module, and a deterministic on-device narration system. The measurement log is tamper-evident because every entry contains a SHA-256 hash of the entry before it, forming a hash chain; if anyone edits a single past reading, every hash after it breaks. The AI analysis module uses a large language model served on Cerebras inference hardware, chosen for its extremely fast responses, to explain results in plain language, and it is forced to answer in a strict JSON schema that the app validates before showing anything. I followed one rule throughout: AI where it helps, determinism where lives depend on it. The language model is never part of the alert path. Every safety-critical alert, countdown, and spoken warning comes from deterministic, fully tested code and on-device speech, so the system can never hallucinate during an emergency and keeps working even with no internet connection. 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 an automated walkthrough on launch. I wrote 966 tests across the seven software modules to validate algorithms, interfaces, numerical calculations, communication protocols, data storage, and network-client behavior. Many of the numerical tests are "golden" tests that compare my Swift implementations against reference outputs from Python's SciPy and NumPy libraries to within one part in a billion, and the communication protocol is fuzz-tested with deliberately corrupted packets. The tests make sure every individual algorithm is reliable 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, I did use Claude for debugging and for writing code where the calculations involved complex differential equations and matrix calculations. Apart from that, most of the work was my own!
Challenges we ran into
Overall, this project took a TON of building, dedication, and tinkering to land on 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 arriving on the phone was riddled with errors. I reworked the hardware again and again because I believed the issue was with the data being sent. However, the real problem was that BLE was cutting off part of each message because the messages were too big to send at once. BLE only carries about 20 bytes of usable data per packet by default, and my sensor readings were far larger than that. To fix it, I built a system that splits every message into small numbered chunks and sends them in rapid rotation. Each chunk carries a sequence number and a checksum, so the phone can detect exactly which pieces were lost or corrupted and ask the Arduino to resend only those. This increased the tempo of the data being sent, but it eliminated data corruption and made the connection stable, cutting packet loss from about 14% to under 0.1%.
Lag on Phone: This problem was created by the solution to the previous one. Because the chunks arrived in such fast cycles, the constant stream of data made the app lag. I remember keeping the app open for 30 seconds and watching my phone crash as it was overwhelmed by the data the Arduino sent. To fix this, I created a "middle" stage in the data transfer. I figured out that most of the lag came from rendering the graph and translating the numbers into human-readable text on every single packet. So I built a "storage" layer, a ring buffer where the iPhone stores the raw numbers off the main thread. The app then pulls data from that storage at a steady pace, compresses it into chunks, and only then turns it into the graph and the sentences and statistics on screen. For the graphs, I downsample thousands of points to only the ones that actually change the shape of the line, so the chart looks identical but draws a fraction of the points. After the fix, the app went from crashing after 30 seconds to streaming for more than four hours straight at a smooth 60 frames per second, with CPU usage dropping from nearly 100% to around 11%.
Simulation Spatial Rendering: In the early stages of the simulation feature, I continuously tested and compared the simulations against those in another project I had made. I kept noticing errors in the motion and the output data. The cause was an error in how the data was rendered, which skewed the simulation. To fix this, I built a separate hidden simulation that used spatial linear averages and regression lines to calculate the average structural points of the building, such as each floor's center of mass and center of stiffness. After finding those key points, I incorporated their 3D coordinates and the force vectors, and then used differential equations to make sure the simulation rendered accurately. Once fixed, the simulator matched my reference project within 2%.
Training Data for Earthquakes That Don't Happen on Command: To train the earthquake classifier, I needed real earthquake data, but I couldn't exactly wait for a big quake to hit my house. My first model, trained only on my own recordings, flagged almost everything as an earthquake, including my little brother jumping down the stairs. I solved this by combining thousands of real earthquake waveforms from a public research dataset, carefully resampled and rescaled to match what my cheap accelerometer would actually see, with more than 4,000 recordings of everyday household noise that I captured myself. Then I augmented all of it with random noise, scaling, and time shifts so the model couldn't just memorize examples. The hardest part wasn't the model; it was making the data honest.
Keeping the AI From Making Things Up: The first version of the Library's AI research agent was confidently wrong. It would invent a building's height or number of floors when it couldn't find the real answer. In a safety app, a made-up number is worse than no number at all. I fixed this by forcing the model to answer in a strict data schema, requiring every value to be backed by a source, cross-checking values across multiple search results, and rejecting anything that didn't agree. If a value still can't be verified, the app now labels it as estimated instead of pretending it is a fact.
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 native iOS development, embedded electronics, structural engineering, scientific computing, geospatial analysis, machine learning, and artificial intelligence. Instead of an application that simply alerts the user to an earthquake, I designed an interconnected system in which sensors detect seismic activity, algorithms and trained models analyze the measurements, a 3D simulator acts as a test bed, and an evidence-based assessment engine compiles its findings about likely building damage. My proudest achievement was bringing these very different fields of engineering together into one unified application.
Another achievement I am particularly proud of is the application's scientific computing engine. Within Seismic, I implemented 74 algorithms for signal processing, 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 built interactive visualizations that expose the underlying waveforms, spectra, peaks, and calculations.
I am also especially proud of the machine-learning layer, because I built it to work with the physics instead of replacing it. The earthquake classifier turned a cheap $3 accelerometer into a detector that can tell an earthquake from a slammed door, cutting false triggers by more than 15 times. The neural damage surrogate learned from 50,000 simulations generated by my own physics engine, so it delivers results in milliseconds while staying grounded in real structural mechanics. And every AI feature is designed to be checked: the surrogate is verified by the full solver, the AI research agent is verified against multiple sources, and the language model is kept completely out of the emergency path.
I am also incredibly proud of the contribution I made to Seismic's structural health monitoring system. Rather than use a naive approach that relied on a single metric, I designed an algorithm that uses diverse lines of evidence to evaluate buildings. First, I implemented a temperature-frequency regression model that accounts for temperature-induced shifts in resonance frequencies. Second, I applied statistical techniques to remove outliers. Third, I designed an evidence-based assessment algorithm that weighs natural-period shifts, residual displacement, and tilt measurements. 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 was designing the application's interactive 3D simulator. I designed a system that lets the user load building models, query building information, select past earthquakes, and view the resulting response. 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 their amplitude ratios. Finally, I tied these elements together into a simulator that lets the user interact with the building model and grasp the connection between building response and earthquake physics.
I am also proud of the software-hardware integration that powers Seismic. In particular, I designed the sensor fusion logic that feeds into the application's analysis engine. I fused data from an accelerometer, tilt switch, sound sensor, thermistor, photoresistor, and occupancy sensor into a custom sensor array. An Arduino MEGA 2560 microcontroller acts on this information and communicates with the smartphone over Bluetooth Low Energy. I implemented a custom newline-delimited JSON protocol that allows the smartphone to process sensor data, receive seismic recordings, send countdown information, trigger alarms, manage power switching with transistors, and control stepper motors that emulate utility shutoffs. Perhaps my most creative contribution to the system, however, was using photoresistor feedback to verify that the on/off state of the power indicator actually changed, closing the loop between a command and its real-world result.
In addition to the application itself, I am incredibly proud of the seven software modules that make it up. These independent modules manage the core mathematics, signal processing, geospatial analysis, structural health monitoring, device communication, persistence, and services that power the application. In addition to developing original algorithms, I integrated USGS earthquake feeds and aftershock forecasts, OpenStreetMap maps and building information, historical earthquake data, and local demonstrations. Finally, I designed the application to demonstrate its core capabilities without API keys or external service access, using local demonstration data sets that populate the simulator at launch.
Finally, I am proud of the automated testing framework I built for the application. The test suite contains 966 tests across all seven modules. In addition to testing core algorithms, I wrote unit tests and visual assertions across the app's mathematical, signal-processing, geospatial, structural health monitoring, data persistence, and device communication modules, along with golden tests that check my results against scientific reference libraries. I also built automated demonstrations that tie 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. I built an end-to-end engineering platform that touches diverse fields of mathematics, electronics, machine learning, software development, and real-world earthquake preparedness, and it is built from about $85 of parts.
What we learned
There were many things I took away from this project. Many of them were technical, but some were also non-technical.
Technical: On this journey, I learned a lot about coding. When I say a lot, I mean a LOT. Although this may seem obvious, I learned the many wonders of building native iOS apps, setting up Google Sign-In, syncing live data from the app to servers on Supabase, and using a wide range of APIs while learning how each one works. I also learned how to build much more complex Arduino projects, including using capacitors, resistor chains, and displays to show information. Another major technical lesson was how to connect hardware and software using BLE. On the machine-learning side, I learned that a model is only as good as its data: most of the real work went into collecting, cleaning, labeling, and augmenting data, not training models. I also learned how powerful it is to combine physics with machine learning. Using my own simulator to generate training data meant my model learned real structural behavior instead of random patterns. And I learned how to design around AI's weaknesses, by validating every output, requiring sources, and never letting a language model make a safety-critical decision.
Non-Technical: I always thought making an app was something simple. However, building this application showed me the true dedication of engineers around the world. Every application on the App Store was built by countless developers, every website on the internet was built by countless developers, and every operating system and computer was built by countless developers. Building hardware and software truly takes a next level of dedication from the human race. I also learned much more about the statistics and physics of earthquakes. I did a lot of research into the causes and effects of earthquakes. To build this app, I had to apply many of those lessons, like the frequencies at which buildings vibrate, the structural integrity of buildings, and many other calculations. I also learned the importance of honesty in engineering. It's easy to make an app that sounds confident; it's much harder, and more important, to make one that tells you how confident it really is.
Overall, while this project taught me a great deal on the technical side, it taught me just as much on the other side. Beyond learning more about coding, hardware, and machine learning, I learned more about earthquakes and the effort it takes to build real applications. This truly was a beautiful learning experience, and I would definitely do it again.
What's next for Seismic
Overall, even though this application is complex, I still believe there is tons of room for improvement!
Worldwide Accessibility: Currently, all of the text in my application is in English. This is mainly because the APIs are most accurate in English and the built-in algorithms were only designed to work in English. If this application is going to work for the entire world, it needs multiple language options. I would also hope to include many native dialects for each language so that this application is open to everyone around the world. Many of the most earthquake-prone regions on Earth, like Turkey, Nepal, Indonesia, and Latin America, are exactly the places where an affordable system like this could save the most lives.
Hardware/Arduino Appearance: Currently, the Arduino side of the project looks like a jumble of wires. It's very hard to tell the connections apart and identify errors. If I had access to a 3D printer, I would CAD (computer-aided design) an enclosure that organizes the position of the sensors, routes the wires so the connections are easy to read, and protects the device from external forces. The enclosure would also mount rigidly to the wall or floor, which would improve the accelerometer's coupling to the building and make its readings even more accurate. If I ever want to sell the hardware, it would need proper packaging and a 100% reliable set of wire connections and sensors. Also, the Arduino currently stays connected to my MacBook. To make it truly portable, it needs a battery, preferably rechargeable, and the Arduino should alert the phone whenever the battery is running low. For a device meant to work during disasters, a battery backup isn't optional, because the power is often the first thing to go.
Hardware/Software Connection: Right now, the connection between my Arduino and my iPhone is fairly weak. I need to find a way to keep the connection strong throughout the whole house, and maybe even the whole neighborhood. Sometimes after I turn off my iPhone, the connection to the hardware disappears. That simply can't happen, because it would mean that closing your phone completely defeats the purpose of the Arduino. I would need to use technologies beyond Bluetooth, like Wi-Fi or long-range LoRa radio, to ensure a long-range, stable connection, and the node should be able to take critical actions like shutting off utilities entirely on its own, even if the phone is never reachable.
UI/App Fixes: In my opinion, the app's functionality is working the way I want it to, and I haven't found any flaws yet. However, other people might have different preferences and could find the UI overwhelming. So I believe I need to clean up the UI to improve readability for the user.
Real-World Validation: Every model in Seismic has been tested on simulations, public datasets, and bench tests, but the next big step is validating it on a real shake table with scale-model buildings, and eventually partnering with a university earthquake engineering lab. That would let me measure the system's accuracy against ground truth and keep improving the classifier and the damage surrogate with real data.