Initial Design of IoT-Based Earthquake Intensitymeter Using MMI Scale with Smartphone Display

This paper discusses the initial design of an earthquake intensitymeter measuring instrument using the IoT-based MMI scale. This research is motivated by the lack of instrumentation technology applied to the community for earthquake mitigation, which is related to the geographical location of Indonesia in earthquake-prone areas. The existing earthquake intensitymeter instrument still has shortcomings in terms of hardware and data acquisition. So this paper tries to provide a solution to the problem by using an MPU6050 accelerometer sensor that can measure PGA values simultaneously on three axes. This system is also equipped with an IoT-based intensitymeter for data acquisition that can be accessed via smartphone. In this system, the MPU6050 sensor is tested for characteristics first using the UC Berkeley Seismological Myshake application, and the average linearity test data obtained is 0.994. The data acquisition system is webserver-based so that every bit of data read every second will be sent to the webserver. The webserver is also equipped with a real-time measurement graph, and every smartphone device can access the data using the IP address of the webserver.


Introduction
Along with the development of technology and science, various innovative equipment has been created to help minimize the amount of damage that may occur due to human limitations in detecting the occurrence of natural disasters.One of the natural disasters that often occur in Indonesia is earthquakes.Indonesia is an earthquake-prone country because geographically it is at the confluence of four tectonic plates, namely the Asian continental plate, the Australian continental plate, the Indian Ocean plate, and the Pacific Ocean plate [1].
An earthquake is an event of plate movement due to the sudden release of energy within the earth, characterized by the rupture of rock layers in the earth's crust [2].Earthquakes are naturally produced due to the movement of the earth's crust, or plate tectonics.Earthquakes are one of the most adverse natural disasters [3].The earthquake has cost thousands of lives and caused property damage, creating destruction and damage to infrastructure [4].Therefore, equipment is needed to detect earthquakes so that the evacuation process can be carried out faster.
There are several calculations from the earthquake scale, namely the Richter scale or Peak Ground Acceleration (PGA), that can be used.The magnitude of an earthquake is measured by the acceleration of bedrock caused by the earthquake.PGA is more widely used in research because the process of retrieving data is relatively simpler compared to the Richter scale, which requires a lot of review.In addition, the use of PGA is not new because it is commonly used in earthquake engineering [5].
The PGA method was used to build earthquake mitigation equipment in this study, which can then be converted to Modified Mercalli Intensity (MMI).MMI is a unit for measuring the strength of earthquakes.A Mercalli scale is a unit for measuring the strength of earthquakes.The Mercalli scale is divided into 12 categories based on information from people who survived the earthquake and also looked at and compared the level of damage caused by the earthquake [6][7] [8].The 12 categories can be seen in Table 1.In the table, there is a range of PGA, which is then converted into an MMI scale.In the table, only 10 categories are included that are defined by PGA values, so 2 categories are not included, namely categories 11 and 12, that are not defined by PGA values.
In previous studies, several pieces of equipment related to earthquake mitigation have been built, but some weaknesses have still been found.In previous research, an earthquake detection device was built using LCD vibrating sensors and notifications via SMS, but LCDs are still not effective in conveying information about the earthquake to the public and are not accessed in real time [9].Further research built an earthquake detection device using two sensors, namely the ADXL345 sensor and vibrating sensor, but still using an LCD.Subsequent research built a system to detect earthquakes that is portable, but for displays, it still uses LCD, and for display, graphs can only be accessed through serial monitors [10].Furthermore, disaster management equipment was built that functions to detect several natural disasters, but displays still use LCD and notifications use Short Message [11].Furthermore, despite the fact that this research is centered on the construction of instruments for earthquake early warning based on fluxgate sensors, the data in this study is still shown using a PC or analytic program with relevant data [12][13] [14].
Based on some of the above research, there are still some weaknesses in the equipment that has been built for earthquake natural disaster mitigation, so an earthquake mitigation equipment that can be accessed in real-time anywhere with an internet connection was built to overcome some of these weaknesses.The data logger used is designed using JavaScript so that the data read by the sensor will be processed directly by the microcontroller and sent to the web server with a JavaScript web design.As mitigation, the equipment is expected to be able to send information about earthquakes rapidly to the public.

Hardware Design
The equipment to be developed will be designed in the following stage.The design of the entire system can be seen in Figure 1 of the system block diagram.On the diagram block, there is a hardware and software design.In the hardware design, there are several components, namely a 9-volt adapter as the power supply used, an MPU6050 sensor, Wi-Fi or a hotspot, and a smartphone to display the data output to be analyzed.This system is divided into two important block parts, regardless of power supply or internet network, namely the transmitter block and receiver block.In the transmitter block, there is an MPU6050 sensor with a NodeMCU microcontroller as a data detection device.Furthermore, the data is transmitted to the receiver block, which is the part that acts as an integrated data acquisition with a smartphone through IP address access on a web browser.The whole system will work well by being equipped with an internet network because the data transmission process to the webserver uses the internet network.The hardware design can be seen in Figure 2 of the equipment schematic, with the components contained in the box consisting of an MPU6050 sensor that is used as a ground acceleration detector, a Node-MCU ESP8266 that functions as a microcontroller that will process data read from the sensor and send it to the web server, a 9-volt adapter used as the power supply of the system, and a pushbutton that is used as a reset when an error occurs in the system so that the system can start from scratch again.

