Design of Sea Level Monitoring System Using Accelerometer with IoT Based

⎯ sea level is always changing, either influenced by meteorological aspects, gravitational forces, or geological effects. Monitoring the sea level is very beneficial, especially in such a big archipelago as Indonesia. This monitoring system is designed to use accelerometer sensor to sense the sea level changes vertically to obtain the level changes over time. This device is also featured by internet connection so that the data obtained from the sensor could be process on site using Arduino microcontroller and then sent to online website for remote monitoring process. This research is using experimental method, focusing on the electronic system design. The working flow of the research is started with literature studies and problem statement, then followed by system design, continued to software design, server building, and software and hardware integration. The last step is to test the device and analyze the result. After trial using simple pulley system, it is found that this device is able to sense the vertical level changes well, with an error for the sensor itself is at most 6 cm or about 2%. But there are some connection problems occurred between the device and the internet which resulted in a delay on the process, making the online monitoring system not perform as desired.


I. INTRODUCTION 1
Indonesi a is known as an archipelago with over 17,000 islands and long coastal line, Indonesian water is very important especially in connecting these thousand islands. As we see in coasts, waves formed in the ocean is very dynamic and unique, each having different height and length. Not only the waves are dynamic, the water level in the seas is also changing dynamically.
In order to know the sea level during particular time and to detect any possibilities of higher waves than usual, moreover disastrous one like tsunami, a device for monitor the sea level is very important. From the monitoring result, next steps needed for various application could be proceed. To add to former explanations, a remotely-accessible data of monitoring system will be pleasant to be used, especially with the device is supposed to be placed on the site of the monitoring, in the seas.
The tsunami happened in Palu and Donggala by September 2018 has taken over thousands live. According to Lassa (2018) [1], the BMKG experts explained that the tide gauge in Palu was either not confirmed or was not functioning. At the same time, it was impossible for them to verify directly to Palu as phone lines were down shortly after the earthquake. There were also no available alternative data sources, such as tsunami buoys. Lost or damaged tsunami buoys have often been reported. Yet none of the lost buoys has been replaced. It was such a heartbreaking truth how the inadequacy of the monitoring devices has brought a deadly tsunami, taking over thousands live, where we could have been saving many by giving early and accurate warning. Thus, this research will focus on the design of an approachable and handy sea level monitoring system, in which the measurement will be taken from the accelerometer, and integrated with internet so that the data of the measurement could be accessed and monitored remotely.
In previous study about Design of Sea Level Measurement Device using GY 86 module, it designs a sea level measurement device using barometer sensor equipped in the GY 86 module. Inside the device, there is several systems included, which are the sensing system, communication system, and power supply system. The result of this design is being simulated in a simple simulator with maximum deviation of 0.55 m. The result of this study shown a 3.6% error in height measurement and 11.9% error in temperature measurement, as well as 1.6% error in battery voltage measurements [2].
Another study from Khoir (2018) [3] also had done the study about Design of Sea Tides Monitoring Device with Internet of Thing (IoT) Based. In this study, the design of the monitoring system is based on ultrasonic sensor and is transmitted to ThingSpeak™ website as monitoring application. With comparison of data from Geospatial Information Agency (BIG), the monitoring device is able to record tidal data in realtime with 99.8398% of accuracy.
Another previous studies about Design of Sea Tides Monitoring Device through Internet Network for Teluk Kendari Area, has result in a monitoring system of water levels to monitor the phenomenon of tides in Gulf of Kendari. For this study, it used an ultrasonic sensor to measure the distance of surface. With a simple simulation in water container for feasibility study, the data could be accessed by anyone with their gadgets connected to internet, via ThingSpeak™ website as the application used for monitoring. This study result in good scope where the device could measure the level of International Journal of Marine Engineering Innovation and Research, Vol. 6(3), Sept. 2021. 164-174 (pISSN: 2541-5972, eISSN: 2548-1479 165 the water and transmit the data through Wifi Modul to the ThingSpeak™ website and also could be accessed from the website [4].
In this research, it will focus on the utilization of accelerometer sensor to obtain the data of the sea movements. Then Arduino Mega as the microcontroller is used as to process the data of the acceleration to gain output of sea level changes. The data will then be sent to ThingSpeak™ website for online monitoring. As for the back-up offline data storage, an SD Card is also used. As seen in the Figure 1, the research will begin with Literature Studies in order to have a fundamental understanding of the project. From the literature studies, the Problem could be stated and followed by the Design Development, in which the early design of the device system is planned. Then the plan is developed in the Software Design step for the measurement system using accelerometer. Simulations are done respectively in order to find out and evaluate the result of the software design.

A. Research Flowchart
After the software is ready and verified, it will be continued by Server Building in which an online monitoring system will be prepared. After the online monitoring media is ready, it is continued with the Hardware Assembling and Integration step by linking every modules needed. At the end of this stage, there is a verification to find out whether the device is able to measure level changes and transfer them in real-time to the website. Next is the stage of Data Taking and Analysis. After the data is gathered and analysed, the Conclusion could be retrieved and the Report Making could also be done.

B. Wave Theory
Wave is a kind of disturbance which spread on a medium. Wave occurred on the water surface is categorized as mechanical wave, in which the wave resulted in a movement of the medium it occurred. It is due to the movement of one part of the medium will disrupt the other part around the medium, creating an interaction of the medium, allowing it to move along with the spread of the wave. In term of the direction of the medium movement, the wave on the water surface is categorized as the transversal wave, where the movement of the medium is perpendicular to the direction of the wave.
In a pulse wave, each pulse moves along the medium without changing its shape with perpendicular movement of medium. In this type of wave, the medium is only move in perpendicular direction. As an example, if a rope is tied to a pillar on one end and is held in the other hand, when a disturbance is made in one direction, for example in vertical axis or z axis, the rope will only move vertically, without moving to the other direction. It is similar to sea waves in which the waves will not bring the water particle to or from the shore, but the water particle will only move in same place relatively.
Wave on the water surface has its own characteristic. As the type of mechanical and transversal wave, the water on the surface will move vertically as a wave is approaching in horizontal direction. Even so, the wave is only occurred on the surface of the water. The deeper the water molecule is located, the little the disturbance effect  166 on the movement of the wave. Therefore, objects located on the bottom of the sea will not be disturbed as much as the objects on the surface.

C. Sea Level Changes
Sea surface is not always calm, with its waves and tides rippling. These characteristics of the sea resulted in changes of the sea level. At some point it goes up and at some point, it goes down. With inconstant height and length value, the waves are very unique and random. Some days has higher height of the wave, while other has longer length of the waves, and others. These waves could be produced either by local winds, distant storms, or even due to gravitational force in tidal phenomenon. As seen in Figure 2 of Classification of Waves, it summarizes several types of waves, including the period range, generating forces, as well as the restoring forces of each type of waves. Figure 2 shows the type of waves. One of the type of wave is the tidal waves. Tidal waves are result of combined effect of Earth's rotation and gravitational forces from Moon and Sun, which generates two bulges in ocean surface. One points toward Moon or Sun, while the other one points away from Moon or Sun. This resulting disturbance create Coriolis force and risen an extremely long oscillation, called as tide. As the Earth rotates, the Moon is also conducting a pulling force by the gravitational force. A Coriolis effect the occur, resulting in the spot in a line with the moon to bulging, while the perpendicular side recedes.
Tides have longer period than other type of wave, with 12.25 hours when two almost equal high tides and two low tides occur each day, called as semidiurnal tide. Or period of 24.5 hours, when one high tide and one low tide is expected each day (diurnal tide). This extreme wavelength made tides known as quasi-periodical changes to the sea water level. Semidiurnal tides are often observed at equator lines at all times. While the most north and most south of equator are having mixed tide, in which they have two uneven high tides and two uneven low tides each day [5].

D. Principle of Accelerometer
Accelerometer is categorized as MEMS (Microelectromechanical Systems) due to its structure which combine the mechanical and electrical components in a micrometer scaled structure. In the concept, MEMS accelerometer sensor are measuring the physical acceleration experienced due to inertial forces or mechanical excitation by measuring displacement of a mass using a position-measuring interface circuit. This measurement is then converted into digital electrical signal through an Analog-to-Digital Converter (ADC) for digital processing [6], [7].
Accelerometer in general is fabricated in multilayer wafer, consisting of capacitance sensing. The capacitance sensing is chosen as the acceleration will be measured by the change of capacitance of moving mass. Principally, there is a movable mass attached to a silicon spring-like substrate. When the spring mass system is subjected to linear acceleration, a force equal to mass times acceleration acts on the proof mass, causing it to deflect. This deflection is sensed by a suitable means and converted into an equivalent electric signal [7]. The Figure 3 shows when the mass is moving toward one or another silicon substrate, it change the distance between the mass and the corresponding silicon substrate, as well as to the fixed electrode. As capacitance is also influenced by the distance, so when the distance is changed, the capacitance is also changed.
In summary, when the device is being moved, inertial force will act on the mass. As the force applied and force received by the springs and damps are equal to the inertial force acted on the mass, these forces will cause displacement of the mass, causing capacitance, the ability of a body to hold an electric charge, to change. The changes will then be detected and calculated. Then the analog mass voltage will then go through charge amplification, signal conditioning, demodulation, and lowpass filtering before being converted to digital domain using sigma-delta ADC.

E. Wave Measurement Using Accelerometer
As accelerometer produce data of acceleration value acting on the device, the output data from the accelerometer is needed to be processes to obtain desired value. The value of interest for the wave monitoring system is the height of the wave. There are some methods could be used to process the data, and one of them is the method of double integration.
Accelerometer could determine the vertical displacement of the sensor by integrating the projected acceleration twice. It will result in an estimation of the vertical displacement of the sensor. As integration resulted in addition of constant, there could be some error due to the missing constant value (Marin-Perianu, 2008).
From Newton's second law, Wang (2019) [8] stated that: and According to Bender [9], if the wave buoy is heaving, but the deck remains level, then removing gravity from the accelerometer measurement is straightforward. With the assumption of only a strapped-down, one-axis (1D) accelerometer is available and the value of wave slopes are small, the relative acceleration in vertical axis could be formulated as: In which, az is the relative acceleration value in vertical axis or z axis, g is the gravitational acceleration and Zs is the acceleration measured by the sensor. The formula is applied for sensor which was installed along the center line of the buoy at approximately the waterline and aligned so that its positive z-axis was oriented down and normal to the deck of the buoy (also known as mast parallel, the standard orientation for this unit so that it measures a +1 g when at rest.

F. System Component
The device is designed to use GY86 as the main sensor, Arduino Mega as the microcontroller, and ESP8266 as Wi-Fi Module and MicroSD Card Adapter. The design development as well as the desired work flow of is shown in Arduino Mega is one type of Arduino microcontroller, along with Arduino Uno and Arduino Nano. The difference of Arduino Mega with the other type of Arduino is on its size, both physical and memory size. It has 54 digital pins and 16 analog pins, as well as having flash memory of 256 kB.
GY86 Modul Sensor is a sensor hardware, integrated of several sensors, which are the MPU 6050 the 3-axis accelerometer and 3-axis gyroscope sensor, HMC5883L the 3-axis magnetometer, and MS5611 the barometer sensor. This sensor is equipped with the I2C interface and require a supply voltage of 3-5V. The dimension is also relatively small with 21.5 x 16.8 x 2 mm. For the purpose of this research, it will focus on the MPU6050 sensor to generate the acceleration data of the wave and processed it to obtain a sea level monitoring system.
Wi-Fi Modul ESP8266 is a wi-fi module that can be connected to microcontrollers such as Arduino and aid the microcontroller to be able to make a connection with wi-fi. ESP8266 could have its own processor, memory, and General Purpose In/Out (GPIO) so that it could act as its own microcontroller. But in this project, the ESP8266 used is in shape of a Wi-Fi module to connect the sea level monitoring system to be remotely monitored.
MicroSD Card Adapter is a module that can be connected to a microSD card, in order to enable microcontroller to store data offline. The microSD card itself work on voltage of 3.3 V, but since the adapter module has voltage regulator and level shifter the module could work with connection of 5V from the microcontroller.

G. Internet of Things and ThingSpeak™
The term of Internet of Things began in 1999, where it is coined by Kevin Ashton. But years before, it has already developing and become an interest in term of technology. Essentially, Internet of Things refers to connecting things to the internet and able to transfer data automatically, without interference of human interaction [10]. It has been a popular development of internet, where objects are given power to process and to act with their embedded intelligence, giving the object the 'smart' function.
According to Pasha (2016) [11], ThingSpeak™ is a web based open API source information platform that comprehensive in storing sensor data and process the data output to graphical form at web level. One primary feature of ThingSpeak™ is its 'Channel' which have fields for data, either from sensors or even from the result of its embedded analytics. The analytics and visualization of data could be done by utilizing MATLAB, and ThingSpeak™ could also provide feature to form alert.

A. Research Results
Trial is done by achieving reference level on the ground level, and then try to elevate it gradually to the certain level. The term ground level in this trial is the level of 50 cm from the surface of the land. In this research, there are two categories of data taking process, which first is for system consisting of accelerometer and microSD card only without any data sent to online monitoring and the second is for the overall system, consisting of accelerometer and Wi-Fi module as well as microSD card to gain the overall system performance.
For the first category of data taking process, there are two sets of data. First, the device is risen from ground level to the level of 2.5 m. The sensor produce data as seen in Table 1.   164-174  (pISSN: 2541-5972, eISSN: 2548-1479) 170 shows that the trendline is highly fitting to the graph. With the trendline, it could be seen that the device is elevated from the ground level, to the height of 1.5 m, reciprocating for a while, before continue to elevate to the height of 2.5 m. This model is the same as the trial as during trial, after elevating to the certain height, there is some small reciprocating in a relatively same level before elevated more to the next level.
Second, the device is then risen from ground level to the level of 2 m. The sensor produce data as seen in Table 2. The visualization is given in the Figure 6 as the graph of the data taken during trial.   Figure 6 shows the graph of the data taken during 2 m height trial, which visualizes the movement of the device during trial. The six-degree polynomial trendline with Rsquared value of 0.9575 shows that the trendline is also highly fitting to the graph. With the trendline, it could be seen that the device is elevated from the ground level to the height of 2 m directly. This model is the same as the trial where the elevation is done by elevating the device directly from the ground level to the 2 m level, with small reciprocating movements. After 2 minutes, the device is taken back to the ground level, and the device is able to sense the overall movement well.
For the second category of data taking process, which with the online monitoring system, the device is risen from ground level to the level of 3 m. The device works well, as all component are working, indicated by the blinking led light on the device. The result is shown in Table 3.   Figure 7 shows the graph of the data taken during trial with online monitoring, which visualizes the movement of the device during trial. The six-degree polynomial trendline with R-squared value of 0.6898 shows that the trendline is quite fitting to the graph. With the trendline, it could be seen that the device is going down from the ground level, to the height of around -40 cm, before elevated to the height of 40 cm and reciprocating on the relatively same level, before going down to zero level. This is different than the actual trial method, as the device is actually taken to the elevation of International Journal of Marine Engineering Innovation and Research, Vol. 6(3), Sept. 2021. 164-174 (pISSN: 2541-5972, eISSN: 2548-1479 172 3 m with a reciprocating movement. But, the device is sensing the data as 40 cm elevation only. Figure 8 shows the interface of the ThingSpeak™ as the monitoring website. As seen in the figure, there are four windows appeared. Each window visualizes each data taken from the sensor and the process output. Each window also has similar x-axis, which is the time of the data take place, while the y-axis is differ according to the purpose of each window visualization. The upper left window or the Field 2 Chart, with y-axis Sea Level, is showing the data of the device level after the dynamic movement experienced. It is obtained from adding the new level changes data with the previous level data. Then the upper right window or the Field 1 Chart, with y-axis Acceleration, is visualizing the data of the acceleration value obtained by the sensor. It is the raw data taken from GY86 before processed into the level data value. The lower left window or the Field 4 Chart, with y-axis of Level Changes, is visualizing the data of the level changes value. It is the first process from the acceleration value, in which it is the result of the double integration method from acceleration. And the lower right window or the Reference Level window is visualizing the reference level data. The reference level data is taken only once at the beginning, when the device start operating. It is obtained from the GY86 sensor which obtain the barometer value and convert it to gain the reference height value.

B. Data Analysis
As a starter to the analysis, some limitation of the trial or the data taking process is given. The data taken here is based on the test where it simulates a fast tidal wave with variety of amplitude, in which the device is taken into a simple pulley system and will be pulled up and down, recreating sea surface movement.
From Figure 5, it can be seen that the overall performance of the device is good as it is able to detect changes in the level, from 0 level on the ground to the level of 250 cm from ground. There is some slight error happened, as the highest point is recorded as 256 cm. It may result from inaccuracy during trial, in which there are relatively 1-2 cm error between markings used in the trial system. Even so, the result is quite satisfactorily as the error is only for about 6 cm or in percentage error is about 2.4%.
The next data of 200 cm level changes is shown in Figure 6. The data shows that the device is working good through the process of data taking. It gives the result of sea level for 203 cm, in which having error of 3 cm or about 1.5%. It is a satisfactorily result considering some limits of the trial method used. From these both trial without online monitoring equipment, the result shows an error of approximately up to 6 cm.
The Table 3 and Figure 7 is a trial with the online monitoring system embedded. It could be seen that the first problem is that the level changes recorded by the device is only about 40 cm, even though in the process the highest level was on 3 m. The next problem is about its online data sent. As seen in Figure above, even though there are 35 data recorded in the MicroSD Card, the result sent and shown in the ThingSpeak™ is only 5 data, shown in different colored number on the Table 3. Another problem seen is from the time of the data taking. If we seen the time data from Table 1 and 2, each data is separated by only 3 seconds apart. But in the Table 3, between first data and second data is having 38 seconds International Journal of Marine Engineering Innovation and Research, Vol. 6(3), Sept. 2021. 164-174 (pISSN: 2541-5972, eISSN: 2548-1479 173 delay, as well as to the next data also having 38 seconds delay. Thus, within 15 minutes trial, only 35 data could be taken which is inadequate to visualize the trial done. It is different than the trial without online monitoring, shown in Table 3 and Table 2, in which 35 data could be obtained within 105 seconds, or less than 2 minutes. These problems may be caused from several things. First, it is due to the limit from ThingSpeak™ which there is data update limit for once every 15 seconds only. Also, there is also some connectivity trouble between ESP8266 and ThingSpeak™ which resulted in longer time of process, as seen in Table 3. As the process of connecting to the online monitoring website is done right after the process of calculating the level changes, and the next process of calculating level changes is done after the connecting process, these troubles resulted in delaying the time of overall system process, including the accelerometer sensing process. Thus, the device is not able to sense every movement applied during trial due to long process time.

IV. CONCLUSION
The device is made consists of several component, first is the GY86 sensor which is an integrated sensor of MPU6050, the accelerometer, MS5611, the barometer, and HMC5883L the magnetometer. GY86 is the main sensor, in which, the accelerometer sensor will be to sense the data of the sea level changes. Second component is the Wi-Fi Module of ESP8266, which act as the connection between the measuring system and internet in order to send data automatically to internet for online monitoring. And the third component is the MicroSD Card Adapter, which is used as offline data storage, as the back-up if the connection to internet is unstable.
For the online monitoring media, the website used is ThingSpeak™ website, which is an open API source information platform. ThingSpeak™ enable users to send data online via internet connection, as well as analyze and visualize data. Thus, it is a good place to store the sensor data as it is convenient and provide many good features.
The device resulted nicely, as it is able to sense the changes in movement and send acceleration data in vertical level. But, the process to obtain vertical level changes in term of distance inside the microcontroller could be developed more in order to obtain a more accurate measurement. Accuracy of the overall sea level monitoring system design, after being tested on ground with pulley mechanism, is having an error for about +/-6 cm or around 2% of error percentage, when the online monitoring system is not featured. The online monitoring system is updating relatively slow due to limitation from free account of ThingSpeak™ that limits the data update for every 15 seconds, disabling the device to rapidly measure data of sea level. The connection issue also become problem as unstable connection may result in failure while sending data, delaying the whole device measurement system time.
As for the recommendations, there is the need to improve the device, especially in term of its accuracy and transfer duration. As to improving device, it is recommended to use extra sensor to obtain more data of the overall movement of the sensor, not only the vertical axis, to decrease the noises may happened. As for improving the transfer duration, as there are a lot of limitations using free account of ThingSpeak™, it may be better to upgrade the account if still using ThingSpeak™ or create a new website in order to give more suitable features for own device.