2.1. System Design and Control of Aquaponic System
This project designed a model aquaponic system with RDWC, as shown in
Figure 1, for indoor space. The manufacturer has a separate tank, which includes a fish tank, tank filter, and hydroponic pond along with foam boards. The size of the fish tank and hydroponic pond are 66 cm × 48.6 cm × 41 cm. The fishpond was filled with groundwater up to 115 L.
Recirculated deep-water culture (RDWC) is a construction method used in aquaponics. Deep-water culture carries the concept of floating vegetables using floating rafts made of foam boards with holes to access vegetable nutrition [
3]. The aquaponics system in this study uses the recirculated deep-water culture (RDWC) method with several advantages and disadvantages. This RDWC model provides optimal vegetable growth since the growing space is large, roots hang freely, and it is easy to clean and maintain. The disadvantage is the float rafts that affect air circulation in water the, thus harming the root vegetables. To ensure the health of the root vegetables, there are some ways to counter the problem, such as maintaining the water level to prevent the roots from drying out and adding more air circulation. The system is implemented with an ultrasonic water level sensor and an aerator pump to degas carbon dioxide (CO
2). Water circulation that continues to flow can reduce the water quality because there will be changes in water turbidity. Turbidity can come from fish metabolism, including feces, urine, and dissolved fish food that settles and dissolves in the water [
31]. Water turbidity can cause increased stress on the fish and interfere with the penetration of light into the water. This can disrupt photosynthesis in aquatic plants, resulting in decreased oxygen levels in the water. Low oxygen levels can lead to fish death, harm aquatic ecosystems, and decrease water quality. When the turbidity level increases, it is recommended to change the water. To prevent this, people should regularly monitor water turbidity and take steps to reduce it if necessary. This can include reducing fertilizer use and avoiding activities that could stir up sediment. Additionally, aquatic plants can be planted in areas where they are likely to thrive and help improve water quality.
Vegetables need sufficient nitrate nutrients to grow well. Nitrate can be obtained through the biofilter nitrification process. The nitrification process, as shown in
Figure 2, is the process of decomposing ammonia by oxidation into nitrite, and then nitrite is oxidized back into nitrate. Ammonia itself comes from fish activities that produce fish waste. Before the nitrification process, fish waste that enters the mechanical filter settles at the bottom of the filter. The nitrification process will then take place in the biofilter. To optimize water spinach growth, the amount of nutrients in the water must be sufficient, which can be measured by the total dissolved solids (TDS) content [
32]. Water spinach total dissolved solids range from 800 to 1000 ppm [
32]. Commercial pellet feeds contain 30% protein, which is sufficient for 50% of the nutrients the vegetables require for optimal growth. However, excessive fish feeding can negatively affect the pH level because ammonia and nitrite levels increase it. The pH level in the water impacts the growth and life of the vegetables, fish, and bacteria [
6]. The pH level provides an indication of the acidity or alkalinity of the water, which can have a direct effect on how well the plants and animals can survive in the water. Too much acid or alkali in the water can be toxic to many organisms, so it is important to maintain a neutral pH level if possible. For example, catfish have a pH range of 6–9, which means they can tolerate both acidic and alkaline water. In contrast, water spinach has a pH range of 5.6–6.5, which means it can only tolerate acidic water. The two species can coexist if the water pH is acidic, but not the other way around, as the water spinach can die if the water pH is alkaline.
An aquaponic system must be monitored regularly with sensors and adjusted when necessary to ensure the proper functioning of the system and the health of the vegetables, fish, and bacteria. The pH level can be affected by a wide range of factors, including the amount of fish food consumed and the temperature [
12,
32]. The increase in temperature encourages this reaction by increasing molecular ionization and producing more hydrogen ions (H+), causing the pH in the water to become acidic. In this case, controlling the water temperature manually is less effective, so a temperature sensor is needed to help monitor the water temperature.
2.4. Mathematicial Modelling
The mathematical model of the liquid level in a tank was derived using a mass balance. The model controls the flow rate of liquid in the tank. The model can be used to predict how the liquid level will change over time. It can optimize tank design and operation.
Our aquaponic system is shown in
Figure 3. Here, qin is the rate of water entering the tank, qout is the rate of water exiting the tank, and A is the area of the tank. The resistance of the flowing liquid from the exhaust pipe and the capacitance of the level tank are calculated as follows.
Assuming that the inlet and outlet flow rate density is constant, then
If the level tank is assumed as linear,
Therefore, substituting Equation (4) into Equation (3), we obtain the following:
which is the differential equation relating the fluid level in the tank to the flow rate into the tank at time (t). Referring to
Table 2 and
Table 3 and taking the Laplace transform for both sides of equation, the final transfer function of the water level control process is estimated as follows:
The final transfer function of the tank is shown as follows:
The mathematical model of water tank was derived using a mass and energy balance. There was one variable power electrical input and one variable temperature output on the tank [
2]. The following assumptions were made:
The density and heat capacity of the water are constant.
The temperature of the inlet water tank is constant (27 °C).
The level of water in the tank is constant.
The cross-sectional area of the tank is constant.
The heat losses to the surroundings are neglected.
From the energy balance around the tank, we obtain:
Since
, then
For the steady-state condition,
Then
Assuming the temperature
= constant, then
From Equations (10)–(15), the transfer function obtained from the mathematical modeling was used to design the PID controller using the SIMULINK MATLAB software.
2.6. Hardware Design
In the block diagram integration control system, shown in
Figure 9, the microcontroller (PIC18F4550) functioned as the brains of the system, all the input data from the sensor were processed, and the result provided the decision to the actuator towards a certain condition. There were several actuators which were integrated in the system, including a DC water pump, solenoid water valve, water heater, and automated fish feeder. More detail about how the system worked can be seen in the software flowchart in
Section 2.7.
Figure 10 shows an overview of the circuit diagram by providing a comprehensive snapshot of the electrical components and connections of this proposed work.
- A.
pH (pondus hydrogenii) sensor
The pH sensor in aquaponics, specifically the SEN0161 model, is key for monitoring water’s acidity or alkalinity, which is crucial for fish and plant health. It works by measuring hydrogen ion exchange and translating pH changes into voltage shifts, allowing for precise calibration and real-time pH adjustments. This ensures optimal conditions for the aquaponic system, promoting healthy growth and system reliability. The sensor reading starts from 0 to 14 in a response time of < 1 min. This particular sensor was chosen to ensure that it had a high precision and fast response time. This was because the real-time monitoring and adjusting of an aquaponic system’s water pH levels is critical to ensuring optimal conditions for aquatic life and plants, thus preventing stress and promoting healthy growth.
- B.
Water level sensor
This was selected for its durability and accuracy in detecting water levels, which was critical for preventing overflow or dry-run conditions that could harm the system’s aquatic life. It prevents water overflow or depletion, safeguarding aquatic life and plant roots from damage, thereby ensuring consistent system stability. The sensor reading starts from 2–400 cm with a response time of 100 ms and an accuracy of 3 mm. To keep a constant accuracy, calibration can be carried out.
- C.
Temperature sensor
The temperature sensor features a high sensitivity and quick readings, enabling the effective monitoring of the water temperature to maintain conditions ideal for fish and plant growth, contributing to the system’s efficiency. It enables the maintenance of ideal water temperatures for fish and plant health, essential for maximizing growth rates and yield, thus contributing to the system’s overall efficiency. The LM35 sensor was chosen because it has a reading range from −50 °C to 150 °C, and its accuracy is ±0.5 °C at 25 °C.
- D.
Turbidity sensor
This provides reliable measurements of water clarity, which is essential for assessing the quality of the water and the effectiveness of the filtration system, thus enhancing the system’s reliability. It also helps in monitoring the cleanliness of the water, ensuring the effectiveness of the filtration system and preventing disease outbreaks, thus enhancing the sustainability of the ecosystem. The SEN0189 sensor was selected, and it has a measurement range of 0–3000 NTU.
- E.
Total dissolved solids sensor
With its high accuracy, it monitors the nutrient levels in the water, ensuring the plants receive the correct amount of nutrients for optimal growth, contributing to the system’s effectiveness. It ensures that the plants receive the optimal amount of nutrients without the risk of over- or underfeeding, which is crucial for healthy plant growth and reduced water pollution. The SEN0244 sensor was selected, which has a measurement range of 0–1000 ppm.
- F.
LCD
The LCD 1602A device was chosen because of its ability to display readings, data, and operational statuses clearly and effectively with display formats of 16 characters × 2 lines. It provides a direct, user-friendly interface for displaying real-time data such as water temperature, pH levels, water level, temperature level, turbidity level, and total dissolved solids parameters. This instant feedback allows for timely adjustments and interventions, ensuring that the aquaponic environment is maintained at optimal conditions. By offering clear visibility of system statuses and alerts, the LCD enhances the overall manageability and reliability of the system, allowing operators to prevent potential issues before they escalate.
- G.
LED grow light
Chosen for its optimized spectrum for red and blue plant growth, it provides consistent and suitable light conditions for crop production throughout the year, increasing the system’s productivity.
- H.
Water and aerator pump
These were selected for their reliability and efficiency in oxygenating the water and circulating nutrients, crucial for fish health and plant growth, thus ensuring the system’s stability for fish health and nutrient absorption by plants.
- I.
Fish feeder automation
Timed feeding controls enhance the system’s sustainability and efficiency by mitigating overfeeding, consequently promoting sustainable fish growth and minimizing the necessity for frequent water changes.
- J.
PIC18F4550 microcontroller
This device provides robust control with its reliable performance and flexibility in programming, central to integrating and managing the system’s sensors and actuators.
- K.
Relay
The relay provides reliable switching capabilities for the electrical components of the system, ensuring the safe and effective operation of devices such as pumps and heaters, thereby contributing to system’s safety and robustness.
- L.
Water heater
This ensures that the water temperature is maintained within an optimal range, critical for the health of both fish and plants, thus contributing to the system’s stability. It maintains the water temperature within a species-specific optimal range from 25 °C to 30 °C, crucial for preventing stress on fish and ensuring plant health, thus directly impacting the system’s productivity.
- M.
Solenoid valve
This provides control over the water flow, essential for maintaining optimal water levels and flow rates within the system, thereby preventing water stagnation and changing the fresh water. This enhancement promotes both plant growth and aquatic health.
- N.
ESP8266 Wi-Fi
This provides remote monitoring and control, providing real-time data access and alerts, thus increasing the system’s manageability and responsiveness. It provides real-time access to system data and alerts, allowing for immediate adjustments from anywhere, thus improving system management and responsiveness to environmental changes.