The Design of Earthquake Detector Using Pendulum Swing Based on ATMega328

Earthquake is a vibration that occur on the surface of the earth, earthquakes are usually caused by the movement of the earth's crust (earth's plates). Earthquakes are also used to indicate the area from which the earthquake occurred. Even though our earth is solid, it always moves and earthquakes occur when the pressure caused by that movement is too large to be able to withstand. One of the effects of the earthquake vibration itself that reaches the earth's surface and if the vibration is large enough can damage buildings and other infrastructure such as roads and bridges, railroad tracks, dams and others, causing casualties and property losses. So that we can avoid the danger caused by an earthquake, it is necessary to design an earthquake detection device with a pendulum swing method based on the ATMega328 Microcontroller. The ATMega328 microcontroller is the core of all the systems that exist in this design. In the design of earthquake measuring device using infrared sensors and photodiodes. Where the infrared beam construction is determined by the pendulum which detects the swing. Keywords— photodiode, infrared, pendulum swing, microcontroller


I. INTRODUCTION
The need for intelligent equipment that can operate automatically is increasing, so that these automatic equipment are gradually replacing manual equipment. In addition to the same work system, automated equipment can do its own work without having to be controlled by the user. To design an intelligent equipment that can work automatically, we need a device or component that can calculate, remember, and make choices.
One of the automatic device that are needed when a natural disaster occurs is an earthquake alarm [1]- [5]. This device works automatically using the pendulum swing method. So here we don't need to be afraid of earthquakes, especially at night when we are sleeping we just need to use an earthquake alarm [6]- [9]. On the basis of the above thought, an instrument that is designed to be an earthquake alarm with the pendulum swing method can detect an earthquake, so that it will facilitate and assist the community in avoiding earthquakes.

II. METHOD
In Figure 1 explained that; Power Supply block as a voltage provider throughout the system. As a detector, infrared is used as a signal to the sensor [10]- [12] and photodioda as a detector for pendulum movement. Photodioda is a type of diode whose resistance will change when exposed to light rays sent by the transmitter "LED". The resistance of a photodioda is influenced by the intensity of the light it receives, the more light it receives, the smaller the traversing of the photodioda and vice versa if the less the intensity of the light received by the photodiode sensor, the greater the value of the resistance [13]- [20]. The photodiode sensor, like the LDR sensor, converts the amount of light the sensor receives into changes in conductance. ATMega328 [21] blocks data processing and notifications, to control the LCD as a notification via the display layer and buzzer as a notification indicator. AVR is a type of microcontroller in which there are various kinds of functions. The difference in micro that is generally used like MCS51 is that the AVR does not need to use an external oscillator because there is already an internal oscillator inside. Besides the advantages of the AVR is to have a Power-On Reset, which does not need to have a reset button from the outside because it is enough to simply turn off the supply, then automatically the AVR will reset. For some types of AVR there are some special functions such as ADC, EEPROM around 128 bytes up to 512 bytes.
The first step to operate the device is to provide voltage to the system or circuit in show figure 2. After the ATMega328 microcontroller system is active it will perform its function as a control of all inputs and outputs. The ATMega328 Journal of Robotics and Control ISSN: 2715-5072 210 Ipin Prasojo, The Design of Earthquake Detector Using Pendulum Swing Based on ATMega328 microcontroller activates the photodiode sensor and LCD. Once activated, the LCD will display the text for earthquake detection there is also a ceramic capacitor functions as a filter and IC7805 as a voltage stabilizer. The photodiode sensor will read the data when the pendulum that is attached by infrared shakes through an earthquake beam. Data read by the photodiode sensor will be forwarded to the microcontroller to view with a database on the ATMega328 microcontroller memory.
If the pendulum shakes, there will be a potential difference that occurs due to the shifting of light between the photodiode and infrared sensors so that it produces a voltage change, then read by the microcontroller and the microcontroller instructs the buzzer to be active from electric vibrations to sound.
The sound issued from the buzzer is a sound recording that is stored on the memory card mini mp3 df player function card is a place to put the memory card. The function of the speaker is to make a recorded sound inside the memory card Completed here is all the process of shaking the earthquake detection with the pendulum swing method [22]- [26]. The stages above are interrelated, so the process or stages must be carried out in the manufacture of earthquake detection device with the pendulum swing method.

III. IMPLEMENTATION
The design of the device in this study was validated by several tests involving sensor blocks, microcontroller blocks and display blocks or indicators.

A. Microcontroller test
Programming in this study using the ISP (In System Programming) mode of the microcontroller must be programmed directly on the circuit board and the microcontroller circuit must be recognizable by the downloader program. This test was successfully carried out by recognizing the type of microcontroller by the downloader program, ATMega328. ATMega328 uses a crystal with a frequency of 16Mhz MHz, if the Chip Signature is well recognized and within a short time, it can be said that the microcontroller circuit works well with ISP mode.

B. Sensor test
Earthquake sensor testing aims to determine whether the sensor can detect earthquakes well or not, this test is done by looking at the output of the sensor on the serial monitor. To find out the change in voltage when the pendulum is rocking.

C. Display and indicator test
This section only consists of an LCD dot matrix 2 x 16 characters that function as a display of measurement results and display of some information. The LCD is connected directly to Port D of the microcontroller which functions to send the processing data to be displayed in alphabetical and numeric form on the LCD. The character display on the LCD is governed by the EN, RS and RW pins: The EN path is called Enable. This path is used to tell the LCD that you are sending a data. To transmit data to the LCD, then through the EN program, logic must be made of low "0" and set (high) on the other two control lines RS and RW. The RW line is the Read / Write control line. When RW logic low (0), then the information on the data bus will be written on the LCD screen. When RW logic high "1", the program will read the memory from the LCD. Whereas in general applications the RW pin is always given a logic low (0). Based on the information above, we can make a program to display character on an LCD display.

IV. CONCLUSION
This earthquake alarm is a device that works based on the conditions of the vibration caused, where the output is in the form of sound generated by the buzzer and LED as the indicator. This condition is caused based on how much vibration is caused to move the pendulum in the direction of the sensors installed. To detect vibrations, the pendulum must be able to move by 5 ° from the previous sensor and the beam given by the LED must not be too wide, this can affect the sensitivity of the sensor. The conditions produced are: The pendulum is exposed to the first sensor, the LED is off. The pendulum moves 5 ° from the first sensor on the second sensor, the buzzer sounds softly. The pendulum moves 10 ° from the first sensor on the third sensor, the buzzer sounds loud. The pendulum does not touch the three sensors, the buzzer sounds very slowly. The output produced is only a buzzer and LED.