Smart Low-Cost Control System for Fish Farm Facilities

: Projections indicate aquaculture will produce 106 million tonnes of fish by 2030, emphasizing the need for efficient and sustainable practices. New technologies can provide a valuable tool for adequate fish farm management. The aim of this paper is to explore the factors affecting fish well-being, the design of control systems for aquaculture, and the proposal of a smart system based on algorithms to improve efficiency and sustainability. First, we identify the domains affecting fish well-being: the production domain, abiotic domain, biotic domain, and control systems domain. Then, we evaluate the interactions between elements present in each domain to evaluate the key aspects to be monitored. This is conducted for two types of fish farming facilities: cages in the sea and recirculating aquaculture systems. A total of 86 factors have been identified, of which 17 and 32 were selected to be included in monitoring systems for sea cages and recirculating aquaculture systems. Then, a series of algorithms are proposed to optimize fish farming management. We have included predefined control algorithms, energy-efficient algorithms, fault tolerance algorithms, data management algorithms, and a smart control algorithm. The smart control algorithms have been proposed considering all the aforementioned factors, and two scenarios are simulated to evaluate the benefits of the smart control algorithm. In the simulated case, the turbidity when the control algorithm is used represents 12.5% of the turbidity when not used. Their use resulted in a 35% reduction in the energy consumption of the aerator system when the smart control was implemented.


Introduction
Aquatic food consumption has increased substantially, reaching 158 million tonnes in 2019 [1].Specifically, fish consumption increased by 122% from 1990 to 2018.This increase in consumption cannot be addressed by an increase in fish captures as it would maim the sustainability of the most consumed species as well as the marine environment.Therefore, aquaculture has the most potential to address the growing need for fish as a source of animal protein.A total of 87.5 million tonnes of fish were farmed through aquaculture in 2020, combining both marine and inland waters.However, even though most regions of the world presented growth in fish production through aquaculture, production in Africa decreased.Asia remained as the most productive region, with 91.6% of the total fish production in the world.Furthermore, the growth in aquaculture is expected to continue and reach a fish production of 106 million tonnes by 2030, 202 million tonnes, with the addition of algae.However, the production of fish in restricted spaces, as opposed to those that grow in the wild, generates some problems or factors to be monitored and controlled so as to ensure that the quality of the fish reaches the standards for human consumption.
Disease is one of the most important factors to be considered in aquaculture as it may cause high losses in the number and quality of the produced fish [2].Maladies such as Epizootic Ulcerative Syndrome (EUS) can be more easily detected due to the appearance of visible white spots.However, other diseases may go unnoticed and cause the chronic death of the fish.As a solution, monitoring both the external state of the fish and its behavior helps to prevent losses by providing the information to take all measures necessary.Therefore, the deployment of sensors, such as cameras, with the addition of data processing algorithms, can detect skin problems, parasites, fungus, cloudy eyes, swimming speed, or trajectory, among other factors [3].The feeding process is also crucial to producing fish of adequate size for commercialization.However, regulating the amount of feed is not only relevant for fish growth but also to avoid water pollution caused by the excess feed that falls to the bottom of the ponds or cages [4].Water quality needs to be considered as well, more so in inland aquaculture ponds, to provide a good environment for the fish to grow and live healthily.However, it is also important so as to avoid the pollution caused by increasing nutrient concentration in the water or by the persistence of antibiotics that increase drug resistance in fish [5].Manually monitoring these factors is costly in labor as well as financially.For that reason, the introduction of sensor devices has extended worldwide.For example, different water quality indicators, such as salinity or turbidity, can be monitored using conductivity sensors based on electrodes or induction or optical sensors, respectively.The surge in the availability of monitoring systems for aquaculture has enabled the introduction of smart functionalities that allow automation and the incrementation of the controlling activities important to optimize the production of fish, increment their quality, and improve the sustainability of aquaculture facilities.
Therefore, various mechanisms control the variables affecting fish in aquaculture facilities.These controlling tasks are performed with the use of actuators.Water quality for inland ponds can be controlled through pumps [6,7], filters [6,7], and aerators [6,8].Heaters are utilized to adequate the temperature to that needed by the fish [6].Although electrical heating is the most common form of temperature regulation, there have been proposals for solar [9] and geothermal [10] heating as more sustainable and affordable solutions.Artificial lights have also been used to modify the behavior of fish, such as the swimming depth of salmon [11].Furthermore, feeders provide automation functionalities to aquaculture systems [12].It is also important to notice that not only the devices but the cages are also evolving, such as the addition of a nervous system based on the introduction of circuitry in the net for damage detection [13].Nevertheless, this solution is extremely costly.Furthermore, the controlling and monitoring devices can be installed in habitual locations, such as in the structure of the cage, but also in other forms of encapsulations and transportation, such as buoys [14] and unmanned floating vehicles [15].The benefits of these devices, however, are reduced or nonexistent without any form of communication that allows them to receive the information with the actions to be performed.
The cost and liability of deploying cables in aquaculture facilities to connect monitoring devices led to the need to use wireless communications to create a Wireless Sensor Network (WSN) to send the collected information to a database and send alert messages to the personnel or activate actuators.In order for the sensing devices to establish any form of communication that enables collaboration, it is imperative to incorporate a communication module or use an embedded board that is manufactured with it.Various wireless communication technologies have been employed for control systems in aquaculture, including GSM/GPRS [16], 3G [17], 4G [13], WiFi [15,18], ZigBee [18,19], LoRa [6], and Bluetooth [15].The selection of the communication technology depends on the distance between devices, the data's characteristics and quantity, or the power consumption requirements.Once the connection is established, the devices are part of a network that can be organized in various forms.Layered architectures, such as recirculation aquaculture traceability systems [20], are some of the most frequent forms of establishing hierarchical frameworks.Other proposals employ star topologies for wireless communications where sensing devices send data to a central hub [21].Group-based topologies [22] allow establishing communication among devices according to factors including physical closeness, type of device, energy consumption, or processing capabilities.Lastly, some architectures enable the communication of Appl.Sci.2024, 14, 6244 3 of 32 devices deployed in a line or row by relaying the information from one device to the next until it reaches a gateway or data collector [23].
Finally, performing any kind of control activity to change certain variables in the fish tanks or cages requires the information gathered by the monitoring devices to be processed by algorithms.These algorithms determine the best action to take so as to obtain the desired result.Roulette-tournament selection algorithms have been applied to determine diet formulations [24].Moreover, the prediction and control of Dissolved Oxygen (DO) have been performed by employing a hybrid improved sparrow search algorithm [25].The use of Artificial Intelligence (AI) is extending to all possible areas of knowledge, including aquaculture.This has led to functionalities such as detecting malfunctioning devices for water quality monitoring and control based on the use of support vector machine classifiers [16].Furthermore, pattern identification in fish behavior was achieved by the use of object detection and the k-means clustering algorithm [26].
Designing a control system for aquaculture facilities is therefore a complex task that requires the identification of the critical factors that need to be considered by the system.Moreover, the technical requirements needed to address these factors and the limitations introduced by the characteristics of the aquatic environment need to be considered as well regarding the sensors, circuitry, encapsulation, architecture, communication technology, or processing algorithms.Furthermore, with the use of low-cost devices, these new solutions for aquaculture can be more accessible to farmers worldwide.
The remainder of this article is partitioned into the following sections.The second section identifies the factors affecting fish performance and fish well-being in aquaculture facilities and analyzes the interaction between factors, highlighting the critical ones.The selection of factors for the control system for aquaculture in two scenarios, the most common ones, cages in the sea and tanks in Recirculating Aquaculture Systems (RASs), is shown in the third section.The proposal, including the general aspects, sensors, actuators, nodes, communication protocol, and other elements of the control system, is provided in the fourth section.The fifth section describes in depth the algorithms of the Control system and uses two study cases to illustrate the operation or proposed system.Finally, concluding remarks are given in the last section.

Identification of Critical Factors for Control Systems for Aquaculture
In this section, we examine factors influencing fish performance and well-being in different aquaculture facilities.Those factors are grouped into five categories.Then, the interrelations between factors are identified to indicate the critical factors to consider in the proposed smart, low-cost control systems for aquaculture facilities.

Factors Affecting Fish Wellbeing and Performance
First of all, the general factors that affect the fish's well-being and performance are divided into five domains:

•
Production Domain: Factors derived from the way in which fish are produced in the facilities.Most of those factors are fixed and depend on the design and location of the production plant.Other factors are more flexible, such as feeding-related ones, and might be changed or improved.

•
Biotic Domain: Factors dependent on the biotic part of the environment in which the facilities are located.All these factors are independent of the facilities and include water, atmosphere, and light factors.If facilities are located in open skies, barely any control or modification can be performed on these factors.Nonetheless, it is possible to modify these factors when facilities are indoors.More information is provided in the section titled Control Domain.

•
Species Biotic Domain: Factors that depend on the grown species, including the growing stage and physiological and social factors.Even though most of them cannot be controlled or modified, some factors can be altered.

•
External Biotic Domain: Factors depending on the presence and effects of other living beings found in the surroundings of the aquaculture facilities.It includes the effects of animals, plants, and bacteria, among others, on the fish.In general terms, the presence of the effect of external biotic factors can be controlled, minimized, or avoided.

•
Control Domain: Factors referring to the control actions that can be conducted on fish farms, including monitoring and modification of biotic, abiotic, and production domains.This is the core of aquaculture facilities' smart, low-cost control systems.
In the Domain, only the aspects related to the control of other domains are listed since the rest of the factors do not affect fish performance or well-being.These factors, such as monitoring, telecommunication, or computing technology, are defined in subsequent sections.
The factors included in the listed domains affect the fish grown; their effect can be measured in many different ways, such as growth, meat quality, survival, reproduction success, and welfare.Figure 1 represents the summary of the included Domains.Species Biotic Domain: Factors that depend on the grown species, including the growing stage and physiological and social factors.Even though most of them cannot be controlled or modified, some factors can be altered.

•
External Biotic Domain: Factors depending on the presence and effects of other living beings found in the surroundings of the aquaculture facilities.It includes the effects of animals, plants, and bacteria, among others, on the fish.In general terms, the presence of the effect of external biotic factors can be controlled, minimized, or avoided.

•
Control Domain: Factors referring to the control actions that can be conducted on fish farms, including monitoring and modification of biotic, abiotic, and production domains.This is the core of aquaculture facilities' smart, low-cost control systems.In the Domain, only the aspects related to the control of other domains are listed since the rest of the factors do not affect fish performance or well-being.These factors, such as monitoring, telecommunication, or computing technology, are defined in subsequent sections.
The factors included in the listed domains affect the fish grown; their effect can be measured in many different ways, such as growth, meat quality, survival, reproduction success, and welfare.Figure 1 represents the summary of the included Domains.

