Detection of water quality in crayfish ponds with IoT

Received Sep 11, 2020 Revised Nov 17, 2020 Accepted Dec 3, 2020 Data from the Central Bureau of Statistics shows that during the first quarter of 2014 to 2019, the tendency of Indonesian crayfish export increases by an average of 3.54% in 2019 and reach 7.09 million USD. This number still fails to meet the global market demand caused by poor water quality due to cultivators’ lack of experience and education. Two parameters measured in water quality are temperature and pH. Thus, a device was made using IoT to maintain those conditions in order to increase the viability of the crayfish in the pond. The perceptron method is used to classify water quality based on those parameters. To send the data, ESP8266 is used as an intermediary for Arduino and cloud server. The result is that the information about the ponds’ condition can be seen via a smartphone. The method gives a value of 98.06% accurate in determining water quality.


INTRODUCTION
Crayfish is a fishery commodity that has an economic value and is already cultivated by the community. Besides having a high protein content, crayfish is also easy to cultivate. Crayfish is one of Indonesia's export commodities which has a tendency to increase from the first quarter of 2014 to 2019 with an average increase of 3.54% in 2019 reaching 7.09 million USD [1]. Up until now, there are more than 540 types of crayfish in the world and the number will keep rising as time goes by [2], Advantage of crayfish is that from its character, which is not stressed easily except for those on the dark places [3] and its immunity to disease as long as the needs of food, water quality, temperature and oxygen requirements are met, the craysfish can grow and develop quickly, and also has a high capability to lay eggs [4,5]. Crayfish cultivation can be a community business opportunity that can be done as an effort to improve home industry and community income. The community can make their own mini-ponds at home by using an aquarium or existing vacant spaces. The demand for crayfish is very high throughout the world and Indonesia has become the main global exporter of crayfish. One of the countries that imports crayfish from Indonesia is Czech Republic where this country was actually imports from various countries but starting in 2007, Indonesia has become the leader in importing crayfish where more than 80% of ornamental crayfish are imported from [6], not quite different with the Czech Republic, New Guinea also makes Indonesia as one of their main crayfish inportir [7]. This can be a starting point for the people to start crayfish cultivation business to fulfil the market demand or just for personal consumption. Water has an important role in this business because crayfish lives, grows and develops in the water. Good quality water will make them grow and develop well. Crayfish is best at the temperature of 21°C-25°C [8] but for the species from the tropical regions, the optimum temperature for growth is 24-30°C [9] although it still depends on its location. Most of the redclaw crayfish population can survive at 21-30°C [10], with dissolved oxygen 5.60 ± 0.9 mg/L, and pH of 7.12 ± Bulletin of Electr Eng & Inf ISSN: 2302-9285  Detection of water quality in crayfish ponds with IoT (Abdurrasyid) 887 0.21 [8]. Water quality must always be checked to ensure that no unwanted materials that exceeds the crayfish tolerance threshold. Declining water quality can be caused by several factors such as water sources, the influence of weather, settling crayfish lobes and others. Conventional methods can cause the growth of crayfish to be disrupted, thus a crayfish cultivator must be diligent in caring them to produce a good quality crayfish. An unusual monitoring to the water quality will cause the loss of the crayfish business. In this study the water quality parameters to be examined are temperature and pH. Temperature determines the degree of cold or hot water which influences the growth and survival of the crayfish. This is proven by research [11] where the temperature difference in crayfish maintenance influences the daily growth rate and survival rate of red claw crayfish seeds. The daily growth rate and survival of red claw crayfish seeds reached optimum at between 25-28.20 o C with a daily growth rate of 1.05% and survival rate of 85.93%. Whereas when the temperature is higher (32 o C), the value of the daily growth rate and survival drops to 0.79% and 63.33%. Low temperatures can cause the lobster to become inactive and reduce its appetite. In addition, low temperatures cause degeneration of red blood cells so that the process of respiration is disrupted. Conversely, if the temperature is higher, it will cause the crayfish's metabolic rate to accelerate so that the energy in the crayfish is used up for the metabolic process. Besides temperature, pH parameter also influences the growth and survival of the crayfish [12]. And the results of growth and best survival were obtained between pH 7-8 whereas with pH 7 and pH 8, the growth rate of the crayfish is low with a value of 0.02 gr. Inappropriate pH can affect the toxicity of other substances or chemicals. In addition, changes in pH can also cause the crayfish to experience stress [9].
Embedded system becomes an inseparable part of IoT, embedded systems can be enjoyed either by normal humans or who have deficiencies such as visual ability [13], for that embedded system knowledge must be an inseparable part in the activities of education in higher education [14], there have been many studies conducted by researchers in the field of IoT both in the field of Education, smart taxi in smart city [15], smart traffic lights that can help to reduce vehicles congestion on traffic lights [16]. In accordance with that matter, the researchers have used IoT in the field of agriculture and aquaculture. The research that was done by Lukito is using IoT to monitor the pH and temperature levels from the air which will be given to the hidroponic plants. The weakness of this research is that there is no action done when the water condition has a high or low pH and temperature levels [17], A similar research was done by Odey, conducted in 2013. The research conducted design and implementation of smart wireless mesh sensor networks for aquaculture, the drawback is because it is used only lightweight wireless, it cannot be controlled remotely and only reads input from sensors without any action done [18]. Another study was conducted by Chen in 2015 using GPRS Technology and MSP430f149 microprocessor to detect water quality using water level parameters, PH, temperature and oxygen levels, but the shortcomings of this study was that it only provide action to replace water and the technology used, and does not use the Internet, even though it is mobile based app [19]. The next research was done by Kılıc where the water quality was measured using pictures from cellphone. This method still has a weakness where the person still has to come to the pond and will also create some difficulties for the crayfish farmers [20]. The research carried out only wireless sensor networks design to monitor pH levels and temperatures without any action done when PH levels or temperature rises and falls [21], From all of the research that has been done before, aside from only reading input from censors, the lack of incorporating scientific methods used to measure water conditions, which become one of the factors affecting the efficiency of crayfish growth is experience and Education which should be developed with IoT in aquaculture.
The method used in this case is the perceptron method. Perceptron is a simple method of artificial neural networks. Perceptron is used to classify a type of pattern that is often known as linear separation. In this study, research that used perceptron method was conducted in 2012 which in this research, they only use one parameter (TDS) without involving pH and temperature that are essential in crayfish cultivation [22]. Also, in 2014 the perceptron method was also used to measure water quality using 3 parameters, i.e. pH, TDS and SAR, without involving temperature that actually becomes one of the most important things in crayfish cultivation.Here, there was no action done if they found a bad number on the water quality [23]. The next research was done in 2019 to measure water quality but was not used in measuring pond water quality. This research shows that perceptron method is good to measure water quality [24]. From the literature study of the researches that has been done above, it can be concluded that this study has novelty in terms of the use of IoT Technology in crayfish aquaculture by using the perceptron method in determining pond water quality.

