Piracy Anticipation System Design on Ships

. One of the factors that caused the hijacking of ships was the lack of a security system in sailing. The purpose of this study is to design a piracy anticipation system on a ship to provide early warning to ship officers and design a shooting system, determine the distance to objects detected by sensors and design a system of sending information to the BAKAMLA (Sea Safety Agency) team in case of piracy. This research device uses four ultrasonic sensors to detect and determine the distance to objects that enter the ship's area. The sensor reading distance is 2 cm to 50 cm. The ship's area monitoring system uses a camera and a Raspberry Pi to improve the surveillance of ship personnel in monitoring the situation around the ship. The system installed on this ship displays video streaming and detects objects using ultrasonic sensors to determine the distance of the detected object and capture it. Video streaming, distance, and photos of detected objects can be seen on the website by opening a particular site for this monitoring system. The website is equipped with admin_name and passwords and photos of objects can be downloaded on the website. This device is equipped with a buzzer to provide early warning to the ship officers. When an object is detected. The active buzzer and SIM used will send information about piracy to the BAKAMLA team.


Introduction
Safety in sailing is a condition where there are elements of safety and security requirements concerning transportation in waters and ports. Meanwhile, safety in sailing is essential as crime cases increase. If there is insecurity, it will need a mechanism that can record the occurrence of the insecurity so that it can be used for investigation purposes by the authorities. Therefore, more attention must be paid to security so that unwanted things do not happen while sailing.
According to international news reports, the marine area of Indonesia is one of the most prone to piracy. Besides, several marine areas are most prone to piracy, including those in the Malacca Strait which connect the waters of Indonesia, Singapore, and Malaysia.
One published news in the online news of the East Kalimantan Tribun News with the title Pirates Attacking Coal Ships, Helmets of the ship Severely Injured Which was published on February 25, 2018. The news stated that there had been piracy on the Mitra Samudera 28 tugboat ship carrying coal which became the theft and violence in the waters of Tanjung Balai Karimun. This hijacking incident has injured one ship's helmsman. Mitra Samudera 28 has just finished unloading coal from South Sumatra in Malaysia.
Based on the above problems, the research will be implemented by designing a system that can avoid the * Corresponding author: rozeff@umrah.ac.id piracy of ships at sea. So that, the target of the hijacked ship can find out quickly if the ship will get hijacked. P device may present study works automatically by sending the information to the relevant parties like-i team BAKAMLA (Agency for Maritime Security) to conduct a search, aid, and rescue of the hijacked ship.

Literature Review
Previous studies related to the title of this research are [1] designing applications for monitoring and controlling electronic devices in a web-based room. The purpose of this study is to design a room monitoring application using an integrated webcam, using a servo motor, so that, the web camera can move to cover all corners of the room that is accessed using a web GUI with the help from Raspberry Pi model B which is used as a web server. The test results obtained a live streaming webcam program on the application page, controlling the direction of the webcam via the web, and controlling the on-off control of electronic devices in the form of incandescent lamps via the web.
The next research is to do [2] monitoring the room based on Raspberry Pi and motion and detecting objects that move in the room. The results of the camera streaming are good and can run the system smoothly and displayed on the web that has been secured with the login function. This study only implemented monitoring without recording or capturing pictures.
The next research conducted was [3] monitoring wirelessly, safely, and effectively using radiofrequency technology to send and receive data over the air. So that, it can monitor remotely. The test results show that the motion application is unsuitable for the Raspberry Pi NoIR camera because the display does not appear on the browser during live streaming. The motion application is suitable for use on a webcam with successful live streaming using a webcam.
Subsequent research will implement [4] monitoring for the security system of the outside waters and islands. The system installed on the outside of the island displays live streaming video and captures objects around it. The results of the live streaming video, object distances, and photos of detected objects can be viewed on a particular website that is equipped with admin_name and password, and photos of objects can be downloaded on the website.
Subsequent research [5] designed an underwater camera system using IP cameras. This research designed a camera system that can monitor underwater images/videos remotely and wirelessly using a computer/smartphone with a range of 1.5-2 km and with limited users.
The next study [6] The researcher controlled the lights remotely with an internet-based network internet of things (IoT) using the Raspberry Pi 3 and remote control that utilizes technology internet in the control process on the local network on an embedded web server for remote control devices. The result of this system is; it is successful in controlling (active/inactive) the lighting of a house through a wireless network connection and the internet.
The researcher needs to do [7] observation or underwater monitoring objects that can display underwater video to be displayed and accessible on the Internet with Youtube applications. The results of this underwater observation camera system can picture underwater objects with 2 to 4 meters viewing distance.

