Performance Analysis and Automatic Prototype Aquaponic of System Design Based on Internet of Things (IoT) using MQTT Protocol

- The Aquaponic is a farming system which need attention because their system will mutually influence each other. Then using IoT technologies, can be made aquaponic that can automatically control and monitoring the aquaponic. The prototype using nodeMCU as a microcontroller, and for communication the system using MQTT protocol and android application as a user interface. The purpose of this research is to provide convenience for aquaponic user to be able to control remotely. In addition, this research aim is to analysis the QoS performance of the prototype. This research uses 2 scenario testing, there is with changing the distance between sensor nodes and access point, and testing the system in a normal state. Based on the results of the testing that has been done, the farther the distance range of the sensors node with access point then declining system performance. But in the normal state test, the median value of the mean delay was 0.10512s and the median value average throughput was 566 Bytes/s. In addition the median value also obtained the mean availability and realibility system that is 98.258% and 98.204%. Refers to the standard TIPHON (DTR/TIPHON-05001), the QoS performance of this system include excellent category.

I. INTRODUCTION Aquaponic is a system of cultivation which combines elements of the circulation of aquaculture and hydroponics [1].But aquaponic need attention as well as regularly monitor the aquaponic.This is certainly going to be barriers to certain circles who not have much time to spare.So, there is necessary to provide a system to bring ease for the user to take care of their aquaponic.
Internet of Things (IoT) is a technology that can connect all the physical device to the internet and make a device able to store and exchange information to meet specific objectives within a specific context [2].IoT is a technology that can connect a device that has a low power, such as a microcontroller, sensors.These devices may get the power supply from batteries, or solar panels.To be able to connect the device via local network or the internet have own challenges.So, the connectivity on the network must be pressed in order to be able to save power.IoT have wireless communication.The disadvantage of wireless communication is the topology may change, so we need the communication protocol to guide the communication in the network [3].
MQTT (Message Queue Telemetry Transport) is a communications protocol that implement publish/subscribe architecture to give the topic to broker and have low power consumption [4].By combine IoT technology and MQTT protocol, we can create an automation aquaponic prototype that can be used to perform the monitoring and control of actuators and do it automatically by using ultrasonic sensors, sensors, pH, water temperature sensor (DS18B20), relay and servo.When the level of water is under the optimal level, the ultrasonic sensor will open the selenoid valve on the relay to do the filling of water.
When the pH of the water is too low or too high, the micro servo will unlock the pH up or pH down.When the water temperature sensor detects a temperature that is too low, then the relay will switch on the lights.These tasks can be done by automated means and arranged by nodeMCU.The data obtained from nodeMCU will be sent to the broker MQTT and then the user can perform monitoring through android applications.So users can monitor the condition of aquaponic from anywhere and anytime using applications on their smartphones.The prototype is expected to provide ease and help users in cultivating aquaponic from far distance.
In the journal [5], they made research to designed aquaponic automation which can measure the level of pH and electroconductivity of the water.They are used TCP protocol and used web server as user interface.The result of their research that made automation and monitor the pH level of fish and plant.In addition they get the accuration of pH sensor.Then, in the journal [6].They made aquaponic designed with growbox.In this system performed automation to used fan and water replenishment automatically by parameters of the humidity and temperature of the plant.They made 2 mode for smart aquaponic, that is automatic mode and manual mode.They are get the measurement of air humidity, temperature, and soil moisture.That measured can get from communication between server with hardware and communication between server with user.The result is automatic mode can work better than manual mode.
In addition, research on [7] they are analyzed MQTT protocol on Smart building based on OpenMTC platform.They implemented the system on the WAN topology.They are used delay and packet loss to the parameter test.The result was delay for send the data used MQTT protocol have good quality for delay value, and the percentage of send the data used MQTT protocol is 100%.Then in the project [8], they made project to automate and monitor the greenhouse with sensor using LoRa.They used sensor to measure temperature, humidity and water level.The result is they can make that system can make data storing, and data visualization.In addition, they suggest the project future, there is for automatisation, security, mobile app, docker and easy node registration.In the paper [9], they made some research to make comparison between CoAP protocol and MQTT-SN protocol in Robotic Applications.The result was MQTT shows a 30% better transmission time over CoAP.
In this paper, we make Automatic Prototype Aquaponic of System Design Based on Internet of Things (IoT) using MQTT Protocol.We have done measure the accuration of the sensor.We are use delay, throughput, reliability, availability, and PDR for parameter test.The scenario to measure the parameter test is divided in 2 communications, that is communication between sensor node with broker and broker with the android application.In addition, we made android application for user interface, so user can monitor the aquaponic condition by android application.