Figure 2. Schematic Equipments
The most important part of this system is the use of an MPU6050 accelerometer sensor that can detect ground acceleration on three axes simultaneously.The specifications of the MPU6050 sensor have a working voltage of 3.3-5 volts.The sensor uses I2C mode for data communication.The output of the MPU6050 is 16 bits with a working range of 2-16 g.The working principle of the accelerometer tilt sensor uses a mechanical system method that is made into a micro and can interact with electronics, or Micro Electro Mechanical System (MEMS) technology, and is made of silicon.This mechanical system is in the form of one capacitor with two comb-shaped conductive plates facing each other but not touching.One conductive plate is a movable structure, and a small silicon load is attached.This small load is very sensitive to vibration, and even gravity can move it so that the plate attached to the load moves and is displaced.The position of the moving conductive plate will change from the distance of the conductive plate that is not moving.From this movement, the value of the change in capacitance is obtained, which can be converted by the IC into a voltage value that can be read by the microcontroller [15][16] [17].

Software Design
Figure 3 is a flowchart used to create programs on the microcontroller.The software flow may be illustrated using the diagram above.The NodeMCU ESP8266 board must be installed on the Arduino IDE before commencing the software design.Connecting the Node-MCU board to an existing Wi-Fi transmitter is the first step (WLAN).For the first time, the Wi-Fi transmitter reveals the SSID and password before connecting [18] [19].If the board is not linked, the procedure will be repeated until it is connected, and if it is connected to the Wi-Fi transmitter, this board will be able to access the internet.The sensor data is then read and delivered to a web server through the board.Data is kept on the web server.

Figure 3. Microcontroller flowchart
The flowchart in Figure 3 begins by declaring the SSID and password for the NodeMCU microcontroller.After the internet network is connected to the microcontroller, the data acquisition device will run.This system is highly dependent on the internet connection that sends data from the MPU6050 detection to the webserver.Data that has been sent to the web server can then be accessed via a smartphone by typing the IP address in the search engine browser.

Theoritical and Testing System
Peak ground acceleration (PGA) is a parameter.groundmovement parameter to determine the level ofdamage to the ground on the earth's surface caused by caused by earthquake shaking.PGA can be expressed in gal (Gravitational Acceleration) or m/s 2 (1  =9.81) 1 m/s 2 where 1 gal equals 0.01 m/s 2 1  = 981 gal).The PGA value obtained can indicate the level of risk of damage caused by earthquake disasters.The PGA value obtained can be used as a consideration in carrying out disaster mitigation, building structure design, and implementing regional spatial planning [20].
The 12 categories can be seen in Table  In this study, the system was tested using load variations and load fall distances compared to the designed system.To measure the value of the PGA, the accelerometer sensor MPU6050 is an accelerometer sensor module that can work by connecting to the NodeMCU ESP8266 microcontroller.The MPU6050 has relatively small dimensions, can detect acceleration on the three axes of x, y, and z, has an affordable price, and is relatively easy to get.The system testing scheme can be seen in Figure 4 of the system testing scheme.In the test system, there are equipments designed, namely the intensity meter as a detector, the impact field as a medium for the propagation of oscillations, and load variations as an intensifier of changes or collisions.The principle of this test is to drop the load five times at the same distance.When the load is dropped, it will pound the collision field so that it will make the collision field vibrate.The vibration generated from the impact will be used as data for testing the designed system, so that the data read is compared to the MMI scale.The drop-mass system is one of the numerical methods that can be used to model earthquakes.This method is often used in structural dynamics simulations, where a structure is assumed to consist of many masses connected by springs and treated as a dynamic system.In a drop mass system, each mass is considered a point representing a portion of the structure.The earthquake is considered a fundamental vibration, or vibration that drives the structure, and the response of the structure is analyzed using the equations of motion [21][22] [23].