Data Collection Method
1) Literature Study: This research is based on references contained in books, journals, and websites related to the design of anti-piracy systems on ships, so that it can be seen what has been developed by previous researchers and their advantages and disadvantages. In this literature study, the author also studies and understands the tools related to the research that will be designed. 2) Observation: This method was done by observing directly the field related to what you want to research. 3) Interview: This method is implemented by conducting interviews and asking people who are capable related to this research 4) Design: This method is implemented by designing ultrasonic sensor devices, designing GPS devices, designing timing devices, designing infrared cameras, designing Raspberry Pi 3 data processing devices, designing Arduino Mega 2560 processing devices, designing buzzer devices, designing GSM modules, designing network devices, Raspberry Pi 3 software design, Arduino software design, and web design. 5) Testing: The test method is implemented to obtain data through the device that has been designed.

System Design
The system to be studied in this research is divided into 3 main parts, namely; the input section which consists of 2 infrared cameras, 4 ultrasonic sensors, a GPS module, and an RTC module. The processes section consists of Raspberry Pi and Arduino Mega 2560, and the output section consists of a buzzer, a SIM 900 module, a mobile phone, and a web server as shown in the following block diagram.

Fig 1. Device Diagram Block
The design diagram block above is a block diagram of the hardware (hardware) on the system. The block diagram has an input section, a process section, and an output section.
Here are the functions of each device used: 1) Ultrasonic Sensors: 4 ultrasonic sensors are used. The ship's right and left hulls are each installed with 2 sensors to detect objects entering the ship's area.
2) GPS module: The GPS module is a device used to determine the ship's position in terms of latitude and longitude.
3) RTC Module: The RTC module is used as a reference in determining data on the calendar and as a digital clock for information on SMS text that will be sent to BAKAMLA. 4) Infrared Camera: A camera is a device used for monitoring the area around the ship in real-time, both during the day/night. The data generated from the output of this camera is in the form of digital data. 5) Raspberry Pi: Raspberry Pi is a mini-computer used as a data processor on infrared cameras and sensors ultrasonic. 6) Arduino Mega2560: Arduino mega2560 is an opensource microcontroller that functions as a processor on GPS, RTC, Buzzer, and SIM devices. 7) Buzzer: The buzzer is used as an indicator/alarm. When an object is detected by the sensor, the buzzer will make a sound. 8) SIM900 Module: The SIM900 module is used as a medium for sending information/SMS. There has been a hijacking of ships to related parties such as BAKAMLA (Sea Security Agency). 9) Laptop/webserver: Laptop/webserver for monitoring the results of camera streaming, information, and photos of detected objects. 10) Mobile: Mobile as a recipient of information on hijacking events sent by the SIM module. The following is a flow chart that describes the research to be implemented:

How to Device Works
When the ultrasonic sensor detects an object at a preset distance, the camera will take a picture of the pirate, it will be processed and sent by the Raspberry Pi via the internal wi-fi on the Raspberry Pi board to the access point on the WLAN network to the laptop server connected to the access point. On the same WLAN network to be displayed on a web page, accessed using a username and password by an authorized admin, and has access rights. After that, the camera returns to normal to display video streaming until any pirates are detected again.
The results of the detected object images will be stored in the server database and can be downloaded on a web page that has been programmed specifically for this system. When pirates are detected by the sensors, the GPS module will read the ship's location in the form of coordinates (latitude and longitude). If the GPS signal has been received, it will be sent to the SIM900 module as an SMS sender. The SMS received by BAKAMLA contains information that a hijacking has taken place "name of the hijacked ship", as well as sending details regarding the day and date and time of the hijacking, the position (latitude and longitude) of the hijacked vessel, the distance of the object to the sensor and a message requesting immediate assistance.