A. Aquaponic
Aquaponic is a farm system that combine aquaculture with hydroponic [1], where the water from the fish tank contained nitrate nutrition of fish feed and fish erection are used for plant growth.Sediments from aquaculture system in the form of the rest of the fish food and fish contained ammonia which can lead to decreased levels of dissolved oxygen and retards the growth of fish [10] (in Fig. 1.).Fig. 1.Aquaponic System With Water Culture Method [11] The biofilter becomes the place for bacterial nitrification can be added to the aquaponic to change ammonia into nitrate erection that can be used at the plant, as well as the aerator may be added which sends the air into the water so that the plant can breathe.According to research [10], selection Ipomoea aquatica as the plant to aquaponiccan effectively absorbs excess nutrient elements in the water, and more number of the plants on system will reduce the concentration of ammonia.In addition, because of water tank of the fish is very important, it is necessary to note the temperature, oxygen levels, and pH of the water so that fish or plants can be grow well.

B. Message Queue Telemetry Transport (MQTT)
MQTT is one of communication protocol of IoT which implement publish/subscribe architecture [4].As you can see in the Fig. 2, MQTT have broker to be the center of controlling to distribute data to all device that connect to the broker [12].Broker will receive data from sensor node using publish and subscribe topic.After that, publisher sends the information through the topic to broker.Communication between publisher and subscriber will stay connected as long as they keep the same topic subscription [13].So, communication between publisher and subscriber can be occur through the broker.MQTT is not suitable for peer to peer communication [9].
Actually, a broker has 2 functions in this protocol.They are for space decoupling and time decoupling.Space decoupling is to connect publisher and subscriber, because they do not know existence of each other.Whereas time decoupling is to make publisher and subscriber must not be connected at the same time.So, when subscriber disconnect to the broker, publisher still connect to the broker and when subscriber reconnect again to the broker, they still can get the data from broker.MQTT is a protocol that working in stack TCP/IP, has low bandwith, and has low overhead packet data size [14].That make MQTT has low power consumption.But when the network getting larger, MQTT needs broker center to control the system and it will give effect to the scalability of the network because of overhead [15].

C. Internet of Things (IoT)
IoT connected all of the physical device to the internet and store the data to make the device change information each other to some goals and some contexts [2].VANET (Vehicular ad-hoc networks) is communication technology between vehicles and with the development of intelligent transport systems applications [16].The purpose of the IoT is to make human life easier To get that purpose, the device must know what is user want and need.To run that function, then it takes some element of IoT to implement that function.These elements are divided into several categories, there is identification, sensing, computation, communication, service and semantic [17].In the process of connecting everything on the system, IoT can be devided in many type of communication [18], there is: a) Device-to-Device Communication, is the communication between 2 or more devices that exchange data.This communication model sends small information data packets between devices that the data rate relatively small.b) Cloud-to-Device Communication, that communication when the device is directly connected to the internet cloud service to exchange data.This communication model can be used to access the device remotely.c) Device-to-Gateway Communication, there is intercultural communication device through a gateway which connected to the internet cloud service.Gateway is a piece of hardware on the network that connect different network protocols.
d) Back-end Data Sharing, is communication that shows users can send and analyze data from several internet cloud service.This communication model also provides 3 parties permission to access data devices.