Factors of the Production Domain
In this Domain, we can identify factors relative to the location in which the fish are kept, which can be in tanks or cages.For tanks, the tank dimensions (shape, diameter, and depth) [27], the tank material (plastic, fiberglass, geomembrane, concrete, and ground) [28], and the tank color [29] are the most relevant factors.Other factors, such as the aerial protection of the tank, are not included since their use is minimal in tanks.Regarding the cage, its dimensions affect the fish and water quality parameters [30].The net material (generally synthetic materials such as nylon or polyethene) and the net support are extremely important due to their close relation with fish escapes, predation, and biofouling control [31][32][33].Aerial protection, also called bird nets, is an important factor in preventing predation [34].In the case of cages, the used ships are also an important factor in terms of the produced sound and its effect [35,36].
On the other hand, the aspects relative to the feeding greatly impact the fish's performance.Two issues can be identified, the feed and the feeding procedure.The feed quality, with different additives and probiotics [37][38][39], and the adjustment of the feed dose [40,41], have a huge impact on fish performance.The feeding procedure includes the feed schedule [42,43], the number of feed shoots per day, feeds per day or feeding frequency

Factors of the Production Domain
In this Domain, we can identify factors relative to the location in which the fish are kept, which can be in tanks or cages.For tanks, the tank dimensions (shape, diameter, and depth) [27], the tank material (plastic, fiberglass, geomembrane, concrete, and ground) [28], and the tank color [29] are the most relevant factors.Other factors, such as the aerial protection of the tank, are not included since their use is minimal in tanks.Regarding the cage, its dimensions affect the fish and water quality parameters [30].The net material (generally synthetic materials such as nylon or polyethene) and the net support are extremely important due to their close relation with fish escapes, predation, and biofouling control [31][32][33].Aerial protection, also called bird nets, is an important factor in preventing predation [34].In the case of cages, the used ships are also an important factor in terms of the produced sound and its effect [35,36].
On the other hand, the aspects relative to the feeding greatly impact the fish's performance.Two issues can be identified, the feed and the feeding procedure.The feed quality, with different additives and probiotics [37][38][39], and the adjustment of the feed dose [40,41], have a huge impact on fish performance.The feeding procedure includes the feed schedule [42,43], the number of feed shoots per day, feeds per day or feeding frequency [44], and feeder characteristics.Considering that feed supposes 70% of the costs of fish farm facilities [45], it is not strange that several efforts have been made to manage the feed in aquaculture.The amount of feed is estimated by existing models based on fish size and fish population.Sensors can be used to estimate these variables or production models based on fish growth under given conditions are able to provide these data in the absence of sensors.Feeding rate and feed discharge frequency will be adapted to the fish species and size, and to the feeder equipment and facilities.Figure 2 summarizes all the production factors identified in this paper for the Smart Low-Cost Control Systems for Aquaculture Facilities.
Appl.Sci.2024, 14, x FOR PEER REVIEW 5 of 34 [44], and feeder characteristics.Considering that feed supposes 70% of the costs of fish farm facilities [45], it is not strange that several efforts have been made to manage the feed in aquaculture.The amount of feed is estimated by existing models based on fish size and fish population.Sensors can be used to estimate these variables or production models based on fish growth under given conditions are able to provide these data in the absence of sensors.Feeding rate and feed discharge frequency will be adapted to the fish species and size, and to the feeder equipment and facilities.Figure 2 summarizes all the production factors identified in this paper for the Smart Low-Cost Control Systems for Aquaculture Facilities.The managers of the aquaculture facilities define the factors of the Production Domain, some of them cannot be modified, such as the location.The feed and feeding procedure greatly impacts fish performance and well-being and can be adapted to the grown species and the other Domains.

Factors of the Species Abiotic Domain
Regarding the Abiotic Domain, most of the factors are related to the water.Focusing on the water, we can identify the factors linked to water quality, such as the water temperature [46][47][48], DO [49][50][51], Salinity [52,53], Turbidity [54,55], Water Colour [56], pH [57,58], Oxidation/Reduction Potential [59,60], and pollution.All the aspects of water quality affect the fish's performance directly, but some of them also affect them indirectly.The hatcheries, where larvae and fry fish growth occur, are the aquaculture facilities in which water quality is most important to ensure no deformities and the correct starting of feed intake.Pollution has been included as a general term which can include the presence of external pollution sources such as hydrocarbon [60], pesticides [61], colored organic matter [62], and harmful algal blooms [63], among others.Nevertheless, pollution can also be caused by abnormal situations in production, such as an increase in ammonia [64] and uneaten feed or fish feces [65].Other factors related to the water are the water current or water velocity [53,66], waves [66][67][68], and tides [69]; some of them affect the fish performance directly, while others affect them indirectly by affecting the cage structure and net shape.
Besides the water, some other abiotic factors affect aquaculture performance, such as the atmosphere and light.The wind speed and direction, which causes irregular feeding [70,71], air temperature [72], and rain or storms, and their effect on fish escapes and water  The managers of the aquaculture facilities define the factors of the Production Domain, some of them cannot be modified, such as the location.The feed and feeding procedure greatly impacts fish performance and well-being and can be adapted to the grown species and the other Domains.

Factors of the Species Abiotic Domain
Regarding the Abiotic Domain, most of the factors are related to the water.Focusing on the water, we can identify the factors linked to water quality, such as the water temperature [46][47][48], DO [49][50][51], Salinity [52,53], Turbidity [54,55], Water Colour [56], pH [57,58], Oxidation/Reduction Potential [59,60], and pollution.All the aspects of water quality affect the fish's performance directly, but some of them also affect them indirectly.The hatcheries, where larvae and fry fish growth occur, are the aquaculture facilities in which water quality is most important to ensure no deformities and the correct starting of feed intake.Pollution has been included as a general term which can include the presence of external pollution sources such as hydrocarbon [60], pesticides [61], colored organic matter [62], and harmful algal blooms [63], among others.Nevertheless, pollution can also be caused by abnormal situations in production, such as an increase in ammonia [64] and uneaten feed or fish feces [65].Other factors related to the water are the water current or water velocity [53,66], waves [66][67][68], and tides [69]; some of them affect the fish performance directly, while others affect them indirectly by affecting the cage structure and net shape.
Besides the water, some other abiotic factors affect aquaculture performance, such as the atmosphere and light.The wind speed and direction, which causes irregular feeding [70,71], air temperature [72], and rain or storms, and their effect on fish escapes and water turbidity [32,73], are the most relevant factors related to the atmosphere.Regarding the light, the intensity and color, as well as the photoperiod, are extremely important in hatcheries [52,54,74].The aforementioned factors of the Abiotic Domain, identified for the proposed Smart Low-Cost Control Systems for Aquaculture Facilities, are depicted in Figure 3.
Appl.Sci.2024, 14, x FOR PEER REVIEW 6 of 34 turbidity [32,73], are the most relevant factors related to the atmosphere.Regarding the light, the intensity and color, as well as the photoperiod, are extremely important in hatcheries [52,54,74].The aforementioned factors of the Abiotic Domain, identified for the proposed Smart Low-Cost Control Systems for Aquaculture Facilities, are depicted in Figure 3.
Figure 3. Factors of the Abiotic Domain.These factors depend on the environment in which the aquaculture facilities are placed, including the water, atmosphere, and light.According to the type of aquaculture facilities, there is the possibility of modifying or adjusting some of these factors.

Factors of the Species Biotic Domain
In this case, the factors can be divided into three main groups: those relative to the growing stage, the physiology of the species, and the social factors.Starting with the growth stage, we can identify the requirements for a given fish size and the environment in which the fish are grown, the relatives to feeding demand in times of feed dose and feed quality [75,76], and the required limits on the current or water velocity and on water quality [77].In addition, some factors are more related to the development stage, such as the breeding season, the growing size, and the growth uniformity.
The factors related to the physiology of the fish might be related to the fish's senses, resistances, or others.Among the senses, the most important ones are vision (greatly related to the feeding process in hatcheries [78,79]), hearing (affected by sound pollution that triggered stress episodes [80]), and chemo-attraction and electrosensory (both of them closely related to feeding activity [81]).The resistance can be to parasites [82] or to diseases [83].Finally, the immune system and stress, which are closely related, are the last physiological factors included in this paper.
Regarding social behavior, we can differentiate feeding behavior and swimming behavior.The swimming behavior is denoted by swimming velocity and depth as well as by the prey avoidance behavior, which is related to the presence of predators [84], feeding [85], stress [86], and the variation in water quality [87].Concerning feeding behavior, the feeding time and feeding depth [88] in the adults, and cannibalism [29] in the hatchery, are the most relevant factors.The classification of the factors of the species biotic domain included in this paper is drawn in Figure 4.

Factors of the Species Biotic Domain
In this case, the factors can be divided into three main groups: those relative to the growing stage, the physiology of the species, and the social factors.Starting with the growth stage, we can identify the requirements for a given fish size and the environment in which the fish are grown, the relatives to feeding demand in times of feed dose and feed quality [75,76], and the required limits on the current or water velocity and on water quality [77].In addition, some factors are more related to the development stage, such as the breeding season, the growing size, and the growth uniformity.
The factors related to the physiology of the fish might be related to the fish's senses, resistances, or others.Among the senses, the most important ones are vision (greatly related to the feeding process in hatcheries [78,79]), hearing (affected by sound pollution that triggered stress episodes [80]), and chemo-attraction and electrosensory (both of them closely related to feeding activity [81]).The resistance can be to parasites [82] or to diseases [83].Finally, the immune system and stress, which are closely related, are the last physiological factors included in this paper.
Regarding social behavior, we can differentiate feeding behavior and swimming behavior.The swimming behavior is denoted by swimming velocity and depth as well as by the prey avoidance behavior, which is related to the presence of predators [84], feeding [85], stress [86], and the variation in water quality [87].Concerning feeding behavior, the feeding time and feeding depth [88] in the adults, and cannibalism [29] in the hatchery, are the most relevant factors.The classification of the factors of the species biotic domain included in this paper is drawn in Figure 4.The species in the aquaculture facilities defined these factors, which can be divided into the growing stage, physiology of the species, and social behavior.Some of the fish's behavior depends on other aspects.For example, cannibalism depends on the growing stage and the growing uniformity.