RESEARCH METHOD
This study uses stages of the prototyping method that is well used to provide users with an understanding of how data travels through the system and solve problems between users and analysts which might be arising from the inability of the user to clearly define their needs [25]. This study will go through five stages: First, analysis of the system running in which from the results of the observations made that the temperature and pH checking of the water on the pond was still done manually by the crayfish cultivator. Temperature checking was done by inserting a thermometer into the aquarium and looking at the value of the temperature produced, and measuring pH was done using a pH meter dipped in water. From the interviews conducted, too low temperature can cause the egg hatching process to be long. At normal temperature, egg hatching takes around five weeks, whereas if temperatures are low, hatching can take seven to eight weeks. In addition, low temperatures cause crayfish activity to idle so that the appetite is not too large. This results in slow growth on the cryfish development. The pH itself also affects crayfish growth and their survival effort. In maintaining the crayfish, the value of temperature and pH are maintained in the range of 24 o C-30 o C and 6-8 pH so that the condition of the pond remains good.
Second, the analysis of the proposed system. From the results of the problem analysis it can be seen when the user wants to see the temperature and pH value in the pond, the user does not need to come directly to the crayfish pond. The value of temperature and pH in the pond can be directly monitored through the application in the smartphone. In addition to temperature control, if the water temperature is detected less than 27 o C, the heater will automatically turn on. If the temperature has returned to its normal temperature, the heater will automatically turn off. Similar with water conditions, if the water conditions are bad then the water pump will automatically work to replace the water in the crayfish pond. Determination of water conditions is determined by using the perceptron method to classify good or poor water conditions. Users can also control the heater and water change manually through the application on the smartphone. Temperature and water control are carried out so that the temperature remains in the optimal temperature and pH conditions, i.e. 25 o C-29 o C and 6-8 pH so that it can increase the survival of the crayfish. Figure 1 shows the tool scheme and how the data is sent from a sensor until it can be read on the mobile phone, especially on the android devices, where the data from the sensor is sent through an Arduino board then the internet connection will be read by wifimodule ESP8266 and sent to cloud, which on this research, uses thingspeak server, and finally sent to the mobile device, vice versa. Third, hardware designs. At this stage, the hardware needed are Arduino Uno, ES8266 module, temperature sensor (DS16B20), pH sensor, ultrasonic sensor, 4 channel relay, breadboard, water pump, Heater, the use of ultrasonic sensors which are commonly used to measure distances and Arduino as a data processor, where it was also used to help the blind in walking [13]. The design of the device starts with making a diagram block like DS18B20 sensor is an input used to read water temperature, while pH sensor is an input used to read water pH level. Arduino uno is used to control the running of all components connected to Arduino Uno. ESP8266 Module is a device that mediates between Arduino and cloud servers in the process sending and receiving data. Android is used as a client to monitor or control crayfish ponds. Relays function as switches to control devices such as water pumps and heaters based on orders from Arduino Uno. Ultrasonic sensors function to measure the distance from an object. These devices are used to measure water levels, while the design results can be seen in the series can be seen in Figure 3. Fourth, software design. At this stage, mobile application design is carried out, including implanting the perceptron method into a mobile application, the Perceptron method is used because it produces input -1, 0, 1, and one of the most famous prediction methods in artificial neural networks (ANN) [26], and has a high accuracy above 86% [27]. One method of having a high success rate in the recognition system is that Perceptron is proven by research conducted by Thepade in 2018 in recognizing face gender with successful rate reaches 99.658% [28], also Mishra in 2015 in detecting automatic extraction of water bodies from landsat imagery [29]. One of the factors that influence the success of the recognition system is the accuracy of selecting threshold values. The threshold is the value used to adjust the weight value of the single layer perceptron. Besides, threshold value can be used to show the maximum accuracy from the variables that will be tested [30,31]. In this research, threshold value is used to test the parameter so that it can show a maximum water quality. The perceptron training algorithm is: a. Initialize all weights and can determine the rate of understanding (=α). For simplification, usually α is given a value of 1, where α is the learning rate specified, initialization of weights can use (1): b. If there are input vector elements whose response unit output is not the same as the target, do: i. Set the activation unit input where S is the input vector with (2): ii. Calculate the response unit output where 'e' is the threshold specified by (3): iii. Refine the pattern weights that contain errors (y ≠ t) where t is the output target, according to (4), : Before determining the suitability of water requirements, the first step is to determine the weight and bias values. This value of weight and bias will later determine whether the water condition is good or bad. Here is the (6): where; X=input value; W=weight; b=bias After the weight and bias value can be obtained, the results will be used to determine water quality condition. The implementation is, if the result is equal to (-1) then the water condition is poor. Whereas if the result value is equal to (1), the water condition is good. This formula is placed on a mobile software, which work by processing input data from the sensor sent to the thingspeak server. In the application to be built there are five menus, namely the home menu, history menu, control menu and perceptron menu. The workings of the application in the temperature and pH control prototype on crayfish ponds are preceded by reading the data through the sensor by Arduino, which is then sent to the Thingspeak server. The data on the Thingspeak server is taken in the form of a json file which is then processed in the application.
The home menu displays the temperature, pH and the latest data updates that enter the Thingspeak server. The history menu displays a graph of the value of temperature, pH and water quality. The value of water quality in the calculation of temperature and pH using the perceptron method. On the control menu, there are heater control and manual water change display. Manual control can be done by pressing the on or off button. When the button is pressed, a data will be sent to the Thingspeak server and later the data will be read by Arduino to control the relay module. Whereas in the perceptron menu, display the perceptron calculation data based on the date order that the user wants. To make this application using an ionic framework and assisted with visual studio code for coding process.
Fifth is testing. Testing is done with two types of testing, the first test for temperature and pH sensors, where testing of these two sensors is done with four test scenarios, the first scenario, testing is done in an aquarium without including cfrayfish into the aquarium. The second scenario is testing the aquarium by inserting the crayfish into the aquarium. the first and second scenario tests did not use a temperature and pH control prototype tool that had been built in this study. The third and fourth scenarios are the same as the first