D. Tools and Material Used
To be able to implement automation aquaponic prototype needed some hardware consisting of nodeMCU, pH sensors, ultrasonic sensors, DS19B20 sensor, relay, micro servo, selenoid valve, and lamp that would later be integrated in accordance with its functions.In addition it also need software android studio to make android application, arduino IDE to make the source code, and wireshark to capture and analysis the network.That system placed on the aquaponic system that has been created using rafting method.

E. Performance Test Parameter
This journal using some of test parameter to find out the performance of the network between our prototype, there is: Delay is total of time it takes to transmit a data from source to destination [19].The units used are seconds, with the following formula in (1): In (1), tRX represents the total time to data arrive in the receiver, and tTx is time to source send the data.

b) Throughput
Throughput is the average speed to data transfer to send data arrive to receiver in particular observation interval [20].The unit used is Bytes/s which is the conversion of bit/s, with the following formula: In (2), rxData represents the total data that arrive in the receiver, and t is total of time it take to send the data.

c) Sensor Accuracy
Sensor accuracy is the test to compare the result of measurements of the sensors with the measuring instrument.The goal of this testing is to prepare the sensor to be worthy to be used [20].

d) Availability
Availability is the ability of a system is ready to operate at the time required [21].In other words, availability is the availability of the system.Availability consists of uptime is the time when the system is in a state of optimal, while downtime is the time when the system is in a state of getting error in shipping packages.
133 Jurnal Infotel Vol. 10  Reliability is the ability of a system to meet the required functions on certain conditions and in certain time [21].As avilability, reliability also consists of uptime and downtime with the same understanding.
f) PDR PDR (Packet Delivery Ratio) is a comparison between the number of packages that were successfully delivered to the destination and the total number of packets transmitted by the source [22].The formula for PDR is : In ( 3), rxPackets represents the total packet that arrived in the receiver, and txPackets is total packet that send from source.
We measured all that parameter in the 2 communication.There is communication between publisher with broker, and communication between broker and subscriber (In Fig. 3).

F. Method of Testing System
This journal will testing of the design which was later carried out an analysis of the result of the realization of the design that has been worked on.Testing will be done as follows: a) Functional of hardware test Functional test was performed to observe whether the system has been made already well-integrated, and whether the system is already working in accordance with the workings of the planned system.b) Sensor accuracy test to find out the feasibility of the sensors to be used.So the sensor can work well and reduce the erorr against hardware when it has done the design further.c) Distance Rangeof Sensor Node Test The purpose of this testing is to find out what the maximum range between the sensor nodes with an access point.measurementis to find out how the reliability and availability of the system when there is a change of distance.4. The overall System Testing.The purpose of this test is to find out how the quality of the entire system without the distance scenario.In other words, this testing is done on the normal state of the system.This testing is done using parameter delay, throughput, reliability, avalibility, PDR between sensor nodes up to the application on the client.

A. Functional of Hardware Test
In this test, the device that observed the integration is NodeMCU, ultrasonic sensor, DS18B20 sensor, pHsensor, relay, and micro servo.

Functional of Hardware Integration
Integration between nodeMCU with micro servo to adding fish feed Successful Input power supply accordance with device need Successful

B. Sensor Accuracy
The purpose of this testing is to find out the feasibility of the sensors to be used.This testing is comparing the result of measuring ultrasonic sensor with ruler, DS18B20 sensor with HTC-2 Thermometer, and pH sensor with ATC pH meter.This testing is repeated in 30 times using different conditions to get the variation data.

C. Distance Range Testing of Sensor Node
The way to testing the distance range is doing by giving the distance between sensor node with an accsess point.This test has been done without obstacle.

E. The Overall System Test
This test is done with 30 times testing every 3 minutes and use 1m for distance between sensor node and access point.The parameters test used is delay, throughput, availability, reliability, and the PDR system.

