Distributed sensor for earthquake identification system to activate tsunami shelter finding system

Padang City as the capital of West Sumatera Province is at high risk of earthquakes and tsunamis due to its location between two continental plates and the Semangko Fault. Currently, there are several shelters in Padang that serve as evacuation sites as a rescue location when a tsunami hits. This paper presents an earthquake detection system that uses distributed sensors to activate the shelter search system. The proposed system will activate the shelter search system when the earthquake has medium or high magnitude intensity. The earthquake identification system is achieved by calculating the Peak Ground Acceleration (PGA) value from the p-wave and s-wave using piezoelectric and accelerometer sensors. The proposed system is a distributed node sensor placed in different shelters which communicate using MQTT protocol. To evaluate the system, system for earthquake detection using Raspberry Pi, piezoelectric sensor, accelerometer MPU-6050, and Xbee for data communication have been implemented. The result shows that the system can detect the magnitude and intensity of


Introduction
Earthquake is a natural phenomenon that can occur at any time and occur naturally due to the release of energy, elastic displacement, or the collision of the earth's plates in the fault zone all at once [1]. In addition, earthquakes can also be interpreted as tremors that are triggered at the earth's surface by seismic waves [2].
The city of Padang is the largest city on the west coast of Sumatra Island and the capital of West Sumatra Province, Indonesia. Based on data from the Central Bureau of Statistics (BPS) in 2016, Padang has a population of 902,413 people [3]. The province of West Sumatra has a high potential for earthquake disasters because it is located between the confluence of two major continental plates (the Eurasian plate and the Indo-Australian plate) and the Semangko fault [4]. Based on BMKG data, there were 130 earthquakes in the West Sumatra region during the period from 1 January 2017 to 12 March 2018, both on land and at sea [5]. Most of the earthquakes at sea occur in the Mentawai district, which has the potential to trigger a tsunami.
Currently, the city of Padang has a tsunami early warning system. This system consists of sensors off the coast that detect incoming tsunami waves. Then the sensors send data about the waves, which is converted into information so that people on the coast can be evacuated by sounding a siren [6].
After the siren is sounded, people on the beach are expected to immediately move to the nearest evacuation site. For the evacuation process to go smoothly, the community needs to know where the nearest shelter is located. The problem is that many people do not know where the nearest tsunami shelter is and only know a few evacuation locations [7]. This leads to severe congestion when the evacuation process is underway [8].
This study aims to develop a distributed sensor system that can determine the magnitude and intensity of an earthquake using accelerometer and piezoelectric sensors and the MQTT protocol for data communication to activate the tsunami shelter finding system.

Seismic Waves
Seismic waves propagate in the earth's crust and are caused by deformation/change in structure, pressure, tension, or explosion due to the elastic nature of the earth's crust [11]. There are seismic waves that propagate inside the earth, called body waves, and those propagate at the earth's surface called surface waves.

Body Wave
Body waves propagate in an elastic medium and whose direction of propagation is in the earth's interior. Body waves are waves that arrive before the surface waves emanating from an earthquake. These waves have a higher frequency than surface waves. Based on the motion of particles in the medium and the direction of propagation, waves can be divided into P-waves and Swaves. a) P-wave / primary wave The primary wave or compression wave is a body wave that has a higher velocity than the S-wave. This wave is a longitudinal wave of particles that can propagate back and forth in the direction of propagation. These waves are created due to pressure. Since it has a high velocity, this wave arrives earlier than the S wave. This wave has a frequency of less than 4 Hz. b) S-wave/ secondary wave The S-wave or transverse wave is a body wave with particle motion perpendicular to the direction of propagation and arrival time after the P-wave. It has a lower velocity than the P-wave.

Earthquake Magnitude
The magnitude of the earthquake expresses the strength of an earthquake. One of the methods of calculating the value of earthquake magnitude is Peak Ground Acceleration (PGA). PGA is the maximum ground acceleration when an earthquake occurs at a location [12]. Table 1 shows the earthquake magnitude based on PGA