RESULTS AND DISCUSSION
The results of the device made by temperature and pH control prototypes on crayfish ponds have several supporting components that are connected to each other into the Arduino Uno as the control media of the operation of these devices. Figure 4 shows that is the overall appearance in the design of the prototype controlling temperature and pH on crayfish ponds. In this design, a sample of aquariums measuring 40 cm x 25 cm x 35 cm is used. For circuits packaged in such a way as in Figure 4. Where the circuit can be removed and installed in the desired aquarium. In Figure 5 is a DS18B20 sensor and pH meter SKU: SEN0161. DS18B20 sensor is a sensor that serves to measure the temperature in water. While the pH meter SKU: SEN0161 is a sensor used to measure the pH of water. These two sensors will be inserted into the water so that it can monitor the quality of water in crayfish ponds. Determination of good or bad water quality is determined based on the results of the perceptron calculation. Figure 6. Shows the Arduino Uno series which then connected to the wifi module (can be seen on Figure 7.) which is used to get the internet connection so that the data can be sent to cloud and finally can be read by the user's Android mobile device.  measuring the water in an aquarium is obtained from the aquarium which is input into the program minus the distance read by the ultrasonic sensor. Figure 9 is a picture of a 4 channel relay that serves to turn off or turn on a component connected to a relay. In the temperature and pH control prototype the crayfish pond uses only 3 channels of the existing 4 channels. The components connected to the relay are heaters and two water pumps. Figure 8. Untrasonic censor display Figure 9. Relay-circuit display After the next set of tools is made the stages of testing carried out on the sensor with four scenarios with the test results as shown in Figure 10. We can see at Figure 10, that the highest temperature was 30.13 o C and the lowest temperature was 28.5 o C. As for pH, the highest value is 12.89 and the lowest value is 6.88. And for the average value of temperature and pH ranged from 29.32 o C and 9.18 pH. In the graph, there is no decination in temperature beyond the optimal temperature limit because testing is carried out in closed spaces so that the room temperature affects the temperature in the aquarium.
The second test, which can be seen on Figure 11, shows that the highest temperature produced in this test was worth 30.5 o C and the lowest temperature was 27.5 o C. While for the highest pH value is 7.82 and the lowest pH is 5.5. For the average temperature and pH, they were 29.80 o C and 6.31 pH. In testing the second scenario, pH decreased from the second day to the third day, so that in this test, the crayfish were dead.
Based on previous experiments, the temperature reduction did not occur due to the influence of room temperature and weather conditions so that in the third experiment this was given stimulation in the form of cold water. When stimulated with cold water, the temperature obtained was 23.06 o C so that the heater turned on. It can be seen in figure 12 there was a process of temperature rise which is affected by the heater.
In this test, monitoring has been built so that water quality is detected based on temperature and pH parameters. This system will replace water automatically if the detected value is -1, which can be seen in figure 13. From this test, the highest temperature is 28.88 o C and the lowest temperature is 23.06 o C. Whereas for ph, the highest value is 8.08 and the lowest is 7. For the average temperature and pH for the test times it is 27.50 o C and 7.62 pH.
At this time, testing was carried out in a different room from the first to the third test so that the temperature obtained was more stable and did not need to be stimulated like the third test. In this test the writers got an obstacle in the internet network so that the data sent on the time server is inconsistent. Based on Figure 14 above, it is found that the highest temperature value is 29 o C and the lowest is 24.75 o C. The highest pH is 8.25 and the lowest is 6.42. For the average temperature and pH is 28.07 o C and 7.03 pH. This test can be compared with the second test where the temperature and pH in the fourth test averaged at the optimal temperature and pH. This happens because there is a process of controlling automation carried out by the microcontroller based on the value of water quality in Figure 15. After testing the sensor, the next is the accuracy testing of the perceptron method, using the calculation of the 7 th formula, the results are: The level of accuracy obtained from calculations using the perceptron method shows good results, meaning that the perceptron method can be used to help show the quality of crayfish pond. Although the perceptron method has been successfully implemented in the lobster pond's water quality measurement with the high accuration level, but there are some problems on the mobile aplication; the processing speed depends on the smartphone's resources quality, on the perceptron training level up until the results of stabil weight and bias patterns will need a bigger smartphone's resources. It is better that the perceptron's training process is done at the server so that it will not burden the end users in using their applications.