IV. DISCUSSION
In this chapter discuss about results of the test that have been designed.Then analyzed the result of implementation of designed.From Table 1, show the result of functional of hardware that all of the devices have been integrated well and they can run the function as well.When the sensor accuracy tested, the value of average error of each sensor still within the limits of error tolerance that specified on the datasheet of each sensor.So, the sensor can be used and the function can run as well.
In the Fig. 4 it can be seen that delay increased when the distance between sensor nodes with an access point increase.Refers to the standard TIPHON (DTR/TIPHON-05001), at a distance of 10 m the delay value includes medium categories, i.e. in the amount of 300ms -450ms.But at a distance of 20m up to 50m, the value of delay includes bad categories.In addition, when the measurements at a distance of 50m, sometimes connection get loss so this is to make delay in 50m is the biggest delay, there was 0.833778s.
In the Fig. 5 and Fig. 6, throughput in the 10m and the farther the distance between sensor nodes with access point then throughput obtained will be getting smaller at a distance of 50 m.With reference to the standard TIPHON (DTR/TIPHON-05001), throughput value at a distance of 10 m to 30 m still includes very nice category, i.e. ≥ 100bps.But at a distance of 40 m, the categories decreasing until categories include good throughput, i.e. of 75bps until 99bps.
At a distance of 50 m, the lower the throughput value includes medium categories, there was 50bps -74bps.It is inversely proportional to the delay that is increasingly enlarged if the distance continues to grow.In addition, at a distance of 50m, frequent loss of connection at the moment of measurement.It because the farther the distance between sensor nodes with an access point, then the existing bandwidth between sensor nodes and the access point will be getting smaller.Hence the internet connection speed also increased and it less package was successfully delivered.
It can be seen in Fig. 6 that delay at a distance of 10m and 20m including medium categories are if refers to the standard TIPHON (DTR/TIPHON-05001), which amounted to 300ms -450ms.At a distance of 30m, the value of delay rose by 0.0587s of the value of the delay at a distance of 20m to 0.4872s.Hence at a distance of 30m, the value of the delay included on the worse category.Furthermore, the increasing distance between sensor nodes with an access point, the value of the delay between the broker with the android client gets bigger.This is because the data from the sensors node is too late to arrive in brokers and it make the result of the value of the delay between sensor nodes with brokers get bigger when the distance between the sensors node with access point increased.So, broker will generate an increasingly large delay for sending data to the android client.
Actually, the relationship between the broker with android used data center bandwidth of VPS.The distance between them will not affect the throughput and delay, but because of the sensor nodes up to the broker are affected by distance and when sensor nodes were placed at certain distance from access point then get bad value of throughput and delay.It makes the amount of data received broker declined, so the amount of data received by the android client will also in less throughput and In the Fig. 8, Fig. 9, and Fig. 10 it can be seen in the distance 10m until 30m the availability, reliability and PDR still get normal percent, that is ≥ 95%.But in the distance 40m and 50m quality of network getting low, then the less data that can be sent successfully.But when the overall test, every parameter getting best value.So, it reaches best category when the system in the normal condition.

V. CONCLUSION
Based on the test results, we made the prototype of aquaponic automation.The optimum distance between sensor node and access point is around > 10 m and the maximum distance is 50m.Therefor we can conclude the distance between sensor nodes with an access point will affect the value of the delay, throughput, reliability, availability, and PDR at both between sensor nodes with a broker as well as between the broker with the android apps to get worse.It means, farther distance between sensor nodes and access point, then parameter values are increasingly incompatible with the standard.But when the system is not using the scenario of a distance, then the optimal parameter values obtained.

Fig. 2 .
Fig.2.MQTT SystemThe way how MQTT works with simple system is subscriber only receive the information from broker when they already subscribing the topic.

Table 2 .
Average Sensor Accuracy

Table 3 .
Distance Range of Sensor Node

Table 4 .
Average of Overall System Test