Factors of the External Biotic Domain
With regard to the external biotic Domain, it is possible to identify factors linked to animals, plants, and other living beings.The fish surrounding the facilities might have different roles, such as predators [89], opportunistic fish, and vectors [90].While the predators affect the fish's survival by causing silent mortality, since no cadavers appear, vectors cause mortality due to the transmission of parasites or diseases.Furthermore, opportunistic fish or intruders affect fish performance by consuming part of the provided feed, and this is a silent effect since it might be challenging to identify the intruder fish.They can also become vectors and fish predators.Mammals and birds can mainly interact as predators [89].Invertebrates can affect aquaculture in two ways.First, they can be parasites of grown fish [91].Most of the parasites do not kill the fish but affect their swimming and feeding behavior [92].Moreover, invertebrates can be vectors for other organisms.
Plants and algae generate biofouling, which affects the fish's performance indirectly [93].In addition, algae can cause algal blooms [63], which affect the fish's performance directly [94].Finally, fungi, bacteria, and viruses can provoke several diseases [95], jeopardizing the survival of individuals and affecting the fish's performance.Figure 5   The species in the aquaculture facilities defined these factors, which can be divided into the growing stage, physiology of the species, and social behavior.Some of the fish's behavior depends on other aspects.For example, cannibalism depends on the growing stage and the growing uniformity.

Factors of the External Biotic Domain
With regard to the external biotic Domain, it is possible to identify factors linked to animals, plants, and other living beings.The fish surrounding the facilities might have different roles, such as predators [89], opportunistic fish, and vectors [90].While the predators affect the fish's survival by causing silent mortality, since no cadavers appear, vectors cause mortality due to the transmission of parasites or diseases.Furthermore, opportunistic fish or intruders affect fish performance by consuming part of the provided feed, and this is a silent effect since it might be challenging to identify the intruder fish.They can also become vectors and fish predators.Mammals and birds can mainly interact as predators [89].Invertebrates can affect aquaculture in two ways.First, they can be parasites of grown fish [91].Most of the parasites do not kill the fish but affect their swimming and feeding behavior [92].Moreover, invertebrates can be vectors for other organisms.
Plants and algae generate biofouling, which affects the fish's performance indirectly [93].In addition, algae can cause algal blooms [63], which affect the fish's performance directly [94].Finally, fungi, bacteria, and viruses can provoke several diseases [95], jeopardizing the survival of individuals and affecting the fish's performance.Figure 5 portrays the information above related to the external biotic factors identified for the proposed Smart Low-Cost Control Systems for Aquaculture Facilities.

Factors of the Control Domain
Finally, for the control domain, two groups of factors can be identified, those linked to the monitoring and the ones for the control, which can be subdivided into control of water quality and control of other aspects.Focusing on monitoring, the monitoring can be for water, fish, or others.In terms of water quality, the most important factors are water temperature, DO, and pH [96,97].Fish detection [98], location [99], and counting [100] are essential for fish monitoring.Other elements to be monitored in fish farms include the feed falling [97] and the phytoplankton and zooplankton production in the hatchery [101].
With regard to water quality control in open circuits on the land, filters are, in most cases, the only viable option.Generally, in offshore facilities, no control of water quality can be conducted.In RAS, several aspects of water quality can be modified and controlled, and the actuators are carbon dioxide removal, biofiltration, heating or cooling systems, salinity correction, skimmer use, and disinfection systems [102].Concerning the other aspects, light [103] is the most important one, followed by current and feeding.For the current, the option to modify the flow in different areas of the facilities and the possibility to open/close the water flow isolating the full facility of some tanks, are the most important.Finally, the most common factors for feeding control are the adjustable feeding velocity and schedule and the option of including auto-demand feeders [104].Figure 6 summarizes all the control factors identified in this paper for the Smart Low-Cost Control Systems for Aquaculture Facilities.

Factors of the Control Domain
Finally, for the control domain, two groups of factors can be identified, those linked to the monitoring and the ones for the control, which can be subdivided into control of water quality and control of other aspects.Focusing on monitoring, the monitoring can be for water, fish, or others.In terms of water quality, the most important factors are water temperature, DO, and pH [96,97].Fish detection [98], location [99], and counting [100] are essential for fish monitoring.Other elements to be monitored in fish farms include the feed falling [97] and the phytoplankton and zooplankton production in the hatchery [101].
With regard to water quality control in open circuits on the land, filters are, in most cases, the only viable option.Generally, in offshore facilities, no control of water quality can be conducted.In RAS, several aspects of water quality can be modified and controlled, and the actuators are carbon dioxide removal, biofiltration, heating or cooling systems, salinity correction, skimmer use, and disinfection systems [102].Concerning the other aspects, light [103] is the most important one, followed by current and feeding.For the current, the option to modify the flow in different areas of the facilities and the possibility to open/close the water flow isolating the full facility of some tanks, are the most important.Finally, the most common factors for feeding control are the adjustable feeding velocity and schedule and the option of including auto-demand feeders [104].Figure 6 summarizes all the control factors identified in this paper for the Smart Low-Cost Control Systems for Aquaculture Facilities.In sea cages, only monitoring and control of feeding can be applied.In RAS facilities, most of the parameters can be monitored and controlled.

Interaction between Factors
In this subsection, the interaction between factors identified in Section 3.1.is shown.The objective is to identify the factors that have more effect on fish performance, both directly and indirectly.These factors will be included in our smart control system.
We In sea cages, only monitoring and control of feeding can be applied.In RAS facilities, most of the parameters can be monitored and controlled.

Interaction between Factors
In this subsection, the interaction between factors identified in Section 3.1.is shown.The objective is to identify the factors that have more effect on fish performance, both directly and indirectly.These factors will be included in our smart control system.
We have identified 13 factors for the Production Domain, 18 factors for the Abiotic Domain, 20 factors for the Species Biotic Domain, 12 factors for the External Biotic Domain, and 23 factors for the Control Domain, a total of 86 factors.In order to simplify the visualization of information, the parameters are reduced to 67, and those without interaction with other factors are deleted from this analysis.In addition, some parameters are fused since their relationship with other parameters is similar.The combination of those 67 factors supposes a total of 2144 possible interactions.The relation between parameters has been classified as strong, medium, weak, and none.The factors with more interactions are the water temperature, the fish detecting and counting (from the control Domain), the tank and cage dimensions, the feed quality (from the Production Domain), and the feeding demand (from the Species Biotic Domain).The first factor from the External Biotic Domain is biofouling, which interacts with many of the monitoring and control factors.Figure 8 summarizes the identified number of interactions for each factor in descending order.It must be noted that the number of interactions  The factors with more interactions are the water temperature, the fish detecting and counting (from the control Domain), the tank and cage dimensions, the feed quality (from the Production Domain), and the feeding demand (from the Species Biotic Domain).The first factor from the External Biotic Domain is biofouling, which interacts with many of the monitoring and control factors.Figure 8 summarizes the identified number of interactions for each factor in descending order.It must be noted that the number of interactions is not indicative of the importance of the individual factor.Some factors, such as wind or water flow, which appear with a low number of interactions, are essential for feeding success.In this graphic, we represented the factors with the highest number of interactions.Note that a higher number of interactions might indicate that the factors are important for the control system, but factors with a low number of interactions cannot be discarded automatically since the interaction can be crucial.The color of the factors indicates the Domain.

Selected Factors for Smart Low-Cost Control Systems for Aquaculture
In this section, we identify the selected factors included in the aquaculture facilities' control algorithms.Considering the high variability of aquaculture facilities, two scenarios are differentiated according to the operation, aquaculture facilities with cages in the open sea and RAS with tanks.

Selected Control Factors for Aquaculture Facilities with Cages in the Sea
In this case, all the control factors for water and light are inviable.The only control factors are the adjustable feed velocity and schedule.Monitoring can be applied to water quality and flow.Regarding water quality, the selected parameters are water temperature, turbidity, DO, and light intensity.Water temperature is one of the key parameters for estimating fish size.DO is essential for fish well-being and survival and cannot be modified.

Selected Factors for Smart Low-Cost Control Systems for Aquaculture
In this section, we identify the selected factors included in the aquaculture facilities' control algorithms.Considering the high variability of aquaculture facilities, two scenarios are differentiated according to the operation, aquaculture facilities with cages in the open sea and RAS with tanks.

Selected Control Factors for Aquaculture Facilities with Cages in the Sea
In this case, all the control factors for water and light are inviable.The only control factors are the adjustable feed velocity and schedule.Monitoring can be applied to water quality and flow.Regarding water quality, the selected parameters are water temperature, turbidity, DO, and light intensity.Water temperature is one of the key parameters for estimating fish size.DO is essential for fish well-being and survival and cannot be modified.The schedule of feed shoots can be adjusted to the DO to ensure that fish are fed with optimum DO concentrations.Turbidity and light intensity are also important for feeding behavior and for the correct operation of other sensors.Additional parameters might include monitoring hydrocarbon and algal blooms as a source of pollution and wind, current, and swell, due to their effect on feeding success.
Monitoring fish detection/counting and feed falling can be challenging but possible.Fish swimming depth and velocity based on fish detection are crucial to understanding the swimming behavior of fish, which can indicate hunger, stress, or even a decrease in water quality, as well as the fish size, due to the fact that its relation with the feeding demand is mandatory for the control systems.Finally, if possible, the presence of other fishes, such as predators, which affect fish mortality, and intruders, should be included in the control systems to consider their effect on the feed demanded by the grown individuals plus the intruders and on the mortality.The same system proposed for detecting fish predators can be used to detect fish escapes caused by a broken net, which is one of the most problematic events in aquaculture facilities with cages in the open sea.
In these networks, we have the feeders as actuators, and several pieces of data can be used to define the operation of the automatic feeder.On the one hand, abiotic parameters such as water temperature are used to estimate the required amount of feed; other abiotic parameters, such as DO, light intensity, turbidity, wind, current, and sea swell, are necessary to schedule the feeding time.On the other hand, biotic parameters, such as fish size and the presence of intruders, are considered to estimate the required feed quantity.
A summary of the factors included for the control of the aquaculture facilities composed of cages in the sea can be seen in Figure 9.The different colors of the factors indicate the Domain to which the factor belongs.The schedule of feed shoots can be adjusted to the DO to ensure that fish are fed with optimum DO concentrations.Turbidity and light intensity are also important for feeding behavior and for the correct operation of other sensors.Additional parameters might include monitoring hydrocarbon and algal blooms as a source of pollution and wind, current, and swell, due to their effect on feeding success.
Monitoring fish detection/counting and feed falling can be challenging but possible.Fish swimming depth and velocity based on fish detection are crucial to understanding the swimming behavior of fish, which can indicate hunger, stress, or even a decrease in water quality, as well as the fish size, due to the fact that its relation with the feeding demand is mandatory for the control systems.Finally, if possible, the presence of other fishes, such as predators, which affect fish mortality, and intruders, should be included in the control systems to consider their effect on the feed demanded by the grown individuals plus the intruders and on the mortality.The same system proposed for detecting fish predators can be used to detect fish escapes caused by a broken net, which is one of the most problematic events in aquaculture facilities with cages in the open sea.
In these networks, we have the feeders as actuators, and several pieces of data can be used to define the operation of the automatic feeder.On the one hand, abiotic parameters such as water temperature are used to estimate the required amount of feed; other abiotic parameters, such as DO, light intensity, turbidity, wind, current, and sea swell, are necessary to schedule the feeding time.On the other hand, biotic parameters, such as fish size and the presence of intruders, are considered to estimate the required feed quantity.
A summary of the factors included for the control of the aquaculture facilities composed of cages in the sea can be seen in Figure 9.The different colors of the factors indicate the Domain to which the factor belongs.