CONCLUSION
In designing the hardware, the devices used in temperature and pH control prototypes on crayfish pond are temperature and pH sensors as input parameters. Then it is processed by the Arduino system circuit, ESP8266 module and relay. In designing software in an Android-based application using an ionic framework. This application functions as an interface to see the value of temperature and pH on crayfish ponds and can control manually if desired, because the system has recognized the condition; if the temperature is below 25 o C, then it will automatically turn on the heater and turn off automatically when conditions are met, when the perceptron method shows that the water quality is poor so the pump will be active to replace the water in the pond to replace it with good quality water.
From the tests that have been conducted, the use of temperature and pH control prototypes in crayfish ponds is able to control the condition of the water to remain optimal. This can be seen by comparing the testing of two and testing four where in the second test the average value of temperature and pH is around 29.80 o C and 6.31 pH, whereas in the fourth test it shown 28.07 o C and 7.03 pH. The unique feature in this paper is not only using IoT Technology into aquaculture to detect it, but being able to automatically maintain water quality, especially in crayfish ponds, using the perceptron method in determining water quality. The quality was good shown in the third scenario testing that the accuracy value is based on 206 data entered was 98.06%. In the next study, additional parameters are needed such as dissolved oxygen, ammonia, nitrite, carbon dioxide (CO2) and turbidity of water, which can be included in the perceptron calculation, thus helping crayfish cultivators maintain their crayfish to help increasing the quantity and quality of their crayfish.
Indrianto, born in Jakarta. He completed Elementary School to High School in Jakarta and then continued his undergraduate study at STMIK Jakarta majoring in Computer Engineering until 1999 and then continued his Master degree in Gunadarma University and graduated in 2004. He is also active as a supervisor of practical work and thesis in the undergraduate program at IT-PLN Jakarta. He also actively does some researches which in 2013 and 2014 received a novice lecturer grants from DIKTI, and from 2015 -2018 received competitive grants for applied research, also from DIKTI. Presently, he is actively writing in some Scopus indexed journals. He wrote 8 Scopus indexed journals and 49 local and national journals in Informatics Engineering with h-index 2 and Google Scholar index 3. In addition to the above activities, the writer has also conducted computer application training for village officials for the West Jakarta area. Currently, he serves as the Head of the Institute for Research and Community Service at IT-PLN Jakarta.
Meilia Nur Indah Susanti, was born in Jakarta. She finished her elementary school until high school in Jakarta and then continued his undergraduate study at Gunadarma University majoring in Information Engineering until 1998. She continued her magister study at the Indonesian Benarif College of Information Technology and graduated in 2005. In 1999, she began teaching at IT-PLN Jakarta and was appointed as a permanent lecturer at IT-PLN Jakarta in 2000. She is also active as a supervisor of practical work and thesis in the undergraduate program at the campus. She is also active on the website editorial board and the editorial board of the "PETIR" journal. She received novice lecturer grants from DIKTI in 2013 and 2014, and received competitive grants for applied research, also from DIKTI from 2015 -2018. In that sense, she is also actively writing several journals for the editor and some Scopus indexed journals. She wrote 8 Scopus indexed journals and 34 local and national journals in Informatics Engineering with hindex 2 and Google Scholar index 4. In addition to the above activities, the writer has also conducted computer application training for village officials for the West Jakarta area. Currently, she serves as the Head of the Department of Informatics Engineering at IT-PLN Jakarta.
Yudhi S. Purwanto is a lecturer at IT-PLN Jakarta. He holds two magisters, i.e. in Management and Linguistics. Apart from his daily teaching activities, he loves to try new things and exploring new skills and knowledge. He believes that a knowledgeable and skillful lecturer will give a great impact to the development of the students. Currently, he actively makes some research related to his fields, and also establish some join research with his fellow lecturers from some other fields, especially from Informatics.