IoT Based Smart Betta Fish Monitoring system with fish fatality prediction.

This study enlightens the importance of rearing water quality to Betta fish health. A water quality monitoring system was developed based on water quality parameters namely water pH, temperature (°C) and TDS level (ppm). Fuzzy Logic Algorithm was applied to predict the possibility of the fish to get infected by the disease using combination of the water quality parameters value. Graphical User Interface (GUI) was developed to test the efficiency of the fish disease prediction system using fuzzy logic algorithm before the fuzzy rule been embedded to the IOT system. Arduino Uno Wi-Fi R2.0 and Blynk Apps used for enabling the system to update the aquarium water quality to owner in real-time. Hydroponic technology implemented in this project for recirculate rearing water inside the fish tank. Theoretically, the aquaponic system will help regulate the water tank parameters in optimum range and Betta Splendens should be free from all diseases.


Introduction
Siamese Fighting fish, or Betta Splendens, is a small and fragile ornamental fish that requires special care from its owner.The factors such as water pH level, Ammonia concentration and dissolved Carbon Dioxide must be in teleost recommended ratio as the excess of these elements may turn poisons to the Fish [2].Water quality issues are the main element and must be changed regularly to maintain fish health.In addition, the increasing or decreasing of water pH level and water temperature are not detected by naked eyes.The changing pH level is related to the concentration of ammonia in water, with fish feed being the primary source of ammonia.This project was collaborated with Changlun Betta Fish Farm to find solution for address the current issue facing by fish farm.One of the best ideas to overcome this issue is to develop a real-time water quality monitoring system where the owner can track the condition and quality of aquarium water in real-time.Since water is the main element in rearing Betta Splendens, aquarium maintenance actions by replacing rearing water regularly may consume a lot of water source and lead to source sustainability issue.Instead of just removing the wastewater from the aquarium, it can be used for plantation purposes, where this waste is full of needed nutrients for plants.Hence, these plants may act as biofilters to filter out toxic waste from wastewater and recirculate clean water back to Betta Splendens' water tank.Betta Splendens is known to be fragile and sensitive to their surroundings, and failure of the system function frequently causes the rearing fish to fall into dangerous situations.To address this issue, monitoring should be intelligent and managed to predict the current water condition to fish health.

Literature Review
Betta Splendens or Siamese Fighting Fish in global demand is increasing yearly; this can be seen from high exportation rate of ornamental Fish producing countries such as Sri Lanka [1].High commercial in the global market was led to several inventions of this ornamental fish breed techniques.However, the record of larval mortality in the production stage is still high due to water quality issues, nutrition, substrate, pathogen and stress.From the research, water hardness adversely affected the reproduction of Betta Splendens because of low hatchability and disturbed bubble nests [3].Water quality plays playing an essential role in growing this ornamental Fish.According to the research, the preferred minimal water volume for individual male fish rearing is 150 ml, while the suitable water Potential of the Hydrogen (pH) value is between 6.5 to 7.5 [4].At the same time, the optimal rearing temperature range is from 25 °C to 27 °C [5].Hence, aquarium water quality is important in rearing Betta Splendens or Siamese Fighting Fish.
Waste generation from aquaculture has become public sustainability concern.According to the report, Japan's aquaculture production yields a high rate of waste production for fish culture, which is 0.8kg of Nitrogen and 0.1kg of phosphorus on average per 1 ton of Fish.Due to this, Recirculating Aquaponics System (RAS) was invented to overcome this issue.The technology consists of two elements Aquaculture and Hydroponics plant production [6] in a recirculating system.Hydroponic is an agricultural technology of glowing plants with soilless where the plant only obtains nutrients from the water.The system work by recycling the water and balancing nutrient generation from fish waste uptake by the plants to achieve good water quality [7].pH values decrease corresponding to the acid produced by nitrification of ammonia which is excreted by fish [8] and fish feed [9] is the main source.Recommended pH range for plant cultivation is around 5.5 to 5.8, while the optimal pH for nitrification ranges from 7.5 to 8.0 [10].Fuzzy Logic Algorithm is common method used for solving decision-making problems.From previous research, Fuzzy Logic was integrated with a Rule-based system for monitoring Pond Water Quality [24].Fuzzy Logic is a form of artificial intelligence software widely used in the automation field for decision-making purposes.This algorithm can perform Human-Like Automated Decision-Making and managed to launch the accuracy as higher as 74.7% in previous project research [11].The fuzzy control performs well even when its parameters change since it is nonlinear and adaptive.Uncertainty and ambiguity play a significant role in modern control systems.In this case, fuzzy control systems give control through a collection of membership functions (MFs) quantified from ambiguous phrases in control rules.Without needing a mathematical model for the controlled system, this algorithm modifies the system input to get the intended output by simply looking at the output.An efficient visual fuzzy logic tool is created in MATLAB's graphical user interface (GUI) environment to demonstrate these effects spectacularly [12].