Selected Control Factors for RAS
In RAS systems, technology allows for the control of several parameters of water quality, and sensors can monitor the correct operation of other elements.In addition, monitoring technology can act as a trigger for control technology, activating or deactivating elements to keep the water quality in between desired values.The monitorization of water includes sensors for the following: water temperature, DO, salinity, turbidity, pH,

Selected Control Factors for RAS
In RAS systems, technology allows for the control of several parameters of water quality, and sensors can monitor the correct operation of other elements.In addition, monitoring technology can act as a trigger for control technology, activating or deactivating elements to keep the water quality in between desired values.The monitorization of water includes sensors for the following: water temperature, DO, salinity, turbidity, pH, pollution (hydrocarbon, phytoplankton), and current.All these data are needed to activate/deactivate the water control mechanism in the facilities (such as pumping systems, aerators or oxygenators, water heating/cooling, filters, skimmers, disinfection, and salinity correction. ..).Data can also indicate a general or partial failure of these control mechanisms.The light intensity is another aspect to be monitored since it can indicate a general or partial failure in the illumination system.
Regarding the biotic factors, fish swimming depth and velocity, fish counting, and estimations of fish size can easily be measured compared with the previous case.The factor of feed falling is less challenging, and cameras can be used.In this case, no fish predators, vectors, or intruders might be in the tanks.Invertebrates or other organisms are considered eradicated by the action of disinfection systems.
For the control mechanisms, which must include a solid filter, biofilter, aerator, and disinfection, sensor nodes, and sensor actuators are included in each step.The monitoring sensors include a water flow sensor in every mechanism and specific sensors to control the correct operation.The specific sensors are a turbidity sensor for the solid filter, a pH sensor for biofilter, a DO sensor for aeration, and a phytoplankton sensor for disinfection.Moreover, the RAS might include additional steps for heating/cooling the water and for salinity correction; in this case, water temperature sensors and salinity sensors are included.
Concerning the actuators, for the correct operation of water treatment mechanisms, water pumps to control the water flow and the time remaining in each process are used.Additionally, alarms can be included to alert if an abnormal situation is detected.For the fish tanks, the actuators include three main groups of actuators.First, the water pumping and feeder actuator are to control the water flow and the feed velocity and schedule.The aerator and skimmer are in charge of controlling the water quality at the tank scale.Finally, the actuator for the illumination system controls the light intensity, the photoperiod, and the alarm to alert of an abnormal situation in the tank.
Figure 10 represents all included factors for RAS facilities.Given the high isolation and control of those systems, most factors are related to the Control Domain and Abiotic Domain.Regarding the biotic factors, fish swimming depth and velocity, fish counting, and estimations of fish size can easily be measured compared with the previous case.The factor of feed falling is less challenging, and cameras can be used.In this case, no fish predators, vectors, or intruders might be in the tanks.Invertebrates or other organisms are considered eradicated by the action of disinfection systems.
For the control mechanisms, which must include a solid filter, biofilter, aerator, and disinfection, sensor nodes, and sensor actuators are included in each step.The monitoring sensors include a water flow sensor in every mechanism and specific sensors to control the correct operation.The specific sensors are a turbidity sensor for the solid filter, a pH sensor for biofilter, a DO sensor for aeration, and a phytoplankton sensor for disinfection.Moreover, the RAS might include additional steps for heating/cooling the water and for salinity correction; in this case, water temperature sensors and salinity sensors are included.
Concerning the actuators, for the correct operation of water treatment mechanisms, water pumps to control the water flow and the time remaining in each process are used.Additionally, alarms can be included to alert if an abnormal situation is detected.For the fish tanks, the actuators include three main groups of actuators.First, the water pumping and feeder actuator are to control the water flow and the feed velocity and schedule.The aerator and skimmer are in charge of controlling the water quality at the tank scale.Finally, the actuator for the illumination system controls the light intensity, the photoperiod, and the alarm to alert of an abnormal situation in the tank.
Figure 10 represents all included factors for RAS facilities.Given the high isolation and control of those systems, most factors are related to the Control Domain and Abiotic Domain.

Proposal for Smart Low-Cost Control Systems for Aquaculture
Taking into account the sensors and actuators described in Figures 9 and 10, the proposal of control systems for RAS and sea cages is defined in this section.The communication technology, the location of sensor nodes and actuator nodes, and the DB are presented for the control system.The sensors' gathered data and the actuators' responses will be visible in the Control Portal, which allows the remote monitoring and control of different actuators.A general scheme of the proposed smart control system that summarizes the main principal elements can be seen in Figure 11.The system is composed of sensor nodes, actuator nodes, network devices, and storage devices.Moreover, several software elements, which include data management, user interfaces, control module, reporting module, and prediction module, are the core of the smart control system.

Proposal for Smart Low-Cost Control Systems for Aquaculture
Taking into account the sensors and actuators described in Figures 9 and 10, the pr posal of control systems for RAS and sea cages is defined in this section.The communic tion technology, the location of sensor nodes and actuator nodes, and the DB are present for the control system.The sensors' gathered data and the actuators' responses will visible in the Control Portal, which allows the remote monitoring and control of differe actuators.A general scheme of the proposed smart control system that summarizes t main principal elements can be seen in Figure 11.The system is composed of sensor nod actuator nodes, network devices, and storage devices.Moreover, several software e ments, which include data management, user interfaces, control module, reporting mo ule, and prediction module, are the core of the smart control system.

General Aspects
For the proposal of Smart Low-Cost Control Systems for Aquaculture Facilities w cages in the sea, we propose the combination of two sensing methods to be integrated in a smart Control Portal to generate a Database (DB) for optimal aquaculture manageme The deployment of the system is illustrated in Figure 12.The Control Portal will cons of a big DB which includes information from WSN deployed in different parts of aquac ture cages and from remote sensing open access data (such as Sentinel 2).
The DB will have a series of algorithms and AI engines to process the received da to ensure that no abnormal values due to network errors are stored.Thus, we ensure t reliability of the received data.Other intelligent algorithms will be applied in the node f fault tolerance and for energy efficiency.Finally, algorithms for control will be applied the DB using both existing knowledge and AI.
Similar Smart Control Systems based on data gathered, DB, and AI are already inco porated in smart cities, such as for parking occupancy detection [105], and outdoor ligh

Sensors and Actuators
Most of the data can be obtained from sensors deployed in the cages and their surroundings.We highlight the water temperature and the DO sensor as the most important ones to predict fish performance.Commercial probes and sensors proposed in [110] are used for all the parameters of water quality and meteorological parameters.For fish and feed monitoring, two options are available, the use of cameras [111] and acoustic transducers [112].The selection of the most suitable method depends on the conditions of the environment; cameras are preferred due to their lower cost and lower energy consumption.The location of deployed sensors and sensor nodes can be seen in Figure 12.
The actuators in this network are the feeders for each cage.The system should be able to operate automatically, feeding the cages based on the measured temperature, wind, DO, and other relevant parameters, even if the connection with the DB is lost.This is one of the fault tolerance mechanisms for the connection with the DB.An additional mechanism is the inclusion of a 3G and 4G connection as a backup for the LoRa network.

Nodes
In order to develop the nodes, it is possible to opt for different options, i.e., from simple and cheap systems and modules, such as WeMos D1 module based on the esp8266 transceiver, to somewhat more expensive options but with greater processing capacities, such as the family of Raspberry Pi devices.In this case, the development of the node using the Raspberry Pi 4 module (Oxford, UK) is proposed.Information from the sensors is collected, analyzed, and transmitted to the DB.Nodes are endowed with edge computing capacities not only for improving data management but also to have the option of triggering actuators if needed.
Raspberry Pi is a low-cost, compact format computer designed to make computing accessible to all users.All Raspberry Pi designs are based on free hardware and free operating systems based on GNU/Linux are commonly used.The main features of this model The DB will have a series of algorithms and AI engines to process the received data to ensure that no abnormal values due to network errors are stored.Thus, we ensure the reliability of the received data.Other intelligent algorithms will be applied in the node for fault tolerance and for energy efficiency.Finally, algorithms for control will be applied in the DB using both existing knowledge and AI.
Similar Smart Control Systems based on data gathered, DB, and AI are already incorporated in smart cities, such as for parking occupancy detection [105], and outdoor lighting infrastructures in ports [106].Simpler examples can be found for agriculture [107] and farming [108], it is even possible to find some straightforward systems for aquaculture [109].

Sensors and Actuators
Most of the data can be obtained from sensors deployed in the cages and their surroundings.We highlight the water temperature and the DO sensor as the most important ones to predict fish performance.Commercial probes and sensors proposed in [110] are used for all the parameters of water quality and meteorological parameters.For fish and feed monitoring, two options are available, the use of cameras [111] and acoustic transducers [112].The selection of the most suitable method depends on the conditions of the environment; cameras are preferred due to their lower cost and lower energy consumption.The location of deployed sensors and sensor nodes can be seen in Figure 12.
The actuators in this network are the feeders for each cage.The system should be able to operate automatically, feeding the cages based on the measured temperature, wind, DO, and other relevant parameters, even if the connection with the DB is lost.This is one of the fault tolerance mechanisms for the connection with the DB.An additional mechanism is the inclusion of a 3G and 4G connection as a backup for the LoRa network.

