Controlling Unmanned Surface Vehicle Using MQTT Protocol

-The communication system at USV is the most important part of ensuring that the USV control system runs well. Communication systems that are commonly used at USV are generally still local networks. The development of a wider range of communications is needed to improve USV scalability so that the benefits can be increased to support the concept of remote laboratory and remote surveillance. USV is generally controlled using a wireless network with a limited work area using WIFI or using another electromagnetic waves transmission. This research proposes the development control and monitoring systems of USV to be controlled over the Internet by using the message queuing telemetry transport(MQTT) Protocol. This idea makes the USV can be controlled remotely, no longer have to operate it in the field. The control speed response of rudder and motor are analyzed. Performance monitoring of the compass sensor, GPS, and cameras also showed good results. As a result, the average delay time generated is 1.6 second.

approach for student learning processes [15][16][17]. This research can help researchers and students in the field of environment who focus on water problems to make observations and retrieve data remotely. Institutions that do not have equipment can also use it with the remote labs share concept. The USV remote can also be used to assist the military and security sectors to carry out security patrols and surveillance which can be done remotely from the head office.

Materials and Methods
The main objective of this paper is to develop USV control system using MQTT Protocol. The system built is divided into three layers, namely Hardware Layer, Server Layer, and Application Layer. Figure 1 describes the hardware design consisting of sensors, controllers and gateways. We use two different controllers to optimize computing load. Arduino Uno handles interactions with brushless motors and servo motor. The Arduino Uno contains a program used to control the actuator. The program will read serially transmitted data from the gateway using Python. The data sent includes an order to move the brushless motor actuator and servo motor. The servo motor functions to move the webcam camera to the angle that the user wants. Arduino Mega contains a program that is used to process data obtained from the sensor and then sent to the MQTT broker through the gateway.

Server Layer
At this layer, we use the MQTT Broker Mosquito. The server uses a virtual private server (VPS) with technical specifications in table 1.

Application Layer
MQTT protocol has a small packet data size compared to other protocols such as HTTP [18][19][20]. It is suitable for real-time applications. MQTT working with publish/subscribe concept. MQTT broker is required to establish communication between users called subscribers and publishers. Users communicate with each other by publish data to a topic prepared on the MQTT broker. Users who act as subscribers will retrieve data on the specified topic. In this case, user and USV act as publisher and subscriber. Users publish control commands via topic /rudder navigation and /motorspeed. MQTT Brokers receive messages and forward messages to USV who have subscribed to the topic /speedmotor. The message received by USV is the parameter used to control the motor speed and direction of the rudder ordered by the user. USV also acts as a publisher that sends sensor data to topics /gpssensors and /compassensors. MQTT Broker forwards the data to users who have subscribed to the same topic.
In this layer there is a web interface application created using HTML and Javascript programming languages. The appearance of the interface can be seen in the following figure 3.

Journal of Computer Networks, Architecture and High Performance Computing
Journal  The web interface design consists of a USV rudder direction navigation panel, a navigation direction of webcam panel, a speed control panel, an orientation panel of USV, USV location panel, and a video panel that displays real environmental conditions. This application runs using the MQTT Javascript library called Eclipse Paho.

Results and Discussion
For the first test, USV is controlled by web interface without showing the webcam. In Figure 4, it appears when the forward button on the web interface is pressed, the position of the rudder will be straight indicating that USV moves straight. In Figure 5, it appears when the right button on the web interface is pressed, the position of the rudder will move to the right, indicating that USV turns to the right. e-ISSN 2655-9102, Volume 1, No. 2, Juli 2019, pp 21-28 www.iocscience.org

------------------------------------------------------------------------------------------------------------------------------------------------------25
Journal  In Figure 6, it appears when the button for the webcam is pressed to the front to make the webcam position turn towards the front. In Figure 7, it appears when the button for the webcam is pressed to the right to make the webcam position change towards the right. In Figure 8, it appears when the speed control on the web is set at speed 60, making the USV propeller rotate. This test also shows the compass sensor and GPS running well.  In Figure 9, the web interface displays data from the compass sensor, which is shown by a USV image that can move according to the angle value that appears. Besides that, the web interface also displays the USV position in the map with the latitude and longitude values according to the GPS sensor readings. Data in the compass and GPS section will be updated once every 1 second. In Figure 10, shows when USV undergoes testing in water. USV can respond to commands given by users through the web interface quite well. The following is the USV communication delay time data using the MQTT protocol. In table 2, the command delay sent from the user shows an average of 1.6 seconds.  Testing the entire system using the web camera is shown in Figure 11 as follows.

Conclusions and Future Work
The use of USV to solve problems in the military, security and research sectors is still constrained by USV control capabilities that can only be controlled at close range. This research proposes the development of USV control via an Internet network. The increase in USV's capabilities can benefit the emergence of remote laboratory concept that can be utilised by academics and remote patrol surveillance that is utilised by the military and security sectors. The MQTT protocol as one of the protocols used in the internet of things application was implemented in this project. MQTT is suitable for remote applications controlling and monitoring because it has small data packets that meet the needs of real-time data communication.
This research can be further developed by adding USV facilities that support remote laboratory needs such as the environmental sensors and machine learning algorithm for solving task complexity in water area [21]. Regarding communication, development needs to be done by comparing with other protocols that are developing and used in the Internet of Things application.