Earthquake Intensity Scale
BMKG (Meteorology, Climatology, and Geophysical Agency) created the intensity scale of the earthquake to express the impact caused by an earthquake. The earthquake intensity scale (SIG-BMKG) was created by considering information about the impact of an earthquake based on the typical culture or building characteristics in Indonesia. This scale has a simpler structure and has only five levels, namely I-V, compared to the MMI (Modified Mercalli Intensity) scale, which has 12 levels. [13]. Table 2 shows Earthquake intensity based on PGA.

Architecture System
The earthquake detection system consists of multiple sensors operating as nodes distributed in each evacuation shelter. The distributed nodes communicate wirelessly with each other using the MQTT protocol. Each node is a module consisting of a piezoelectric sensor, an accelerometer for detecting vibrations, and a Raspberry as a sensor data processor. The Xbee module is used for wireless communication between each node. The architecture of the earthquake detection system is shown in Fig. 1. The system will be active when the piezoelectric sensor detects the incoming vibration, the piezoelectric module amplifies the signal, and the analog output signal of the piezoelectric element is converted into a digital signal, after which the signal is sent to the microcontroller.
Besides, the microcontroller calculates the frequency of the wave. If the wave has a frequency below 4 Hz, the system activates the accelerometer to measure the S-wave vibration and sends the measurement results to the microcontroller. After that, the microcontroller calculates the peak ground acceleration (PGA) value of the S-wave and then performs the calculation process to determine the intensity and magnitude of the earthquake. If the perceived earthquake intensity is on a moderate scale or above, the system activates and proceeds to the "The tsunami shelter finding system" as an application subsystem. Next, Xbee broadcasts that an earthquake has occurred at the node to the other node. If the node also receives transmissions from other nodes, it can be concluded that an earthquake has occurred. After the shelter conditions are known, the system sends data about the location, magnitude, intensity, and state of the shelter to the coordinator/broker via Xbee. Next, the broker sends data from each node to a server that acts as a subscriber. In Fig. 2, the activity diagram to activate the subsystem of the Shelter Finding System is shown.

Hardware and Software Design
Structure design for hardware construction is shown in Fig. 3. The descriptions are below: 1. The webcam is used to take pictures of the shelter. 2. Raspberry PI functions as a controller of the entire system, which contains instructions and program logic 3. The piezoelectric module serves to amplify the piezoelectric output (amplifier) and convert analog signals into digital signals. 4. The battery serves as a power source for the Node and coordinator. 5. Xbee serves to send data via radio frequency from the Node to the broker 6. Accelerometer functions to detect earthquake vibrations. 7. Piezoelectric is used to detect low-frequency vibrations; this system serves to detect P-wave 8. Coordinator/broker serves to receive all data from the Node (publisher) to be forwarded to the server (subscriber) 9. Xbee Coordinator functions to collect data from all Nodes.
To test the prototype wireless communication scenario using the MQTT protocol, the distance between each sensor and the broker is set to 120 meters and no obstacle between each node and the broker (line-of-sight (LOS)).  The scenario of node communications is shown in Fig.4. The scenario for earthquake detection is that the node (as publisher) sends data to the broker when it detects an earthquake, using the MQTT protocol according to the topic. The coordinator/broker is used to receive all the data from the node (publisher) and forward it to the server (subscriber). Then, the broker forwards the data to the subscriber depending on the subscriber who subscribed to the corresponding topic. When a node detects a vibration:  The node immediately sends a broadcast to other nodes that an earthquake has occurred.  When an earthquake occurs, the node also receives an earthquake broadcast from other nodes.  If the node does not receive any broadcast from other nodes, it can be concluded that there was no earthquake, and the detected vibrations are not from an earthquake. The software design can be seen in Fig. 5. The system reads the vibrations using a piezoelectric sensor, and when a P-wave is detected, the accelerometer is activated to further read the S-wave. Also, the microcontroller calculates the maximum acceleration of the S-wave. The microcontroller calculates the magnitude and intensity based on the maximum acceleration of the S-wave.