Nodes
In order to develop the nodes, it is possible to opt for different options, i.e., from simple and cheap systems and modules, such as WeMos D1 module based on the esp8266 transceiver, to somewhat more expensive options but with greater processing capacities, such as the family of Raspberry Pi devices.In this case, the development of the node using the Raspberry Pi 4 module (Oxford, UK) is proposed.Information from the sensors is collected, analyzed, and transmitted to the DB.Nodes are endowed with edge computing capacities not only for improving data management but also to have the option of triggering actuators if needed.
Raspberry Pi is a low-cost, compact format computer designed to make computing accessible to all users.All Raspberry Pi designs are based on free hardware and free operating systems based on GNU/Linux are commonly used.The main features of this model are its Broadcom BCM2711 (Cortex-A72) processor with four cores and 1.5 GHz and its IEEE 802.11ac/Bluetooth 5.0 wireless connectivity.
The GPIO pins on the Raspberry Pi 4 board give the SBC board capabilities that Arduino might have, but controlled from within the operating system using code in different languages, such as Python.Raspberry Pi Model A+, B+, 2B, 3B, 3B+, Zero and Zero W, and 4 have a 40-pin GPIO header.Unlike digital signals, an analog signal can take intermediate values between a maximum and a minimum.An analog-to-digital converter such as the MCP3008 (Microchip Technology, Tokyo, Japan) must be used to read this voltage on the Raspberry Pi.However, that converter does not specify values in volts; it provides a number between 0 and 1023, which corresponds to a 10-bit ADC converter.
With a Raspberry, we can connect a considerable number of sensors, such as those mentioned in Figure 12, and we can complement their connectivity functions by adding gateways of the technologies that we wish to implement.
Finally, it is interesting to consider the possibility of using Power over Ethernet (PoE) to power the entire system, as well as the use of alternative energy sources, such as a solar panel and a set of batteries, to ensure its correct operation.With all this, the node would be ready for its integration into a complex network.

Communication Protocol and Communication Technologies
A group-based collaborative protocol for fish farming monitoring is proposed.Groupbased networks provide high scalability to the wireless network.The proposed system takes advantage of collaborative networks and collects all the information sensed from the nodes and the wireless network parameters to monitor the environment, detect abnormal situations, predict future scenarios, and control the actuators in the network.
Concerning the communication technology, a combination of a WiFi network, which acts as a local network, and a LoRa network are used to transmit the data from the sensor nodes to the DB.The local WiFi network connects all the fish farm facilities' sensor nodes and actuator nodes.A specific buoy is deployed in the facilities, which acts as a gateway connecting with a LoRa network, identified as the green buoy in Figure 12.The possible need for underwater communication and including underwater acoustic modems [113] has been considered.In a recent publication, LoRa connectivity has reached 7 km over the sea [114].

DB, AI, and Other Information Sources
Regarding the information sources, the inclusion of remote sensing will have two purposes.First, these data will be used to verify that the gathered data from the sensors are accurate and correlate with the measurements obtained through spectral indexes, such as chlorophyll [115] and the turbidity sensor, which distinguish algae from sediment [116].On the other hand, some parameters will be calculated using spectral indexes or machine learning, such as colored organic [117,118].Moreover, despite the limited temporal and spatial resolution, this information can be used to observe the presence of pollution in areas not initially included in the monitored area and follow it to estimate its future effect on the facilities.
Information in the DB will be processed using the most appropriate techniques for sensor systems in order to be treated by an intelligent system and take the most appropriate intelligent decisions and actions.The system will intelligently detect different fish behaviors caused by diseases, fish needs, sudden deaths, etc.This will enable the user to be conscious of what is happening and predict future cases according to the behavior of the obtained values over time [119].

Adaptations for Smart Low-Cost Control Systems for Aquaculture Facilities with RAS 4.2.1. General Aspects
In this subsection, the different characteristics between the RAS Control System and the one described in the previous subsection are detailed.The most important difference is the large number of sensors and actuators in this system.Other differences affect the communication technologies used since no heterogeneous wireless network is used.In this case, no remote sensing information can be included, and no energy harvesting is needed since nodes can be connected to the power grid.
The similitudes between the systems include the collaborative network, the used DB, and the AI engine.The collaborative network will include a higher number of nodes, but the network protocols will be similar.The DB will have a large number of parameters from the sensors and the absence of remote sensing information, but its structure will remain analogous.The same AI engine is used for the RAS control.

Sensors and Actuators
In RAS, all the data must be obtained from sensors deployed in the tanks, their surroundings, and the different parts of the water reconditioning system.In this case, all the information from the sensors can be directly applied to evaluate the performance of different actuators.As in cages in the sea, the water temperature and water DO are the most important ones to predict fish performance.For fish and feed monitoring, the use of cameras and Light Dependent Resistances (LDRs) can be used.Cameras are used to detect the feed falling while LDRs are selected for fish swimming behavior monitoring [110].
The actuators in RAS facilities include the feeders, part of the water reconditioning mechanisms, and acoustic and visual alarms in the monitored areas.As in the cage in the sea, in RAS facilities, the system should be able to operate automatically even if the connection with the DB is lost.In this case, the automatic operation includes feeding, aeration, and skimmer operation in the tanks, the full operation of the water reconditioned process, and triggering the alarms.The location of deployed sensors and sensor nodes can be seen in Figure 13.

Communication Protocol and Communication Technologies
As for cages in the sea, in RAS facilities, a group-based collaborative protocol for fish farming monitoring is proposed.The differences are in the employed communication technologies.In the RAS facilities, it is possible to connect all the devices using a sole wireless technology, WiFi.A local WiFi network connects all the fish farm facilities' sensor nodes and actuator nodes, and a gateway sends the information through an Ethernet connection, as seen in Figure 13.
Figure 13.Deployment of aquaculture control system in RAS.The main difference is to be found in the location and typology of sensors and actuators.A general perspective of the water reconditioning system and the detail of one tank is shown.

Communication Protocol and Communication Technologies
As for cages in the sea, in RAS facilities, a group-based collaborative protocol for fish farming monitoring is proposed.The differences are in the employed communication .Deployment of aquaculture control system in RAS.The main difference is to be found in the location and typology of sensors and actuators.A general perspective of the water reconditioning system and the detail of one tank is shown.

Smart Control Algorithm for Aquaculture
In this section, the algorithm for the control of aquaculture facilities is described.Other included algorithms in the control system for aquaculture are the predefined control algorithms, the energy-efficient algorithms, and the fault-tolerance algorithms.

Included Algorithms in the Complete System
The different algorithms included in the proposed Smart Low-Cost Control System for Fish Tanks in Aquaculture Facilities based on WSN can be seen in Figure 14.Not all algorithms are embedded in all the elements of the system.While fault tolerance algorithms are included in all the elements, another algorithm, such as the data management algorithm, is only present in a single element.The data management algorithm and smart control algorithm are defined in the subsequent subsection.
technologies.In the RAS facilities, it is possible to connect all the devices using a sole wireless technology, WiFi.A local WiFi network connects all the fish farm facilities' sensor nodes and actuator nodes, and a gateway sends the information through an Ethernet connection, as seen in Figure 13.

Smart Control Algorithm for Aquaculture
In this section, the algorithm for the control of aquaculture facilities is described.Other included algorithms in the control system for aquaculture are the predefined control algorithms, the energy-efficient algorithms, and the fault-tolerance algorithms.

Included Algorithms in the Complete System
The different algorithms included in the proposed Smart Low-Cost Control System for Fish Tanks in Aquaculture Facilities based on WSN can be seen in Figure 14.Not all algorithms are embedded in all the elements of the system.While fault tolerance algorithms are included in all the elements, another algorithm, such as the data management algorithm, is only present in a single element.The data management algorithm and smart control algorithm are defined in the subsequent subsection.
Figure 14.Algorithms of control system for fish farms.Five types of algorithms are detailed in this paper.The predefined control algorithms are used as a specific fault tolerance algorithm to allow the system to operate even without connectivity with DB.Energy-efficient algorithms try to reduce the energy consumption in the nodes.Fault tolerance algorithms aim to reduce the system's possible failures based on different backup mechanisms.The data management algorithm is applied only in the database and intends to process and compute the information.Finally, the smart control algorithm is the artificial intelligence engine and the database operating with the data and deciding the most efficient decision for the fish farm.

Predefined Control Algorithms
These algorithms are part of the backup system which allows the sensor nodes to communicate with actuator nodes in the case that the connectivity with the DB is lost.These algorithms are based on the activation or deactivation of actuators based on data sensed from the sensors of given time parameters.These predefined control algorithms are not used if the sensor and actuator receive information from the DB.Thus, the commands from the DB can modify and update these predefined control algorithms.
An example of these predefined control algorithms in sea cages includes the feeding algorithm, which includes the data from the falling feed sensor to reduce the feed velocity when uneaten feed is detected to reduce the waste feed.Another example is the activation of the feeder at a given time if no information from the DB is received and fed with the same amount of feed as the previous shot.A last example is postponing feeders' activation if wind velocity or water current is above an established value or if DO is below a threshold.

Fault tolerance algorithm
Figure 14.Algorithms of control system for fish farms.Five types of algorithms are detailed in this paper.The predefined control algorithms are used as a specific fault tolerance algorithm to allow the system to operate even without connectivity with DB.Energy-efficient algorithms try to reduce the energy consumption in the nodes.Fault tolerance algorithms aim to reduce the system's possible failures based on different backup mechanisms.The data management algorithm is applied only in the database and intends to process and compute the information.Finally, the smart control algorithm is the artificial intelligence engine and the database operating with the data and deciding the most efficient decision for the fish farm.

Predefined Control Algorithms
These algorithms are part of the backup system which allows the sensor nodes to communicate with actuator nodes in the case that the connectivity with the DB is lost.These algorithms are based on the activation or deactivation of actuators based on data sensed from the sensors of given time parameters.These predefined control algorithms are not used if the sensor and actuator receive information from the DB.Thus, the commands from the DB can modify and update these predefined control algorithms.
An example of these predefined control algorithms in sea cages includes the feeding algorithm, which includes the data from the falling feed sensor to reduce the feed velocity when uneaten feed is detected to reduce the waste feed.Another example is the activation of the feeder at a given time if no information from the DB is received and fed with the same amount of feed as the previous shot.A last example is postponing feeders' activation if wind velocity or water current is above an established value or if DO is below a threshold.
An example in RAS is the possibility of turning off the tank's water pump in case water quality exceeds a given threshold for the different sensed parameters.Other examples are the activation of aeration if DO drops below a certain value and the activation and deactivation of light according to established photoperiod.

Energy Efficiency Algorithms
The energy might be a limiting factor, mainly in buoy sensor nodes, buoy sensor actuators, and the buoy gateway.Thus, the efficient management of energy in those elements of the system is crucial.Some of the energy efficiency algorithms are based on event-triggered algorithms that define the existence or absence of the need to send data to DB.The first example is when sensed data are within the expected values, no data indicate an abnormal situation, and no alarm is generated; data can be stored and sent later.Generally, when a packet is sent, the useful payload, the portion of the packet that belongs to the sensed data, is infinite.Thus, it is better to store the data and send them when the stored data size is similar to the payload size.Nonetheless, if newly gathered data represent a variation in the previous patterns, or can trigger a predefined control algorithm, data must be sent immediately to the DB to have feedback.
Other examples of energy efficiency are related to wireless communication.The first example is for multi-hop networks, the selection of the most suitable node for the next hop basin on the remaining energy in the available neighbors.It is preferred to send the information to a node with a high percentage of energy since the node that received the packet will need to forward it, which supposes energy consumption.Thus, the node can balance the data among its neighbors according to the remaining energy to avoid depleting the energy of one node.