I)
Ultrasonic Sensor Test Ultrasonic sensor testing was done by comparing manual distance measurements using a ruler and an ultrasonic sensor with a programmed Raspberry Pi. It aims to calibrate the sensor and see the suitability of the ultrasonic sensor used with standard measuring instruments. Ultrasonic sensors are used to detect objects on the left and right sides of the ship. The range of the sensor is adjusted from the length of the ship to the position of the ultrasonic sensor. So that, the Raspberry Pi program limits the maximum detection distance. Objects will be detected when they are within range of the ultrasonic sensor.

Fig 3. Ultrasonic Sensor Calibration Process
Ultrasonic sensor testing and calibration process. Sensor calibration was done by testing the Raspberry Pi program which is made to fit the standard measuring instrument used. From the figure above, it can be seen that the results of the ultrasonic sensor readings 1 and ultrasonic 4 are unreadable by 30cm. The ultrasonic sensor calibration results show that the ultrasonic sensor used can work well as expected by the researcher. 2) Neo-6M. GPS Module Testing Based on the test results, the measured voltage on the GPS VCC is 3.7V. At the Tx GPS pin, the measured voltage is 3.38V. The variable voltage on the Tx pin because the Tx pin is a signal sending a pin to Arduino in the form of coordinate points. Furthermore, on the Rx pin which is the receiver pin on the GPS, the measured voltage is 3.61V.

4)
Infrared Camera Testing The function of the camera in this study is used to illustrate in the form of videos and photos of objects. The video produced by the camera is directly sent to the web for streaming in real-time. To start streaming video on the web, we have to install the motion application on the Raspberry Pi first.

RTC 5V
5) Raspberry Pi 3. Testing Raspberry Pi is a device that is used as a system performance processor to run programs based on the research. The Raspberry Pi uses a memory card to store the operating system and programs to execute commands based on the research.
The Raspberry pi in this study uses an operating system called Raspbian Jessie. The operating system is downloaded on the www.raspberrypi.org page. After the operating system is finished downloading, the file is in the .zip format and extracted into the original file. After that, the file is copied to the memory card and installed on the Raspberry pi. The first time the Raspberry pi is activated, it requires a monitor that uses an HDMI cable to set up the Raspberry pi. When the Raspberry pi is started, the PWR and ACT indicator lights will be active indicating that the Raspberry pi is ready to be programmed.
After the Raspberry Pi was successfully controlled by the laptop, testing on the Raspberry Pi showed the results that the Raspberry Pi was successful to proceed to the next stage. Thus, the Raspberry Pi has become a mini-computer ready to write programs related to this research.

6)
Testing Arduino mega 2560 Arduino software testing is implemented to determine whether or not the program used on the Arduino can process the data readings from GPS, RTC, and SIM900 and execute it properly and see if when the sensor detects an object, the SIM900 module immediately sends an SMS message. The first test was implemented on the Arduino program to see the response of the program execution implemented by Arduino. Before uploading the entire program listing, we have to determine the port used on the Arduino software first. This test uses the Arduino Mega 2560 Board option and serial communication using the COM5 port so that the Arduino software can communicate with the Arduino hardware.

Fig 10. Arduino Serial Port Settings
Based on the test results on the Arduino software, the program listing was successfully uploaded to the Arduino hardware for 18 seconds. The length of the upload process is influenced by the amount of data to be uploaded. Arduino's response to the operation of reading the GPS module, RTC module, Buzzer, and SIM module went well according to the delay given in the program listing. However, during sending SMS to cellphones, there is a time difference ranging from 1 to 3 seconds caused by network influences. 7) SIM900. Testing SIM900 testing was done by pressing the power button and holding the push button for 2 seconds and paying attention to the red indicator LED. The SIM900 will activate and work usually when the LED indicator stops flashing after 4 to 12 flashes. When it exceeds 12 blinks then turn off and turn on the SIM900 again because the top blink in this process is 12 times. The blinking of the LED indicates that the SIM900 is looking for a signal and stops when a signal is received. The worse the provider uses, the longer the signal search process will take. This research used Telkomsel provider, so it only takes 4 to 5 times the LED blinks. Subsequent testing is implemented on the Tx and Rx pins which have different functions from each pin on the SIM900 module. The form of the signal and the measured voltage is the VCC, Tx, and Rx pins. The VCC pin is the voltage source on the SIM900. Pin Tx is the transmitter (transmitter) and Rx is the receiver (receiver). When the object is not detected, the buzzer is off, and the SIM900 will not send a message. When the object is detected, the buzzer will be on, and the resulting voltage at the transmitter is 3.83V DC. Tests show that the TX pin on the SIM900 sends information accurately, seen from the working voltage and the received signal image.