Methodology
Figure 2 shows the overall process flow used for developing IoT Based Smart Betta Fish Monitoring system with fish fatality prediction.10 Betta Splendens were use in this project since this species is famous among market global and wilder than others species.To obtain an optimum result, 3 months betta fish were provided in each experiment.This project flow was divided into two parts, consisting of an Experimental Analysis part and Fish Fatality Prediction part.The analysis was performed through the experimental method to investigate the Recirculating Aquaponics System (RAS) efficiency on Betta Fish Water Monitoring System.The system was developed without integrating the Internet of Things (IoT) application.The sensor's reading will be manually recorded four times per day.Several steps were taken to evaluate the RAS system's performance on the Betta Splendens fish tank.The first experiment was performed using the traditional method where users require changing fish water regularly.The second experiment was implemented using the RAS system using water spinach as a hydroponic plant.The experiments were performed for one week because 1 Betta fish was fatal on day 7 in experiment 1. Hence the duration of both experiments will only consult for one week to examine the efficiency of the RAS system.Data collection from both systems was further used for the fish fatality prediction stage.This process was implemented using MATLAB App Designer-based Fuzzy Logic Controllers to predict the likelihood that Betta fish may be infected the disease.Figure 1 show the example picture of Betta Splendens.

Result
Figure 3 illustrates the comparison of pH value changing for both Without RAS and With RAS system; the graph clearly explains the existence of water recirculating manage to regulate ammonia concentration inside the fish tank and control water pH at an optimum level compared to the system without RAS.While Figure 4 explain the changing rate of the TDS parameter for both systems, as shown in the graph, the value of TDS for the RAS system is under controlling condition, which means the total dissolved solids of water are between the acceptable range for Betta Fish to survive compared to the system without water recirculation where the TDS level is out of control at day six.A comparison of the water drop rate of both systems is displayed on the graph Figure 5, where the RAS system consumed more water than the system without RAS.This is because the water loss in the system without RAS is only due to the water evaporation process.For the system with RAS, the water loss aspect is not only due to the evaporation process but also required for the water spinach growing process.6 below shows the result of the fish risk prediction step in MATLAB App Designer according to the Fuzzy Logic Algorithm.The output result will be interpreted from parameters of water quality inside the Betta fish tank using the Fuzzy Logic Rule that was fixed.Three indicator lights indicate the current condition of the water quality level in the fish tank based on the inserted inputs.Hence this rule will further apply in IoT Based Smart Betta Fish Monitoring system with fish fatality prediction.

Betta Fish Monitoring System using IoT with Fatality Prediction
This part will discuss the result of the full implementation of IoT in the Betta Fish Monitoring System with fish disease prediction feature.Blynk Application used to display the current condition and predict the percentage of risk possibility in Betta Fish Tank. Figure 7 illustrates the flowchart for IoT Based Smart Betta Fish Monitoring system with fish fatality prediction.Figure 8 shows the system's configuration, and the functionality of the Blynk Application in the project.Blynk will display the current water quality condition inside the Betta Fish tank.Hence this system benefits the user by indicating the real-time condition of the Betta fish tank and unrequired to monitor it manually.

Conclusion
Aquaculture requires careful water quality monitoring since farmed Fish are particularly sensitive to changes in parameters like gas presence, pH, temperature, and poisonous chemicals.Therefore, to preserve the Fish's best possible health and production, the water quality must be regularly examined and managed.This project aims to develop an IoT Based Smart Betta Fish Monitoring system with fish fatality prediction specially designed for Betta Splendens.The project was conducted for one year for research and hardware implementation; then the product was applied in actual Application to examine the functionality and effectiveness of the system.
The project development was run through several analysing steps, system design and hardware implementation to launch the best project outcome.Two experiments were conducted to investigate and compare both systems' effectiveness of Recirculating System (RAS) according to sensor reading.Afterward, both systems' results were used to analyse and establish fish fatality prediction.The prediction was performed using MATLAB Graphical User Interface based Fuzzy Logic Controllers, then applied to a water quality monitoring system to predict the risk of current conditions in the fish tank based on water quality parameters.Integration of the Internet of Things (IoT) enables users to instantaneously access and update the fish tank conditions.The final product was applied and worked well in the actual Application.
The collaboration with Changlun Betta Farm is aimed to identify and figure out the solution for current problem facing by Betta farm.Implementing experiment results not only provides guidelines for creating a fish illness prediction procedure, but also gives Betta Farm an idea for a second source of income beside to their aquaculture business.However, the limitation of this project is the lack of sensing tools, for example, Water Dissolved Oxygen Sensor, to indicate the oxygen level in water since oxygen is an essential element for the survival of fish and other aquatic organisms.Additionally, this system is not intelligent enough to trigger the user regarding step should be doing for encounter the current issue.In the future, the product advises applying more sensors such as Water Dissolved Oxygen Sensor and upgrade the system features in order to improve the monitoring system's performance.

Figure 6 MATLAB
Figure 6 MATLAB App Designer result

Figure 7 7 Figure 8
Figure 7IoT-Based Smart Betta Fish Aquaponic Monitoring system with fish disease prediction

Time Comparison of TDS value (ppm) changing rate between Without RAS and With RAS
Comparison of Water Drop Rate Without RAS and With RAS 4.1.Fish Fatality Prediction Figure 5 Figure 5