Fault-Tolerance Algorithms
Those algorithms are the ones that ensure that the system is robust and can operate even when parts of the system are disconnected, or there are failures in the data sending.Several algorithms are included.The main ones are related to failures in the network or in the DB and are described below.
• The algorithms relative to the failure in the network include using 3G/4G in the gateway of sea cages to ensure connectivity with the DB in case of failure of the LoRa network.If the gateway node does not receive any response from the DB when data are sent it supposes that the connectivity through LoRa is lost and the backup system based on 3G/4G starts to operate.Then, data are sent again with the new communication technology.

•
If connectivity with DB is not restored after changing the wireless technology, the gateway assumes that the failure is in the DB itself.Therefore, a message is sent to all the sensor and actuator nodes in order to run the predefined control algorithm and save all the gathered information.• Another way in which a failure in the connectivity with the DB can be prevented from affecting the regular operation of the actuators is when a message from the DB is expected and not received.In that case, the gateway body assumes that the connectivity is lost and alerts the local nodes to use the predefined control algorithm and save all the gathered information.

•
If a node does not receive the response when data are forwarded to the gateway, it automatically assumes that the connectivity with the gateway is lost and attempts to connect with the backup gateway.The redundancy of critical elements such as the gateway buoy is another example of fault tolerance mechanisms.

Data Management and Smart Control Algorithm
Finally, the smart control algorithm is described in this subsection.This algorithm runs between the DB and the AI.The data in the DB come from three sources: • The sensor-gathered data contain information on the value of the different monitored factors such as water temperature, swimming depth, and feed falling, among others.This can be considered the primary source of information.• The actuator data indicate the operation modes of different actuators in the fish farm facilities.They might indicate the periods in which actuators were deactivated or activated.Since some actuators might operate at different velocities or ratios, data include the value in those cases.The schedule of feeders or photoperiod of lights is another type of information.Finally, the activation of the alarm is important information for the system.This can be considered the second information source, which is particularly important in the case of RAS facilities.• The remote sensing data offer reliable information on water quality in areas beyond the fish farm facilities.This information is only useful in marine cages and can be essential for pollution monitoring.It is the third information source.
All the data are collected in the Management System of the DB; the data management algorithm defines the data processing and data fusion, if necessary.In the AI, the data for the DB are combined with existing knowledge about fish behavior, systems sustainability, the effect of the presence of predators and pollutions, and water and weather conditions.With all these data, a decision is made based on the use of different AI tools.
Then, the machine learning mechanism stores the decisions taken by the system for future events.The decision of the system can suppose the activation of the alarm system, the prediction system, or the control system.In the two first systems, the decision can be linked to the different domains.For example, the alarm due to maintenance needs or a failure in a sensor which is linked to the Control Domain, the alarm due to water pollution from the Abiotic Domain, the alarm due to stress or mortality episode from the Species Biotic Domain, and the alarm due to biofouling or predators form the External Biotic Domain.In case of these alarms, the system needs to save all previous information and analyze it in order to find the causes.Reinforced and deep learning can provide valuable tools for learning from these cases and avoiding similar scenarios in the future by generating early warning alarms.The same situation is found in prediction systems with predictions on the failure of actuators, abnormal swimming detected, low DO, or high phytoplankton.These situations will require actions in order to prevent an alarm.Finally, the control system decisions aim to activate or deactivate actuators to prevent alarm situations, for example, activating the aerator if a tank is isolated from the water reconditioning system since the DO will decrease in the tank.Moreover, this system is responsible for regularly operating daily activities, such as adjusting the feeder dose and fed velocity, given the current factors.Another example is to activate the alarm if an abnormal situation is detected.Thus, the three systems are closely related.
A summary of the whole smart control algorithm is presented in Figure 15.

Example 1: Control Algorithm Operation in Sea Cages
As mentioned above, in sea cages, the most relevant use of these algorithms is related to the feeding process.Concerning the feeder control, a series of water quality parameters need to be evaluated.First, the parameters that affect the feed demand are linked to fish metabolic requirements and are mainly affected by water temperature.If low temperatures are detected, the total amount of feed, according to the models based on formulas (1) and ( 2), is decreased by a factor.Then, the system checks if water quality might affect the fish foraging behavior, altering feed consumption over time.If abnormal values are detected in water quality (such as high water turbidity), the speed of feeders is reduced to allow fish to eat the feed.Given the environmental parameters, the system starts feeding at the maximum allowed speed and keeps feeding at the same velocity until the feed falling trespasses an established value.Then, the system assumes that fewer fish are eating, and the feed velocity must be reduced.This continuous checking of feed falling is performed until the calculated amount of feed has been provided.This algorithm is connected with AI, as shown in Figure 16.The models, thresholds, and coefficients used, as well as the water quality parameters to be considered, will be modified by the deep learning parts of the system.In Figures 17 and 18, we can see the feeding process of two stations, one with connectivity with the DB and AI engine, Figure 17a,b, and an example with no connectivity, Figure 18a,b.In the first example, the AI evaluated the water and fish conditions to define the feed dose, and considering the high value of turbidity and low temperature; the control system decided to reduce the dose by up to 5% and the initial feeder velocity by up to 20%.Once the feed falling sensor detects uneaten pellets, the feeder velocity is adjusted to 40% and 20% the second time that feed falling is detected, reducing by 50% every time.The total uneaten feed represents 3.15% of the total feed, and the fish ate in a ratio of 13.82 kg/m 3 .
Biomass (kg) = Mean Body Weight (g) × (Initial f ish − (Initial Fish × Mortality)) 1000 (2) Appl.Sci.2024, 14, x FOR PEER REVIEW 22 of 34 Figure 15.General control algorithm.It is the algorithm that summarizes the processes conducted between the database and the artificial intelligence engine.This algorithm is in charge of conducting the most appropriate decisions in the fish farm facilities to ensure the sustainability of the fish farm, the fish performance, and fish well-being.

Example 1: Control Algorithm Operation in Sea Cages
As mentioned above, in sea cages, the most relevant use of these algorithms is related to the feeding process.Concerning the feeder control, a series of water quality parameters need to be evaluated.First, the parameters that affect the feed demand are linked to fish metabolic requirements and are mainly affected by water temperature.If low temperatures are detected, the total amount of feed, according to the models based on formulas Figure 15.General control algorithm.It is the algorithm that summarizes the processes conducted between the database and the artificial intelligence engine.This algorithm is in charge of conducting the most appropriate decisions in the fish farm facilities to ensure the sustainability of the fish farm, the fish performance, and fish well-being.
feeder velocity by up to 20%.Once the feed falling sensor detects uneaten pellets, the feeder velocity is adjusted to 40% and 20% the second time that feed falling is detected, reducing by 50% every time.The total uneaten feed represents 3.15% of the total feed, and the fish ate in a ratio of 13.82 kg/m 3 .
In the case that no actualization of feeding parameters is given from the DB, the actuator node, according to the fault tolerance algorithm, applies the predefined control algorithm and feeds the cage with the parameters of the last shot.No reduction due to turbidity and temperature is applied, 15 kg/m 3 is applied as the feed dose, and the feeder is started with an initial feeder velocity of 100%.The reduction in the feeder velocity is applied by reducing by 20% every time that uneaten feed is detected.This situation leads to an inefficient feeding process, with 12.13% of the feed left uneaten.The fish consumed feed in a ratio of 13.18 kg/m 3 .Thus, the use of the smart control algorithm supposes the following improvements in the performance of the aquaculture control system:

•
A reduction in the cost of feed, since 14.25 kg/m 3 is used with the smart control algorithm against 15 kg /m 3 with the predefined control algorithm.Considering that feed represents 70% of the costs of aquaculture production, saving 5% of the feed is an important economic saving.

•
An improvement in feed utilization, considering that fish consumed the feed in a ratio of 13.82 kg /m 3 when the fish farm received the information from the DB and the AI compared with the 13.18 kg /m 3 when it did not receive it.This difference in feed consumption supposes better fish growth, which implies a better fish size at the harvest moment resulting in a higher market price of the produced fish.

•
A reduction in environmental pollution due to uneaten food pellets, since 0.45 kg /m 3 are deposited in the seabed when the system is fully operative.The value increases to 1.82 kg /m 3 when predefined control algorithms regulate the feeding process.Uneaten feed is considered one of the most relevant environmental impacts of the aquaculture industry.A reduction in environmental impact supposes a greener and more sustainable production, better usage of resources, and cleaner oceans.In addition, the uneaten feed might unleash several pollution problems, which can affect fish, causing a decrease in fish welfare.When feed falling is detected, the feeder velocity is reduced from 100% to 80%, then to 60%, 40%, and 20%.

Example 2: Control Algorithm Operation in RAS
As mentioned in previous subsections, the isolation of tanks due to malfunctioning of the water reconditioning system or stopping them due to maintenance is one of the possibilities in RAS facilities.Concerning the isolated tank operation, the algorithm is triggered when the water quality monitoring subsystem detects an abnormal situation and sends an alarm.First of all, the algorithm checks the values of the water quality parameters at the end of filtration and the threshold values for the tanks (based on fish species and development stage).Then, it identifies the affected tanks and calculates the maximum and minimum values of the aeration system to keep the DO in range.Immediately, it closes the water pumps and turns on the aeration at the minimum value.From that moment, the systems continuously check the DO values in each tank and readjust the aeration level to ensure that the DO does not decrease from the recommended values.Moreover, it checks if the condition at the end of the filtration tank has improved, allowing the water circulation to be reestablished.Once the water condition improves, the system turns on the water pumping, closes the aeration, and sends a message to the rest of the system stating that no tanks are isolated.This algorithm is integrated with AI, as illustrated in Figure 19.The deep learning components of the system will adjust the models, thresholds, and coefficients used, as well as the water quality parameters to be considered.In Figure 20a,b, we can see the example of the operation of RAS with connectivity with the DB and AI engine during a failure in the solid filter and the example when there is no connectivity in Figure 21a,b.
In the first case, the solid filter starts to operate abnormally, and then the AI predicts its imminent failure based on the change in the trend of the data.This triggers three When feed falling is detected, the feeder velocity is reduced from 100% to 80%, then to 60%, 40%, and 20%.
In the case that no actualization of feeding parameters is given from the DB, the actuator node, according to the fault tolerance algorithm, applies the predefined control algorithm and feeds the cage with the parameters of the last shot.No reduction due to turbidity and temperature is applied, 15 kg/m 3 is applied as the feed dose, and the feeder is started with an initial feeder velocity of 100%.The reduction in the feeder velocity is applied by reducing by 20% every time that uneaten feed is detected.This situation leads to an inefficient feeding process, with 12.13% of the feed left uneaten.The fish consumed feed in a ratio of 13.18 kg/m 3 .
Thus, the use of the smart control algorithm supposes the following improvements in the performance of the aquaculture control system: • A reduction in the cost of feed, since 14.25 kg/m 3 is used with the smart control algorithm against 15 kg /m 3 with the predefined control algorithm.Considering that feed represents 70% of the costs of aquaculture production, saving 5% of the feed is an important economic saving.• An improvement in feed utilization, considering that fish consumed the feed in a ratio of 13.82 kg /m 3 when the fish farm received the information from the DB and the AI compared with the 13.18 kg /m 3 when it did not receive it.This difference in feed consumption supposes better fish growth, which implies a better fish size at the harvest moment resulting in a higher market price of the produced fish.• A reduction in environmental pollution due to uneaten food pellets, since 0.45 kg /m 3  are deposited in the seabed when the system is fully operative.The value increases to 1.82 kg /m 3 when predefined control algorithms regulate the feeding process.
Uneaten feed is considered one of the most relevant environmental impacts of the aquaculture industry.A reduction in environmental impact supposes a greener and more sustainable production, better usage of resources, and cleaner oceans.In addition, the uneaten feed might unleash several pollution problems, which can affect fish, causing a decrease in fish welfare.