Performance Spesification
At the development stage, decent equipment can be seen from the performance specifications and design specifications of the equipment.Furthermore, for the performance specifications of the equipment, refer to the results of the equipment design and the constituent components of the equipment.To see the results of the design specifications of the equipment, see Figure 5.The designed equipment consists of boxes for the constituent components of the circuit.The system will start working by connecting the adapter/power supply with the adapter jack as a link between the power of the adapter and the circuit in the circuit box.The switch will then act as a breaker and connect the entire system, allowing you to turn it off or on simply by changing the state of the switch from on to off.When the circuit is powered up, the sensor will activate and function immediately, and the physical data read by the sensor will be sent to the NodeMCU ESP8266 for processing.so that the input signal from the sensor is sent to the web server that has been designed.As a display, the smartphone will display data in the form of graphs and values from sensors.The display of the smartphone can be seen in Figure 6.On the smartphone display, there is graphic data that is updated in real-time.There are 3 graphs, namely graphs X, Y, and Z. Data loggers are displayed in the form of a table that will follow changes in sensor values in real time.There are 4 important columns in the table, namely the time of the data update and the values of the X, Y, and Z axes.The IP address of the network received by the NodeMCU ESP8266 can be used to access the display.This display is more flexible to use on all devices by simply accessing the IP address on the NodeMCU ESP8266.The design specification is the level of suitability of the data with the desired results; in this study, it is related to testing the system with five load variations with a load impact distance of 40 cm and a height of 30 cm.So that we can get a pattern from the graph that can be accessed on a smartphone according to Figure 6.

Design Spesification
Design specifications cover everything related to the performance of the equipment in the form of constituent components and the equipment's suitability for the intended function.The design specification concerns the performance of the equipment when tested.To see the design specifications of the designed system, a sensor characterization is carried out by looking at the sensitivity of the sensor and comparing it with an Android application developed by the UC Berkeley Seismological Laboratory.It can be seen in the linear regression graph in Figure 7.In Figure 7, it can be seen that the R-Square average value of the sensor is 0.994, so it can be interpreted that the sensor used in the system is working well enough for the initial design of this intensitymeter.Following that are the equipment design specifications.Furthermore, the sensor is calibrated using the self-calibration method.The MPU6050 sensor calibration is very important to ensure the accuracy of the data generated by the sensor.This calibration process involves measuring the offset and gain values of each axis on the sensor and calculating the scale factor to correct the sensor output value.There are several ways to calibrate the MPU6050 sensor, one of which is to use a self-calibration algorithm.In the self-calibration algorithm, the sensor is rotated in all axes randomly for a few seconds, and the offset and gain values are calculated automatically by the sensor.
However, there is also a manual calibration method that requires the user to enter offset and gain values manually.This method requires additional ruler equipment to ensure the sensor is aligned with a certain axis.After calibration is complete, the MPU6050 sensor is ready to be used with greater accuracy.It is important to note that calibration of the MPU6050 sensor must be performed periodically to ensure that the sensor remains accurate and reliable in motion measurements.
Furthermore, to see the level of precision of the sensor, repeated measurements are taken in one situation.In this work, repeated measurements were taken 15 times during the same situation to see the level of precision or similarity of data in each measurement during the same situation.To see the level of precision of the sensor, see Figure 8.

Figure 8. Testing the precision level of the sensor on each axis
In Figure 8, it can be seen the level of similarity of the data generated on each axis.This test was carried out on a mass variation of 1 kg, which was carried out repeatedly on the system 15 times in close proximity.The purpose of this test is to see the level of precision of the data generated when the same treatment is carried out on the system continuously.The last stage in testing this initial design is to see how the sensor responds to each axis of the mass variation dropped around the system.In Figure 9, the resulting graph has a different pattern but an intensity that is directly proportional to the increase in mass of the load.It can be seen in the graph in Figure 9 that the intensity of the collision received by the system is directly proportional to the increase in the mass of the load.In Figure 9, a graph of changes in testing with a mass drop is shown to see the system's response to the treatment given in the form of dropping the load with 5 variations in load weight, namely 1-5 kg, with the order of each of them being 1 kg.It can be seen in Figure 8 that there is a change in the trend of the graph getting higher at every 1 kg mass change.This happens because the resulting collision is getting stronger against the system along with the increase in the mass given.This test only uses mass variations without using distance as an additional influence.
The stable state values of this system should be on each axis at 0, 0, and 980 with units of gal.However, the difficulty of the process for calibration under these conditions is that the authors only rely on significant changes every time there is a collision around the system with variations in load.It can be seen in the table that, for each load variation, there are significant changes in several experiments based on the time graph.The table only shows some data changes that show changes in sensor values after a collision around the system.

Conclusion
In this study, an initial design of an intensity meter has been successfully built that can be used to measure the intensity of an earthquake using the MMI scale.From the system testing that has been carried out, a very good response has been obtained from the MPU6050 sensor with average R-square value is 0.994.The system has a good response to testing by generating collisions with the same distance and load variations up to 5 load variations, namely 1-5 Kg.From the data, each collision produced has a significant change in each increase in load value.Data from sensor readings can be accessed in real time via the smartphone used through the webserver IP address.

Figure 6 .
Figure 6.Smartphone display in the form of graphic

Figure 7 .
Figure 7. Linear regression graph on one of the MPU6050 axes and the MyShake application

Figure 9 .
Figure 9.The change in the value of the three axes at the time of the collision

Table 1 .
. In the table, there is a range of PGA, which is then converted into an MMI scale.In the table, only 10 categories are included that are defined by PGA values, so 2 categories are not included, namely categories 11 and 12, that are not defined by PGA values.Convert PGA to MMI