P-wave and S-wave detection
The P-wave has a frequency of 4 Hz and belongs to the category of infrasonic waves. To detect the presence of these seismic waves, in this experiment, a piezoelectric sensor is used. Piezoelectric is a seismic sensor that causes low-amplitude vibrations and is very easily contaminated, so the filter is required to detect the noise signal. Lowpass filter with a program to filter vibrations with frequencies below 4 Hz. The S-wave has a higher frequency than the P-wave. The S-wave can be measured directly with an accelerometer.
The Peak Ground Acceleration (PGA) is determined from the accelerometer's measurements in terms of accelerations on the x, y, and z axes. Earthquakes occur in the x-and y-plane because earthquakes are caused by a horizontal S-wave polarization [23]. In the xy-plane, the z-axis is constant; therefore, the value on the z-axis can be neglected to measure the PGA of an earthquake. The xaxis and y-axis values obtained from the sensor can be substituted into Equation 1 to obtain the resultant value: The PGA value is obtained from the highest value of the results during an earthquake event. The algorithm of PGA mapping is shown in Fig. 6. Fig. 7 shows the block diagram of PGA detection.

Implementation and Result
The system implementation can be seen in Fig. 8. The hardware used in this system consists of Piezoelectric, Accelerometer, Xbee, and Raspberry-Pi. This system has two input devices namely piezoelectric and accelerometer. The piezoelectric input is a P-wave from an earthquake with a wave frequency below 4 Hz, which is connected to the Raspberry-Pi through a module to facilitate communication between the microcontroller and the sensor. In addition, the accelerometer has an input for the acceleration generated by the S-wave of an earthquake. The highest value from the input of the accelerometer is called PGA (Peak Ground Acceleration), which is used to determine the magnitude and intensity of the earthquake. In addition, Xbee communication is used to send data between the nodes and to the brokers by using radio frequencies connected to the Raspberry Pi via an Xbee adapter to facilitate the use of the Xbee module via a USB cable. Testing the S-wave detection and finding the intensity and magnitude of the earthquake aims to determine the accuracy of the PGA readings at each node to determine the intensity and magnitude of the earthquake. This test is performed by simultaneously vibrating the accelerometer at each node with the same acceleration. Table 3 shows the evaluation of S-wave detection on node 1. Based on the test results for the S-wave measurements and considering magnitude and intensity, the average PGA reading error at node 1 is 9.68% with a standard deviation of 13.46%, and the average PGA reading error at node 2 is 5.02% with a standard deviation of 2.08%. The average PGA reading error at node 3 is 20.58% with a standard deviation of 19.44%. This error in PGA readings affects the earthquake intensity and magnitude results obtained from each node since the earthquake magnitude and intensity values are obtained using PGA. According to the author's analysis, one of the causes of the error in the test is that the position of the accelerometer at each node is not the same, which affects the acceleration values at each node. The inter-node communication time test aims to determine the time taken by each node to transmit earthquake information to other nodes. This test is performed by measuring the time taken for the node to send an earthquake broadcast until the node receives an earthquake broadcast from another node. The tests are performed for each node with different transmission distances. In Table 4 can be seen the time of communication of distributed node sensor. From the test results, it can be concluded that the distance can affect the transmission time between nodes to transmit the information that an earthquake has occurred. The farther the distance between nodes, the longer the data transmission time.
The average time taken by node 1 from the detection of an earthquake to the arrival of the data on the server is 135.251 seconds with a standard deviation of 0.362 seconds, the average time taken by node 2 from the detection of an earthquake to the arrival of the data on the server is 135.293 seconds with a standard deviation of 0.634 seconds, the average time taken by Node 3 from the time of detection of an earthquake to the arrival of the data on the server is 135.797 seconds with a standard deviation of 0.634 seconds. The conclusion when examining the time from the occurrence of the earthquake to the arrival of the data at the server is that the data transmission time is affected by noise at the time of data transmission from the node to the broker, as well as by the Internet connection at the time of data transmission from the broker to the server.

Conclusion
Based on the research conducted, the use of piezoelectric sensors to detect p-waves is quite good with an average error rate of 9.86%. The use of accelerometers to detect S-waves is good with an average error rate of 11.72%. The average time taken by the system to send the data of detected earthquake to the server is 135.25 seconds. This system is successful in activating the sub-system application of the tsunami shelter finding system after the earthquake occurred. For future development of the system, more sensitive vibration sensors such as geophones are added to detect p-waves. Adding a tool for data communication between nodes that has a longer range than Xbee.