Example 2: Control Algorithm Operation in RAS
As mentioned in previous subsections, the isolation of tanks due to malfunctioning of the water reconditioning system or stopping them due to maintenance is one of the possibilities in RAS facilities.Concerning the isolated tank operation, the algorithm is triggered when the water quality monitoring subsystem detects an abnormal situation and sends an alarm.First of all, the algorithm checks the values of the water quality parameters at the end of filtration and the threshold values for the tanks (based on fish species and development stage).Then, it identifies the affected tanks and calculates the maximum and minimum values of the aeration system to keep the DO in range.Immediately, it closes the water pumps and turns on the aeration at the minimum value.From that moment, the systems continuously check the DO values in each tank and readjust the aeration level to ensure that the DO does not decrease from the recommended values.Moreover, it checks if the condition at the end of the filtration tank has improved, allowing the water circulation to be reestablished.Once the water condition improves, the system turns on the water pumping, closes the aeration, and sends a message to the rest of the system stating that no tanks are isolated.This algorithm is integrated with AI, as illustrated in Figure 19.The deep learning components of the system will adjust the models, thresholds, and coefficients used, as well as the water quality parameters to be considered.In Figure 20a,b, we can see the example of the operation of RAS with connectivity with the DB and AI engine during a failure in the solid filter and the example when there is no connectivity in Figure 21a,b.different decisions; the first is to isolate the tanks and the rest of the water reconditioning system to prevent the excess turbidity from reaching the biofilter and tanks.The second is to activate the aeration of tanks at a 15% ratio and start to increase it slowly as time passes, given an exponential model that is calculated to keep the DO at the maximum DO value.The last action is to activate the alarm in the solid filter to ensure that a worker fixes the problem in the filter.This alarm ensures that the problem is solved after a few minutes, and the complete failure of the solid filter is prevented while the fish welfare is assured.The maximum turbidity in the tank is 2.5 NTUs, the minimum DO is 8.49 mg/L, and the aeration system operates for 19 min at an average ratio of 24%.When no connection with the smart algorithm is available, the IA cannot detect the trend of the solid filter change, and no action is taken.The turbidity increases in the tank until it reaches a threshold that activates the predefined control algorithm that closes the water entrance of the tank.Then, the DO starts to decrease since the aeration is not automatically triggered.Once the DO drops below the limit, the aeration is turned on based on the predefined control algorithm.The aeration starts operating at 100% until the DO reaches the upper limit of the DO.Then, it is deactivated, and the DO decays again, producing a future activation of the aeration.The maximum turbidity in the tank is 20 NTUs, cause the necessity of replacing elements of the facilities.Adequate maintenance based on the prediction of failures, thanks to the Smart Control System, reduces the time workers must dedicate to maintenance tasks.In this case, the use of the control system facilitates that the solid filters are fixed in the first minutes by simple action with no need to replace elements.This supposes economic savings for the company and better working conditions for operators.In the first case, the solid filter starts to operate abnormally, and then the AI predicts its imminent failure based on the change in the trend of the data.This triggers three different decisions; the first is to isolate the tanks and the rest of the water reconditioning system to prevent the excess turbidity from reaching the biofilter and tanks.The second is to activate the aeration of tanks at a 15% ratio and start to increase it slowly as time passes, given an exponential model that is calculated to keep the DO at the maximum DO value.The last action is to activate the alarm in the solid filter to ensure that a worker fixes the problem in the filter.This alarm ensures that the problem is solved after a few minutes, and the complete failure of the solid filter is prevented while the fish welfare is assured.The maximum turbidity in the tank is 2.5 NTUs, the minimum DO is 8.49 mg/L, and the aeration system operates for 19 min at an average ratio of 24%.
When no connection with the smart algorithm is available, the IA cannot detect the trend of the solid filter change, and no action is taken.The turbidity increases in the tank until it reaches a threshold that activates the predefined control algorithm that closes the water entrance of the tank.Then, the DO starts to decrease since the aeration is not automatically triggered.Once the DO drops below the limit, the aeration is turned on based on the predefined control algorithm.The aeration starts operating at 100% until the DO reaches the upper limit of the DO.Then, it is deactivated, and the DO decays again, producing a future activation of the aeration.The maximum turbidity in the tank is The high turbidity and use of upper and lower limits of dissolved oxygen for the activation of the aeration system produce unstable water quality conditions in the tank which affect the fish welfare.

Conclusions
The proposed control system for aquaculture facilities outperforms the existing systems for aquaculture control.It is more complex in terms of included parameters, information sources, and actuators.In addition, the used architecture, communication technology, and network protocols ensure its scalability to large fish farms with dozens of cages or tanks.The use of low-cost devices, such as the nodes and sensors, as well as LoRa and WiFI as communication technologies, makes possible the system's low cost.The presented smart control algorithm ensures continuous machine learning, which will provide accurate decisions.Finally, the fault tolerance mechanisms, which include backup communication technologies with the DB, an off-line operation mode thanks to the predefined control algorithms, and data processing methods to detect false values, endow the system with a high level of robustness.All these characteristics, together with the versatility and adaptability of the system to different fish farm scenarios, as presented in Example 1 and Example 2, make this system extremely useful for the fish farm industry.
It is acknowledged that the maritime climate is a harsh environment, necessitating proper isolation of all devices to prevent damage.Although traditionally considered expensive, recent publications [14,120] indicate that new low-cost devices have emerged on the market in recent years.Some recent papers have claimed the cost of sensors for water The high turbidity and use of upper and lower limits of dissolved oxygen for the activation of the aeration system produce unstable water quality conditions in the tank which affect the fish welfare.
Thus, the use of the smart control algorithm supposes the following improvements in the performance of the aquaculture control system: • An increase in fish welfare, since the water quality conditions in the tank in the first example are much better than in the second case.The reduced DO and high turbidity cause stress and alterations in the swimming patterns of fish.The turbidity in the first case represents 12.5% of the turbidity in the second case.The DO in the first case dropped by less than 2%.Meanwhile, the DO reduction is supposed to be 8% in the second case.• An improvement in energy use, since the use of aeration, is more efficient in the first case.Even though aeration is activated for more time, 19 min in the first case compared with 7 min in the second case, the power consumption of the aeration system is much higher in the second case.The energy is reduced by 35% when the AI of the control system controls the situation compared with the predefined control algorithms.

•
Finally, the fast action of workers due to the alarm helped to avoid further problems in the fish farm facilities in the first case.In the second case, no activation of the alarm is triggered by the AI.Thus, the turbidity reaches different parts of the water conditioning steps and the tanks.This supposes more maintenance tasks and can even cause the necessity of replacing elements of the facilities.Adequate maintenance based on the prediction of failures, thanks to the Smart Control System, reduces the time workers must dedicate to maintenance tasks.In this case, the use of the control system facilitates that the solid filters are fixed in the first minutes by simple action with no need to replace elements.This supposes economic savings for the company and better working conditions for operators.

Conclusions
The proposed control system for aquaculture facilities outperforms the existing systems for aquaculture control.It is more complex in terms of included parameters, information sources, and actuators.In addition, the used architecture, communication technology, and network protocols ensure its scalability to large fish farms with dozens of cages or tanks.The use of low-cost devices, such as the nodes and sensors, as well as LoRa and WiFI as communication technologies, makes possible the system's low cost.The presented smart control algorithm ensures continuous machine learning, which will provide accurate decisions.Finally, the fault tolerance mechanisms, which include backup communication technologies with the DB, an off-line operation mode thanks to the predefined control algorithms, and data processing methods to detect false values, endow the system with a high level of robustness.All these characteristics, together with the versatility and adaptability of the system to different fish farm scenarios, as presented in Example 1 and Example 2, make this system extremely useful for the fish farm industry.
It is acknowledged that the maritime climate is a harsh environment, necessitating proper isolation of all devices to prevent damage.Although traditionally considered expensive, recent publications [14,120] indicate that new low-cost devices have emerged on the market in recent years.Some recent papers have claimed the cost of sensors for water quality monitoring for a coastal aquaculture system is lower than EUR 6000 [14], EUR 2000 [120], or even less than EUR 500 if we focus on tank monitoring [110].The final cost will be related to the included parameters, the location, and the number of monitored tanks/cages.The cost of the proposed control system in this paper depends on the cloud services for data storage and algorithm operation.It is impossible to offer the value of these services, given the high heterogeneity in these services and the possibility of using local storage.Nevertheless, estimated costs can be close to EUR 100/month, which are easily offset by savings in energy, feed, and enhanced fish performance.
In future work, the proposed system will be tested in fish tanks and more low-cost sensors will be tested and calibrated.So far, some of the included sensors still require high maintenance needs and have membranes of selective electrodes such as the ones for DO and pH.The creation of physical sensors that require a low level of maintenance and have a low cost will be a top priority.Moreover, the adaptation of LoRa technology to create tree topology networks to connect a different group of cages, and the use of LoRa underwater as a possible alternative for underwater acoustic modes, are currently being studied.

Figure 1 .
Figure 1.Included Domains in aquaculture.Different Domains that affect fish performance and well-being that are considered in this paper.The following subsections analyze each one of the Domains detailing the most important factors for the Control of Aquaculture.

