- Rifqi Abdillah
- Mohamad Thoriq Dhiya Ul Haq
- Gizelle Mamentu
Indonesia is a country located in the Pacific Ring of Fire, a belt of volcanic mountain ranges and active faults encircling the Pacific Ocean. This geographic condition gives Indonesia a very high potential for earthquakes. Based on BMKG data, in 2024 there were 7, 358 earthquakes, including 20 destructive ones in various regions. Meanwhile, in 2023, the Geological Agency recorded 30 destructive earthquakes that caused casualties, building damage, and significant economic losses.
One significant event was the earthquake in Bandung on September 18, 2024, with a magnitude of 5.0, which resulted in 2 deaths, 159 injuries, and material losses of around Rp 385 billion.
Why did this happen? The main cause is that Indonesia is located at the convergence of three major tectonic plates: the Eurasian Plate, the Indo-Australian Plate, and the Pacific Plate. However, to this day, early earthquake detection systems have not been evenly installed throughout Indonesia. In addition, the government’s attention and resource allocation for strengthening earthquake mitigation systems still need to be improved to minimize disaster impacts.
SolutionThe high risk of earthquakes in Indonesia highlights the need for an early earthquake detection system that is fast, affordable, and easy to implement across the country. Such a system should be able to deliver warnings within seconds, be low-cost to produce, easily replicable, and equipped with an effective notification mechanism for users.
To address this need, Aethers is presented as a solution. Aethers is a rapid earthquake detection system that combines a sensor device and a user device worn on the wrist. The system consists of AtomS3, which functions to predict and detect earthquakes and send information to users and SAR or rescue teams, and M5StickC-Plus, which acts as a warning watch for users. This watch not only displays real-time earthquake alerts but is also equipped with an SOS signal transmission feature to SAR or rescue teams. The rescuers will have a dedicated dashboard to monitor earthquake activity and view affected locations in real time.
This project aligns with the program of the President of the Republic of Indonesia, Mr. Prabowo Subianto, in Asta Cita point 4 Development of Human Resources and Gender Equality, which promotes improvements in the quality of education, health, and access to technology, as well as Asta Cita point 8 Harmony in Environment, Culture, and Religious Tolerance, which emphasizes environmental preservation and sustainability.
Aethers also supports the achievement of the Sustainable Development Goals (SDGs):
- SDG 9 (Industry, Innovation, and Infrastructure): through the development of innovative earthquake detection technology.
- SDG 11 (Sustainable Cities and Communities): by improving disaster preparedness in both urban and rural areas.
- SDG 13 (Climate Action): by strengthening the capacity for adaptation and mitigation of disaster risks exacerbated by climate change.
This demonstrates that the Aethers project is not only a technical solution for disaster mitigation but also makes a direct contribution to national strategic programs and the global development agenda.
How It WorksThe AtomS3, equipped with a built-in 3-axis gyroscope and 3-axis accelerometer (MPU6886), can be used to detect earthquakes by creating a role-based system capable of recognizing the distinctive vibration patterns typically occurring during an earthquake. In addition, the AtomS3 has Wi-Fi connectivity, enabling the device to transmit sensor readings and earthquake detection data to other devices via the MQTT protocol. MQTT was chosen for its ease of implementation, efficiency in data transmission, and flexibility for large-scale IoT system development.
The M5StickC-Plus will be used to subscribe to the MQTT topic that serves as the data transmission channel from the AtomS3. This allows users to immediately receive notifications when a potential earthquake is detected. The device is also equipped with a physical button that can be used to send an SOS signal to rescue teams or SAR teams as a request for emergency assistance. This signal transmission is carried out in the same way as the data sent from the AtomS3 using the MQTT protocol.
As a monitoring center, a web dashboard will be available to receive and display all data sent from both the AtomS3 and the M5StickC-Plus. This dashboard is designed to facilitate fast, accurate, and integrated monitoring of environmental conditions and user status. With this system, earthquake detection, alert delivery, and rescue coordination can be carried out in a short amount of time, thus helping to reduce the risks and impacts on victims during disasters.
1. Test Imu Sensor on Atom S3To build an earthquake detection system, sensors capable of accurately detecting movement are required. One device that can be used is the AtomS3, a well-integrated programmable controller based on the ESP32-S3. This device comes equipped with Wi-Fi, 8 MB of flash memory, a 0.85-inch IPS display, and a 6-axis MPU6886 gyroscope sensor that can precisely detect motion. The combination of these features makes the AtomS3 suitable for application in an earthquake detection system.
The question is, if we have a 3-axis accelerometer and a 3-axis gyroscope, which one can be used to detect earthquakes? For earthquake detection, the appropriate sensor is the accelerometer, while the gyroscope is less suitable. This is because the accelerometer can measure linear acceleration or translational motion, such as up–down, left–right, and forward–backward. Earthquake vibrations themselves are ground accelerations that can be directly captured by the accelerometer, and even vibration patterns within certain frequency ranges—typically between 0.1–10 Hz—can be well detected. In contrast, the gyroscope functions to measure angular velocity or rotation, making it less relevant for earthquake detection since earthquakes are predominantly linear vibrations rather than rotational motion. The gyroscope is only useful if the device itself rotates or tips over, but that is not a primary indicator of an earthquake. Therefore, the accelerometer is the main sensor for earthquake detection, while the gyroscope only plays a complementary role in analyzing the device’s orientation during an earthquake.
Next, we will try using an example available in the library. We only need to display the readings from the accelerometer and then visualize them through the serial plotter. In the image below, you can see the difference between the condition when the AtomS3 is stationary and when it is given a movement simulating an earthquake.
So, how can we know that an earthquake has occurred? The principle is quite simple: we can utilize data from the accelerometer sensor available in devices such as the M5Stack AtomS3. This sensor can measure acceleration along three axes, namely X, Y, and Z. Take a look at the flowchart below for a clearer description.
In the initial condition, we first store the baseline values of the three axes as a reference for the normal state. As long as the device remains stable, the accelerometer readings will stay relatively close to this baseline, so the system will display the status "Normal" in green on the screen. However, when a sudden change occurs that exceeds a certain threshold, the system will recognize it as a tremor. At that point, the status will change to "Earthquake" with red text, allowing the user to immediately be aware of the earthquake indication. This simple approach demonstrates how sensor data can be processed in real-time to provide early detection, although further development is certainly needed for it to be practically applied in the field.
After that, the next step is to implement it in the form of code using Arduino. FYI, if you are new to this, you can directly refer to the official documentation here to learn how to program the device used in this project with the Arduino IDE.
So, how can we know that an earthquake has occurred using only an accelerometer? An accelerometer is a sensor that measures acceleration along three axes X, Y, and Z. Under normal conditions, its values remain stable because they are only influenced by gravity and minor environmental vibrations. When an earthquake occurs, the acceleration values change significantly, which can be used as an indicator of ground shaking.
// Set baseline hanya sekali di awal
if (!baseline_set) {
baseX = data.accel.x;
baseY = data.accel.y;
baseZ = data.accel.z;
baseline_set = true;}
// --- Hitung delta akselerasi ---
float diffX = fabs(data.accel.x - baseX);
float diffY = fabs(data.accel.y - baseY);
float diffZ = fabs(data.accel.z - baseZ);
// Magnitudo delta (total perubahan akselerasi)
float diffTotal = sqrt(diffX*diffX + diffY*diffY + diffZ*diffZ);
float faktor = 1.2; // bisa diubah sesuai eksperimen
float SR = pow(10, diffTotal * faktor);
// Batasi agar tidak lebih dari 10
if (SR > 10.0) SR = 10.0;
The way it works is by storing a baseline or the initial condition when no earthquake is happening. Every new reading from the sensor is compared to this baseline to calculate the difference or acceleration delta. The deltas from each axis are then combined into a single total value. This value can be mapped to a simple scale similar to the Richter scale. The larger the change, the higher the likelihood of an earthquake.
Since we do not have a seismometer as the gold standard, using an accelerometer can be a practical solution. The results are still rough and highly dependent on environmental factors and sensor placement, but with proper calibration and data processing, an accelerometer can serve as a simple earthquake detector.
3. MQTT Send Data From Atom S3We have successfully built a simple detection system. Before moving further, we need to map out how the devices connect to the dashboard and how the topics relate to each other, ensuring a well-structured connection. The Atom device will serve as an earthquake detector, publishing data to the broker. Its topic will be subscribed to by both the smartwatch and the dashboard. Meanwhile, the smartwatch will also publish SOS data to the broker, which will then be subscribed to by the dashboard. For a clearer picture, see the diagram below.
In simple terms, we can make use of the example project already available in the library. At this initial stage, we only need to add the broker address to be used. In this example, we are using a free public broker that is openly accessible, namely broker.hivemq.com. After that, we can immediately add a small piece of code to test it out.
snprintf(msg, MSG_BUFFER_SIZE, "earthquake alert #%ld", value);
Serial.print("Publish message: ");
Serial.println(msg);
// client.publish("earthquake/magnitude", msg); // kirim ke topik baru
Once the program has been successfully uploaded to the device, the next step is to check whether the data is actually being transmitted. To verify this, we can use Google Colab as a monitoring tool. The supporting code for this verification can also be downloaded from the provided attachment.
Once the program has been successfully uploaded to the device, the next step is to verify whether the data is actually being transmitted. To do this, we can use Google Colab as a monitoring tool. The supporting code for this verification can also be downloaded from the provided attachment.
message = '{"ID":"7","SR":10.00,"latitude":-6.1,"longitude":106.82,"kedalaman":"10","lokasi":"Jakarta"}';
Each data element carries a specific meaning:
- ID > the identifier of the transmitting device
- SR > the calculated earthquake magnitude (Richter Scale) obtained from the AtomS3 accelerometer sensor
- Latitude & Longitude > the geographic coordinates of the device’s location
- Location > the name of the city or area where the device is placed
- Depth > a dummy value currently entered manually, which can later be enhanced by adding supporting components to produce more accurate data
With this data format, the system can transmit basic information about detected earthquakes while also providing opportunities for further development to improve the validity and completeness of the data. Here are the results.
In designing this dashboard, I began by structuring a system architecture capable of handling real time earthquake data flow. The system follows a main workflow where sensors or earthquake data sources send information via the MQTT protocol. This data is routed through a public broker, in this case broker.hivemq.com, and then received by a Node.js server equipped with Express, Socket.io, MQTT, and MySQL modules. Express is used to build APIs and manage routing, while MySQL serves as the database for storing magnitude readings, alerts, and even heart rate data. Socket.io enables real time data distribution to all connected clients. With this design, the system can display up to date information without requiring manual refresh, while still retaining historical records in the database for deeper analysis.
On the frontend side, the main focus is on creating an interface that is informative yet simple and easy to understand. The dashboard design is developed using TailwindCSS and Bootstrap to ensure a modern look while remaining responsive across various devices. For map visualization, Leaflet.js is used to place interactive earthquake location markers. These markers are color coded according to magnitude ranges, allowing users to instantly grasp the intensity of each earthquake displayed.
In addition to the map, the frontend also provides an earthquake filter feature that allows users to sort data by specific categories such as “all, ” “≥ 5.0 SR, ” or “< 5.0 SR.” The server notification section is designed with simple animations so that each new alert stands out and catches the user’s attention. All frontend components are directly connected to the server through a Socket.io client, ensuring that every new piece of data sent by the backend appears on the dashboard in real time.
5. Dashboard Subscribe to MQTT BrokerThis system is designed to stream earthquake data in real time from sensor sources to the web dashboard. The flow begins with a sensor or transmitting device publishing information to a public MQTT broker. Our backend server, built with Node.js and Express.js, acts as an MQTT client with simple code such as:
const broker = 'mqtt://broker.hivemq.com';
const topics = { earthquakeMagnitude: 'earthquake/magnitude', earthquakeAlerts: 'earthquake/alerts' };
const mqttClient = mqtt.connect(broker);
mqttClient.on('connect', () => {
Object.values(topics).forEach(topic => mqttClient.subscribe(topic));
});
Once a message arrives on one of the topics, the server processes it in the event handler:
mqttClient.on('message', async (topic, message) => {
const data = JSON.parse(message.toString());
if (topic === topics.earthquakeMagnitude) {
const SR = parseFloat(data.SR);
const latitude = parseFloat(data.latitude);
const longitude = parseFloat(data.longitude);
// simpan ke database jika valid
await db.query(
'INSERT INTO magnitude (ID, SR, latitude, longitude, kedalaman, lokasi, TIMESTAMP) VALUES (?, ?, ?, ?, ?, ?, ?)',
[data.ID, SR, latitude, longitude, data.kedalaman, data.lokasi, new Date().toISOString().slice(0,19).replace('T',' ')]
);
io.emit('magnitude-update', data); // kirim ke frontend via Socket.io
}
});
This step ensures that every valid message is immediately stored in the MySQL database and broadcast to all connected clients. The database connection pool is created using mysql2/promise for efficiency:
const db = mysql.createPool({ host: 'localhost', user: 'root', database: 'datajam', waitForConnections: true });
On the frontend side, the dashboard built with HTML, TailwindCSS, and LeafletJS listens for real time events using Socket.io. Once a magnitude-update event is received, the data is immediately rendered on both the map and the earthquake list:
socket.on('magnitude-update', (data) => {
const marker = L.circleMarker([data.latitude, data.longitude], {
radius: Math.max(data.SR * 2, 5),
color: data.SR >= 5 ? '#ef4444' : '#10b981',
fillOpacity: 0.8
}).addTo(map);
marker.bindPopup(`${data.lokasi}<br>${data.SR} SR<br>${new Date(data.timestamp)}`);
addServerMessage(`Gempa baru: ${data.SR} SR`, new Date(data.timestamp));
});
With this pattern, every piece of data sent from the sensor via MQTT flows automatically to the server, where it is validated, stored, and displayed on the dashboard without needing to reload the page. The dashboard also includes a smartwatch user monitoring table, which the server updates every ten seconds via io.emit('user-update', {...}), allowing vital conditions to be tracked in real time.
For testing, the system is evaluated in several stages. First, the backend API is tested using Postman or Jest to ensure that endpoints such as GET /api/magnitude and POST /api/magnitude function correctly and interact properly with the database. Second, the MQTT flow is tested with tools like Mosquitto or MQTT Explorer to send mock data:
mosquitto_pub -h broker.hivemq.com -t "earthquake/magnitude" \
-m '{"ID":"Test01","SR":5.4,"latitude":-6.2,"longitude":106.8,"kedalaman":"10 km","lokasi":"Jakarta"}'
If successful, a new marker appears immediately on the dashboard. Third, the frontend is tested to verify whether the magnitude filter works correctly, whether the notification list is limited to five items, and whether server notifications appear properly when an alert-update event is sent. Finally, an end-to-end test is performed by streaming data from MQTT through to the dashboard, ensuring that the entire chain runs smoothly.
The result is an integrated system: sensor > MQTT broker > backend (parsing & storage) > Socket.io > frontend (map & table), capable of displaying earthquake information and wearable user data in real time. You can see the results in the video below:
4. Watch Notification on StickC PlusWe will use the M5StickC Plus with watch accessories so users can receive all notifications and send SOS messages to the dashboard. The M5StickC Plus is chosen because it already comes with a built-in battery, onboard buttons, and Wi-Fi connectivity. In addition, the watch accessory allows the device to be worn directly on the user’s wrist without any extra modifications.
This section transforms the M5StickC Plus into a watch notification device for detecting earthquake alerts. First, the device is configured to connect to a WiFi network using a predefined SSID and password. Once connected, it establishes an MQTT connection to the public broker (broker.hivemq.com) and subscribes to a dedicated topic for earthquake information (earthquake/magnitude). This process is handled within the setup() and setupWifi() functions:
WiFi.begin(ssid, password);
client.setServer(mqtt_server, 1883);
client.setCallback(callback);
client.subscribe(topic_eq);
When the broker sends an earthquake message, the data is received through the MQTT callback function. The message, formatted in JSON, contains the earthquake location, Richter scale value, and depth. The program uses ArduinoJson to parse this message:
StaticJsonDocument<256> doc;
DeserializationError error = deserializeJson(doc, jsonStr);
const char* lokasi = doc["lokasi"];
float sr = doc["SR"];
const char* kedalaman = doc["kedalaman"];
After parsing, the earthquake information is displayed on the StickC Plus screen using the dedicated showEarthquakeInfo() function. The display shows the text Earthquake Detected, followed by the city name, earthquake magnitude, and depth, all centered on the color screen. This ensures the device always presents the latest earthquake alerts received via the MQTT network.
5. Watch SOS Send DataIn addition to receiving notifications, this device can also send an SOS signal when button A is pressed. In the loop() function, the program checks whether the button has been released (M5.BtnA.wasReleased()), then publishes an emergency message to the earthquake/alerts topic:
if (M5.BtnA.wasReleased()) {
client.publish(topic_users, "User 1 - Code Red - Need Help ASAP");
showCenteredText("HELP SENT!", RED, 2);
delay(2000);
}
When the button is pressed, the StickC Plus screen displays the message "HELP SENT!" for two seconds as visual confirmation to the user. After that, the device automatically returns to the previous screen. If an earthquake alert had been received earlier, the earthquake information will reappear. If no new earthquake message is available, the screen goes back to standby mode showing "AETHERS".
With this mechanism, the StickC Plus serves a dual purpose: receiving real-time earthquake information via MQTT and sending instant emergency signals when needed. This system transforms the small device into a rapid communication tool for disaster situations.
Next, we will proceed with testing both data reception from the device and the transmission of SOS signals. For the initial stage, the test is carried out through a mobile phone simulation to ensure that the communication flow works smoothly before trying it directly via the website. Please check the video below to see the simulation process.
6. TestingClosingWith AETHERS, earthquake warnings can be delivered within seconds, allowing communities to respond immediately. Moving forward, the system can be enhanced with additional depth sensors, user condition monitoring sensors, AI algorithms for higher accuracy, and integration into the national early warning network.
SEE YOU ON THE NEXT PROJECT! :)
Comments