8)
Overall System Testing The devices have been combined into a single system to execute commands according to the purpose of this research. The system was tested using a WLAN network. The first step is to activate the Raspberry Pi 3 and Arduino Mega 2560 using an adapter and connect the Raspberry Pi to the access point and laptop server on the same access point by activating the tethering hotspot of the smartphone used. After the two devices are connected, then start Apache and MySql on XAMPP then login to the web that has been designed by entering "admin" as the username and "admin" as well as the password. The video stream will display the video in real-time. The system was tested by running the program on the Raspberry Pi terminal and the Arduino Mega IDE. On the Raspberry Pi by combining programs in one directory. The directory creation was done on the terminal by calling the following program: Sudo nano main.py.
The main.py program is written as the main program, which combines the sensor program, the fswebcam program, the start motion program, the stop motion program, and the photo upload program to the database to run the entire program in one execution command. The whole Raspberry Pi program can be seen in the appendix.
On the Arduino Mega, the GPS program, RTC program, SIM program, and buzzer can be written in the Arduino IDE after the program has been written. All programs can be compiled and uploaded to the Arduino microcontroller. The Arduino Mega program as a whole can be seen in the attachment.
After the entire program on the Raspberry Pi terminal and the Arduino IDE has been written, the whole system is run by calling the program as below on the Raspberry Pi terminal: Sudo python main.py.
The program will command video streaming, and ultrasonic sensors run simultaneously as the program is executed. When the sensor detects an object within a radius of 50 cm, the camera will automatically take a picture of the thing and the sensor will measure the distance of the object to the system. Simultaneously, Arduino Mega processes data to send information to the SAR (Search and Rescue) team that piracy has occurred. The results of the photo of the object, the distance of the object, and the time of taking the picture will be sent to the database to be displayed on the web page. The overall test in this study was declared successful by running the main.py program on the Raspberry Pi terminal and the Arduino IDE.

Conclusion
The anti-piracy device on this ship can provide early warning to ship officers which is designed using a buzzer. The buzzer is connected to the Arduino Mega microcontroller. When the entire program is executed, then the sensor detects an object within a radius of 50cm, the buzzer will sound to notify the crew that a hijacking has occurred.
The design of an image capture system for objects detected by sensors can be applied to monitoring cameras using ultrasonic sensors by emitting ultrasonic waves to detect detected objects. This system can be designed to determine the distance between the detected object and the system on the monitoring camera using an ultrasonic sensor by emitting ultrasonic waves and calculating the emission time until the wave is received back by the sensor if an object is detected.
This device is designed to provide information to the center via an SMS gateway. The SMS text will be processed by Arduino Mega and sent using the SIM900 module to the BAKAMLA (Sea Security Agency) team. The Raspberry Pi is used to control infrared cameras and ultrasonic sensors. The process of reading the Raspberry Pi program makes the streaming video experience a delay of fewer than 4 seconds from the actual situation because the reading of the program passes data transmission to the laptop server to be displayed on the web.
Arduino is used to control the Neo-6MV2 GPS, RTC DS3231, buzzer, and SIM900. So that, the designed system can work according to the design. Based on the test results on the Arduino software, the program listing of each device used in this study was successfully uploaded to the Arduino hardware for 18 seconds due to the large number of programs uploaded to the Arduino. The camera in this study can be used for streaming at night because it has been installed with an infrared LED with an input voltage of 9 volts. The quality of the camera used is not clear when it is used for streaming during the day and night because the resolution of the camera used is 640 x 480 pixels with 3 cm focus distance. However, the conditions around the ship can still be monitored via the web.
Ultrasonic sensors are capable of detecting objects within a radius of 2cm to 400cm. In this study, each sensor is set to detect objects within a 50cm radius with an input voltage source on the Raspberry Pi, which is 3.3 VDC due to a voltage divider using a resistor.
Monitoring using a laptop as a server using XAMPP software to run localhost web. In web monitoring, video streaming can be fullscreen by clicking the fullscreen video button. Every 60 seconds, the video will exit fullscreen automatically because the monitoring web page will refresh automatically.