Figure 1 .
Figure 1.Included Domains in aquaculture.Different Domains that affect fish performance and well-being that are considered in this paper.The following subsections analyze each one of the Domains detailing the most important factors for the Control of Aquaculture.

Figure 2 .
Figure 2. Factors of the Production Domain.The managers of the aquaculture facilities define the factors of the Production Domain, some of them cannot be modified, such as the location.The feed and feeding procedure greatly impacts fish performance and well-being and can be adapted to the grown species and the other Domains.

Figure 2 .
Figure 2. Factors of the Production Domain.The managers of the aquaculture facilities define the factors of the Production Domain, some of them cannot be modified, such as the location.The feed and feeding procedure greatly impacts fish performance and well-being and can be adapted to the grown species and the other Domains.

Figure 3 .
Figure 3. Factors of the Abiotic Domain.These factors depend on the environment in which the aquaculture facilities are placed, including the water, atmosphere, and light.According to the type of aquaculture facilities, there is the possibility of modifying or adjusting some of these factors.

Figure 4 .
Figure 4. Factors of the Species Biotic Domain.The species in the aquaculture facilities defined these factors, which can be divided into the growing stage, physiology of the species, and social behavior.Some of the fish's behavior depends on other aspects.For example, cannibalism depends on the growing stage and the growing uniformity.

Figure 4 .
Figure 4. Factors of the Species Biotic Domain.The species in the aquaculture facilities defined these factors, which can be divided into the growing stage, physiology of the species, and social behavior.Some of the fish's behavior depends on other aspects.For example, cannibalism depends on the growing stage and the growing uniformity.

34 Figure 5 .
Figure 5. Factors of the External Biotic Domain.These are the factors that depend on the other living beings in the fish farm facilities and their surroundings.It includes the effects of animals, plants, and other living beings on the fish, the facilities, and control mechanisms.

Figure 5 .
Figure 5. Factors of the External Biotic Domain.These are the factors that depend on the other living beings in the fish farm facilities and their surroundings.It includes the effects of animals, plants, and other living beings on the fish, the facilities, and control mechanisms.

Appl. 34 Figure 6 .
Figure 6.Factors of the Control Domain.There are two main groups of factors in the Control Domain, the monitoring and the control factors, which are in turn divided into water quality, light, current, and feeding control.In sea cages, only monitoring and control of feeding can be applied.In RAS facilities, most of the parameters can be monitored and controlled.

FeedersFigure 6 .
Figure 6.Factors of the Control Domain.There are two main groups of factors in the Control Domain, the monitoring and the control factors, which are in turn divided into water quality, light, current, and feeding control.In sea cages, only monitoring and control of feeding can be applied.In RAS facilities, most of the parameters can be monitored and controlled.

34 Figure 7 .
Figure 7.Interaction between factors of included domains.In this graphic, we can see the relationship between factors, the brighter the line, the greater the amount of interaction between factors.Note that some factors have been excluded from this analysis if they have no interaction, and some factors might be combined due to similar interactions with other factors.The color of the factors indicates the Domain.

Figure 7 .
Figure 7.Interaction between factors of included domains.In this graphic, we can see the relationship between factors, the brighter the line, the greater the amount of interaction between factors.Note that some factors have been excluded from this analysis if they have no interaction, and some factors might be combined due to similar interactions with other factors.The color of the factors indicates the Domain.

34 Figure 8 .
Figure 8. Factors with the highest number of interactions.In this graphic, we represented the factors with the highest number of interactions.Note that a higher number of interactions might indicate that the factors are important for the control system, but factors with a low number of interactions cannot be discarded automatically since the interaction can be crucial.The color of the factors indicates the Domain. 0 Appl.Sci.2024, 14, x FOR PEER REVIEW 12 of 34

Figure 9 .
Figure 9. Factors considered for Smart Low-Cost Control Systems for aquaculture facilities in cages in the sea.These are the factors that must be included in control systems in fish farms in the sea.Factors of the five domains are included.Most of the factors are used only for monitoring with sensors.Only three factors are related to the use of actuators.

Figure 9 .
Figure 9. Factors considered for Smart Low-Cost Control Systems for aquaculture facilities in cages in the sea.These are the factors that must be included in control systems in fish farms in the sea.Factors of the five domains are included.Most of the factors are used only for monitoring with sensors.Only three factors are related to the use of actuators.

Figure 10 .Figure 10 .
Figure 10.Factors considered for Smart Low-Cost Control Systems for aquaculture facilities in RAS.A larger number of factors are included compared with Figure 9.Most of the factors belong to the Control Domain.Only two factors belong to the External Abiotic Domain since the RAS water system is isolated.

Figure 11 .
Figure11.Main software and hardware elements that comprise the proposed system.Examples a given for sensors and actuators, but the included parameters and the number of elements must adapted to the monitoring scenario.

Figure 11 .
Figure11.Main software and hardware elements that comprise the proposed system.Examples are given for sensors and actuators, but the included parameters and the number of elements must be adapted to the monitoring scenario.

4. 1 .
Proposal for Smart Low-Cost Control Systems for Aquaculture Facilities with Cages in the Sea 4.1.1.General Aspects For the proposal of Smart Low-Cost Control Systems for Aquaculture Facilities with cages in the sea, we propose the combination of two sensing methods to be integrated into a smart Control Portal to generate a Database (DB) for optimal aquaculture management.The deployment of the system is illustrated in Figure 12.The Control Portal will consist of a big DB which includes information from WSN deployed in different parts of aquaculture cages and from remote sensing open access data (such as Sentinel 2).

Figure 12 .
Figure 12.Deployment of aquaculture control system in cages.The deployment of sensor buoys, actuator buoys, gateways, and wireless technologies can be identified.The integration of remote sensing and WSN in the Database and Artificial Intelligence can be seen.

Figure 12 .
Figure 12.Deployment of aquaculture control system in cages.The deployment of sensor buoys, actuator buoys, gateways, and wireless technologies can be identified.The integration of remote sensing and WSN in the Database and Artificial Intelligence can be seen.

Figure 13
Figure13.Deployment of aquaculture control system in RAS.The main difference is to be found in the location and typology of sensors and actuators.A general perspective of the water reconditioning system and the detail of one tank is shown.

Figure 16 .
Figure16.Smart algorithm for feeder controller subsystem.This algorithm represents the initial algorithm provided to the deep learning system, which will evolve based on sensed data and the output values of other decision-making algorithms.

Figure 17 .Figure 17 .
Figure 17.Feed falling in Scenario 1 with connection with the Smart Control System.(a) Represents the remaining feed and the feeder velocity, and (b) illustrates the uneaten feed and feed falling detection.When feed falling is detected, the feeder velocity is reduced from 80% to 40%, and then to 20%.

Figure 18 .
Figure 18.Scenario 1 without connection to the Smart Control System.(a) Shows the remaining feed and the feeder velocity.(b) Portrays the uneaten feed and feed falling detection.When feed falling is detected, the feeder velocity is reduced from 100% to 80%, then to 60%, 40%, and 20%.

Figure 18 .
Figure 18.Scenario 1 without connection to the Smart Control System.(a) Shows the remaining feed and the feeder velocity.(b) Portrays the uneaten feed and feed falling detection.When feed falling is detected, the feeder velocity is reduced from 100% to 80%, then to 60%, 40%, and 20%.

Figure 19 .
Figure19.Smart algorithm for isolated tank subsystem.This algorithm represents the initial algorithm provided to the deep learning system, which will evolve based on sensed data and the output values of other decision-making algorithms.

Figure 20 .
Figure 20.Scenario 2 with connected Smart Control System.(a) Depicts the conditions of turbidity and dissolved oxygen in the tanks.(b) Illustrates the operation of the water flow pump and aeration system.The automatic isolation of the tank and activation of the aeration system ensures that fish welfare is preserved.

Figure 20 .
Figure 20.Scenario 2 with connected Smart Control System.(a) Depicts the conditions of turbidity and dissolved oxygen in the tanks.(b) Illustrates the operation of the water flow pump and aeration system.The automatic isolation of the tank and activation of the aeration system ensures that fish welfare is preserved.

Figure 21 .
Figure 21.Scenario 2 without connection to the Smart Control System.(a) Portrays the water quality conditions in the tanks.(b) Shows the operation of the water flow pump and aeration system.The high turbidity and use of upper and lower limits of dissolved oxygen for the activation of the aeration system produce unstable water quality conditions in the tank which affect the fish welfare.

Figure 21 .
Figure 21.Scenario 2 without connection to the Smart Control System.(a) Portrays the water quality conditions in the tanks.(b) Shows the operation of the water flow pump and aeration system.The high turbidity and use of upper and lower limits of dissolved oxygen for the activation of the aeration system produce unstable water quality conditions in the tank which affect the fish welfare.
portrays the information above related to the external biotic factors identified for the proposed Smart Low-Cost Control Systems for Aquaculture Facilities.

15 19 20 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 1 62 63 64 6566 67 1 Tank Dimensions 2 Tank Material 3 Tank Colour 4 Cage Dimensions 5 Net Material 6 Net Support 7 Ships 8 Feed Quality 9 Feed Dose 10 Feed Shorts 11 Shots Schedule 12 Water Temperature 13 Dissolved Oxygen 14 Salinity 15 Turbidity 16 Water Colour 17 pH 18 Pollution 19
Factors with the highest number of interactions.In this graphic, we represented the factors with the highest number of interactions.Note that a higher number of interactions might indicate that the factors are important for the control system, but factors with a low number of interactions cannot be discarded automatically since the interaction can be crucial.The color of the factors indicates the Domain.
Appl.Sci.2024, 14, x FOR PEER REVIEW 13 of 34 pollution (hydrocarbon, phytoplankton), and current.All these data are needed to activate/deactivate the water control mechanism in the facilities (such as pumping systems, aerators or oxygenators, water heating/cooling, filters, skimmers, disinfection, and salinity correction…).Data can also indicate a general or partial failure of these control mechanisms.The light intensity is another aspect to be monitored since it can indicate a general or partial failure in the illumination system.

Fish behavior (stress, hunger ...) System sustainability Presence of Predators Presence of Pollution Water and weather conditions Water Temp. Sea Swell Turbidity Water flow Salinity Feed falling DO Light intensity Swimming depth pH Pollution Wind
Smart algorithm for feeder controller subsystem.This algorithm represents the initial algorithm provided to the deep learning system, which will evolve based on sensed data and the output values of other decision-making algorithms.
Smart algorithm for isolated tank subsystem.This algorithm represents the initial algorithm provided to the deep learning system, which will evolve based on sensed data and the output values of other decision-making algorithms.