© 2026 The authors. This article is published by IIETA and is licensed under the CC BY 4.0 license (http://creativecommons.org/licenses/by/4.0/).
OPEN ACCESS
Maintaining stable water conditions and feeding schedules in small aquariums remains challenging due to rapid accumulation of feed residues, suspended particles, and limited water volume. This study proposes an Internet of Things (IoT)-enabled closed-loop control system that integrates Fuzzy Water-Quality decision-making, automatic water replacement, and context-aware feeding control for autonomous aquarium management. The proposed framework combines real-time turbidity sensing, dual water-level detection, and a fuzzy inference mechanism to determine appropriate water-replacement actions while preventing unnecessary ecological disturbance. Unlike conventional threshold-based systems, the proposed approach performs a controlled partial water-exchange process by removing approximately 70% of degraded water and retaining the remaining volume to support microbial stability. In addition, a Real-Time Clock (RTC)-based feeding mechanism is coordinated with environmental conditions, allowing feeding operations to be suspended during high turbidity or active water-replacement periods. Experimental evaluation demonstrates that the system successfully restored water clarity, maintained stable water-level conditions at the predefined threshold, and prevented feeding during unsafe environmental states. The integrated IoT monitoring interface further provided real-time visualization of sensor measurements and actuator responses. The proposed system provides a practical closed-loop solution for small-scale aquarium automation by combining environmental sensing, fuzzy reasoning, and autonomous control, offering a more coordinated approach than monitoring-only or fixed-rule-based aquarium management systems.
Internet of Things, fuzzy logic control, autonomous aquarium management, water quality monitoring, closed-loop control, smart feeding system
Traditional small-scale aquarium systems face a persistent challenge in maintaining stable water quality and consistent feeding schedules because owners often lack the time, technical understanding, or monitoring discipline required for proper fish care [1-3]. Water turbidity can change rapidly due to excess feed, accumulated waste, and microbial activity, yet most aquariums still depend on manual observation, making it very difficult to detect early contamination before it reaches harmful levels [4, 5]. As a result, water changes are frequently performed either too late or too drastically [6]. Many users drain all water at once, which disrupts the biological balance of the tank and stresses the fish, while others replace only a small amount, which leaves harmful particulates and unstable microbial conditions in the aquarium. Feeding routines also suffer from inconsistency [7, 8]. Underfeeding leads to nutritional deficiency, while overfeeding accelerates nutrient buildup and increases turbidity, which further degrades the aquatic environment [9]. Existing automated aquarium devices typically provide only isolated functions such as simple feeding timers or basic alerts for water quality without the ability to connect turbidity detection, proportional water replacement, and safe feeding behavior into one coordinated and autonomous process [10, 11]. This separation between sensing, reasoning, and action creates a significant problem for small aquariums where environmental stability is highly sensitive to even minor fluctuations. Therefore, a fully integrated intelligent system is urgently needed to diagnose water conditions, execute proportional water replacement, and synchronize feeding behavior in real time to maintain aquarium stability, reduce fish stress, and eliminate human-dependent inconsistencies [12-14].
This problem was discovered by several related studies, such as research by Ratnasari et al. [15], which developed an Internet of Things (IoT) prototype for automatic fish feeding combined with automatic water replacement in a household aquarium using a NodeMCU ESP8266 controller and turbidity sensing to trigger cleaning actions. The system scheduled feeding and activated a pump to replace water when the turbidity threshold was exceeded, demonstrating that integrating automatic feeding with water changing can reduce owner workload and keep fish healthier. However, the design still relied on fixed threshold rules and a full or near-full water change, without proportional control of the drained and refilled volumes, and it did not consider the biological impact of completely discarding old water. The study also did not implement any intelligent decision mechanism such as fuzzy logic, and the authors focused more on functionality than on fine-grained coordination between feeding events and water quality restoration.
Research by Muhamad et al. [16] also addressed similar issues through the design of an aquarium monitoring and automatic feeding system based on the Internet of Things, where water temperature, pH, and turbidity were monitored continuously, and feeding was performed automatically through a smart aquarium application. The main contribution of this work was to show that low-cost IoT infrastructure can provide real-time visibility of aquarium conditions and reduce fish mortality by combining environmental monitoring with scheduled automatic feeding, all accessible from a mobile interface. Nonetheless, the system in the study [16] treated water quality as an object of monitoring only, without any active water management such as controlled draining or refilling, and the feeding logic remained purely time-based, so excess feed could still accumulate and degrade water quality when turbidity increased.
Research by Indrawati et al. [17] moved closer to intelligent control by proposing a fuzzy logic-based automatic fish feeding and water quality control system, where temperature, pH, and clarity were used as input variables and the outputs controlled aerators, heaters, coolers, and the feeding motor. This approach showed that fuzzy inference can effectively handle uncertain and nonlinear relationships between multiple water quality indicators and actuator responses, achieving less than 5% average error in determining water quality and the amount of feed required. However, the system was designed for pond-scale aquaculture rather than small aquariums, and the water management strategy focused on conditioning the existing water column through aeration and temperature control rather than performing partial water replacement. The authors did not consider level-based draining and refilling cycles nor percentage-based exchange of water, so the link between turbidity events, physical water renewal, and safe feeding remained incomplete in the context of highly constrained tank volumes.
Research by Chiu et al. [18] further highlighted the importance of adaptive feeding in relation to water quality through an AIoT precision feeding management system that used a buoy equipped with a three-axis accelerometer to measure surface fluctuations during foraging and dynamically adjust the number of pellets delivered. The system successfully reduced feed waste and mitigated water pollution in production ponds by shortening feeding duration once fish competition decreased, illustrating the benefit of sensing fish behavior rather than relying solely on fixed feeding schedules. Despite these advantages, the work in the study [18] did not target indoor aquariums and did not integrate turbidity-driven water management or partial water replacement; instead, it assumed that water quality would be handled by separate infrastructure. As a result, the feeding controller was intelligent with respect to fish appetite, but it was not coupled to a local closed-loop mechanism that could drain a specific percentage of murky water, refill with clean water, and coordinate feeding timing within a small and highly sensitive aquatic environment.
Based on the identified problem, this study does not aim to introduce entirely new individual technologies, but rather to develop a tightly integrated control framework that combines water-quality sensing, decision-making, and actuation into a single closed-loop system tailored for small-scale aquariums. The main technical contribution lies in the design of a Fuzzy Water-Quality Decision Block that directly links turbidity conditions to a proportional and biologically informed water-replacement strategy. Instead of applying fixed threshold-based actions, the proposed approach enables gradual decision-making and triggers a controlled 70% partial water-exchange cycle while preserving 30% of the original water to maintain microbial stability and reduce fish stress. In addition, the system incorporates a context-aware feeding mechanism that integrates environmental conditions with time-based scheduling, where feeding is automatically inhibited during unsafe water conditions and active drain–refill operations. Therefore, the contribution of this work lies in the coordinated interaction of fuzzy reasoning, proportional water management, and feeding control, forming a unified autonomous system specifically designed for compact aquarium environments.
In addition to water-quality intelligence, the system introduces an integrated feeding logic that blends environmental cues with time-based decision-making. Feeding is regulated by a dual-mode mechanism: (1) environment-driven restriction, where feeding is temporarily inhibited during the active drain-refill phase to prevent food wastage and avoid contamination spikes, and (2) time-driven activation, where a Real-Time Clock (RTC) module triggers the automatic fish feeder at precisely 08:00 AM and 05:00 PM. All sensing, actuation, and decision-making modules, including the turbidity sensor, dual water-level thresholds (30% water-remaining threshold for drain cutoff and 16-cm height threshold for refill cutoff), drain pump, fill pump, and feeding servo, are orchestrated through a NodeMCU/ESP8266 controller and continuously synchronized with an IoT cloud dashboard for real-time monitoring. This tightly coupled interaction of fuzzy-based water-quality reasoning, percentage-based dynamic water replacement, and time-synchronized feeding provides a more integrated and coordinated approach compared to existing small-scale aquarium automation systems. The IoT component in this study primarily serves as a supporting layer for real-time monitoring and system observability, enabling users to track turbidity dynamics, actuator states, and feeding events without interfering with autonomous operations.
Beyond system implementation, this study contributes to the design of an integrated decision-driven control framework for small-scale aquatic environments. The proposed approach formalizes the interaction between sensing, decision-making, and actuation within a closed-loop architecture, providing a structured method to coordinate water-quality management and feeding behavior. This perspective positions the work not only as an engineering implementation but also as a system-level contribution to intelligent aquarium management.
From an information systems perspective, the proposed architecture can be interpreted as a data-driven control system that integrates sensing, processing, decision-making, and user-level visualization into a unified framework. The system continuously collects environmental data, processes it through a fuzzy decision layer, and delivers actionable responses through automated actuation while providing real-time feedback to users via an IoT-based monitoring interface. This integration of data acquisition, intelligent processing, and system observability aligns with the broader scope of information systems.
The proposed method in this study follows a sequential architecture that integrates water-quality sensing, fuzzy-based decision-making, automatic water replacement, and time-synchronized fish feeding into a unified control workflow. Each stage of the system is designed to operate in a continuous loop, beginning from sensor acquisition to intelligent reasoning and finally to actuator execution, ensuring that every action is triggered by real-time environmental conditions or scheduled events. This structured sequence allows the system to maintain aquarium stability by coordinating water management and feeding operations as a single, cohesive process.
2.1 System architecture
The overall system architecture is designed as an integrated sequential control framework that combines sensing, intelligent decision-making, and actuation into a unified operation tailored for a compact aquarium with physical dimensions of 48 × 12 × 21 cm. As illustrated in Figure 1, the system is structured into four main layers, namely the sensing layer, the fuzzy-based decision layer, the actuation layer, and the IoT monitoring layer. The sensing layer acquires real-time environmental data through two primary components: a turbidity sensor positioned at mid-depth to evaluate water clarity, and a dual-threshold water level sensor installed vertically to detect both the lower limit used during draining and the upper limit used during refilling. These sensor signals are transmitted to the NodeMCU ESP8266, which functions as the central controller.
Figure 1. System architecture of the proposed Internet of Things (IoT)
The fuzzy-based decision layer interprets turbidity input and determines the appropriate corrective action. When poor water quality is detected, the decision output controls the actuation layer, which consists of the drain pump, the fill pump connected to a 5,200 L water tank, and the servo-driven automatic fish feeder. The water replacement and feeding mechanisms operate sequentially based on the system’s logic, while the RTC module ensures that feeding remains aligned with scheduled times. The final layer, the IoT monitoring system, transmits water quality data, pump activity, and feeding logs to a cloud platform for real-time visualization on a smartphone. Through this multilayer integration, the system maintains stable aquarium conditions while minimizing human involvement.
2.2 Hardware configuration
The architectural system in Figure 1 is completely connected as shown in the Hardware Design in Figure 2, where all sensing, decision-making, and actuation modules are interconnected to form a unified physical implementation. The hardware design integrates each component into a sequential workflow that enables real-time monitoring, fuzzy-driven water quality control, partial water replacement, and scheduled fish feeding within the constrained dimensions of the 48 × 12 × 21 cm aquarium. At the core of the system is the NodeMCU ESP8266, which functions as the central processing unit responsible for acquiring sensor data, executing the fuzzy inference engine, generating control signals for pumps and the feeder servo, synchronizing feeding events via the RTC module, and transmitting telemetry data to the IoT cloud. The NodeMCU receives continuous analog input from the turbidity sensor, which detects the clarity of water, and digital input from the dual threshold water level sensor, which identifies both the 30% water remaining cutoff during drainage and the 16 cm refill limit during water replenishment.
Figure 2. Detailed hardware design
To support the automatic water management mechanism, the hardware configuration includes two types of pump systems. The first is the drain pump, positioned at the lower outlet of the aquarium to facilitate the extraction of up to 70% of the water volume whenever the fuzzy logic classifies the turbidity level as high (turbid). The drained water is transported through a dedicated outlet pipe directly into an external bucket, ensuring isolated disposal of contaminated water. The second is the fill pump, which is connected to the 5,200 L water tank, enabling controlled delivery of clean water back into the aquarium through an inlet pipe. This refilling process automatically terminates when the water level sensor detects the target height of approximately 16 cm. In addition, the system incorporates a solenoid valve or output valve at the water tank outlet to regulate the flow of clean water during the refill cycle. For feeding automation, the configuration includes an Automatic Fish Feeder driven by a servo motor, which dispenses a regulated amount of feed at exactly 08:00 AM and 05:00 PM as dictated by the RTC module. The RTC maintains an accurate time base independent of network connectivity, ensuring that feeding remains consistent under all operating conditions.
The hardware configuration further integrates the control and monitoring functionality through the IoT cloud platform, which receives data transmitted by the NodeMCU regarding turbidity levels, water replacement cycles, water height readings, pump activation status, and feeding events. The corresponding values are displayed on a smartphone monitor, enabling the user to track the system's performance in real time without interfering with autonomous operations. As shown in Figure 2, all physical components, including the pumps, pipes, valves, sensors, bucket, water tank, and controller, are interconnected in a closed loop, forming a comprehensive hardware ecosystem that supports the full sequential operation required by the proposed system.
2.3 Fuzzy Water Quality Decision Block
The Fuzzy Water Quality Decision Block is responsible for converting raw turbidity measurements into a control signal that determines whether the system should perform water replacement and how aggressively the drain and refill sequence should be executed [19, 20]. Instead of relying on a single fixed threshold, the proposed fuzzy controller models the gradual transition between clear, moderate, and turbid conditions so that the response of the system is smooth and robust against sensor noise [21]. The fuzzy block receives the turbidity value from the sensor inside the 48 × 12 × 21 cm aquarium and produces a scalar output that represents the recommended water replacement level. This output is then mapped to the actuation logic that enables the 70% drain phase and the subsequent 70% refill phase controlled by the water level sensor [22, 23].
Let $T$ denote the turbidity reading expressed in nephelometric turbidity units (NTU). To make the design independent of the absolute sensor range, $T$ is first normalized into the interval [0, 1] using Eq. (1).
$T_n=\frac{T-T_{\min }}{T_{\max }-T_{\min }}$ (1)
where, $T_{\min}$ and $T_{\max}$ are the minimum and maximum turbidity values expected in the aquarium during operation. The normalized variable $T_n$ is then fuzzified into three linguistic terms: Clear, Moderate, and Turbid. Triangular and trapezoidal membership functions are used because they are simple and computationally efficient for an embedded platform such as the NodeMCU [24]. For example, the membership functions can be calculated using Eqs. (2)–(4).
$\mu_{\text {Clear}}\left(T_n\right)=\left\{\begin{array}{cc}1, & 0 \leq T_n \leq a \\ \frac{b-T_n}{b-a}, & a<T_n<b \\ 0, & T_n \geq b\end{array}\right.$ (2)
$\mu_{\text {Moderate}}\left(T_n\right)= \begin{cases}0, & T_n \leq a \text { or } T_n \geq c \\ \frac{T_n-a}{b-a}, & a<T_n \leq b \\ \frac{c-T_n}{c-b}, & b<T_n<c\end{cases}$ (3)
$\mu_{\text {Turbid}}\left(T_n\right)=\left\{\begin{array}{cc}0, & T_n \leq b \\ \frac{T_n-b}{c-b}, & b<T_n<c \\ 1, & T_n \geq c\end{array}\right.$ (4)
where, $0<a<b<c \leq 1$ are design parameters that determine the transition points between clear, moderate, and turbid water. In a typical configuration, a is chosen around 0.15, b around 0.35, and c around 0.6, so that low turbidity values are classified as clear, intermediate values as moderate, and higher values as turbid.
The design of the fuzzy model in this study intentionally adopts a minimal configuration with a single input variable (turbidity) and three linguistic rules. This design choice is based on the observation that turbidity is the most dominant indicator of water quality degradation in small-scale aquariums, as it directly reflects the accumulation of suspended particles, feed residues, and waste. In contrast to multi-parameter fuzzy systems used in large-scale aquaculture, the proposed system focuses on turbidity to reduce computational complexity and ensure stable real-time operation on a resource-constrained embedded platform such as the NodeMCU ESP8266. The use of three linguistic terms (Clear, Moderate, and Turbid) provides a sufficient level of granularity to distinguish water conditions while maintaining interpretability and low processing overhead.
The selection of membership function parameters is based on empirical observation of turbidity behavior during experimental operation. The transition points (e.g., 0.15, 0.35, and 0.6 in normalized scale) are chosen to represent clear water conditions, transitional states, and significantly degraded water quality, respectively. These values ensure that the system responds early to moderate degradation while avoiding unnecessary water replacement under stable conditions. The simplicity of the fuzzy model is a deliberate design decision aimed at achieving a balance between responsiveness, computational efficiency, and practical applicability in small-scale aquarium environments.
The output of the fuzzy block is the desired water replacement level $W$ expressed as a percentage of volume to be removed and subsequently refilled [25]. This output is defined over the range [0, 100] and modeled with three linguistic terms: NoDrain, PartialDrain, and HighDrain. Their membership functions are calculated using Eqs. (5)–(7).
$\mu_{\text {NoDrain}}(W)=\left\{\begin{array}{cc}1, & 0 \leq W \leq 10 \\ \frac{20-W}{20-10}, & 10<W<20 \\ 0, & W \geq 20\end{array}\right.$ (5)
$\mu_{\text {PartialDrain}}(W)=\left\{\begin{array}{lc}0, & W \leq 10 \text { or } W \geq 60 \\ \frac{W-10}{35-10}, & 10<W \leq 35 \\ \frac{60-W}{60-35}, & 35<W<60\end{array}\right.$ (6)
$\mu_{\text {HighDrain}}(W)=\left\{\begin{array}{cc}0, & W \leq 40 \\ \frac{W-40}{70-40}, & 40<W<70 \\ 1, & W \geq 70\end{array}\right.$ (7)
So that the HighDrain set is centered around 70%, which matches the design requirement of draining approximately 70% of the water volume when the aquarium is in a strongly turbid state.
A Mamdani-type inference mechanism is adopted, using min as the fuzzy implication operator and max as the aggregation operator. The rule base consists of three main rules that directly encode the expert strategy for water management:
Given a normalized measurement $T_n$, the firing strength of each rule is computed as the membership degree of the corresponding antecedent, that is $\alpha_1=\mu_{ {Clear}}\left(T_n\right), \alpha_2=\mu_{ {Moderate}}\left(T_n\right), \alpha_3=\mu_{{Turbid}}\left(T_n\right)$. Each firing strength is then applied to clip the output membership functions $\mu_{\text {NoDrain}}(W), \mu_{\text {PartialDrain}}(W)$, and $\mu_{\text {HighDrain}}(W)$. The aggregated output membership function $\mu_{\text {out}}(W)$ is obtained as $\mu_{\text {out}}(W)=\max \left(\min \left(\alpha_1, \mu_{\text {NoDrain}}(W)\right), \min \left(\alpha_2, \mu_{\text {PartialDrain}}(W)\right), \min \left(\alpha_3, \mu_{\text {HighDrain}}(W)\right)\right)$.
Finally, the crisp recommended water replacement level $W^*$ is computed using the centroid defuzzification method as calculated using Eq. (8).
$W^*=\frac{\int_0^{100} W \mu_{\text {out }}(W) d W}{\int_0^{100} \mu_{\text {out }}(W) d W}$ (8)
In the practical implementation on the NodeMCU, the integral is approximated by a discrete summation over a finite set of sample points. When $W^*$ falls below a small threshold, the system remains in monitoring mode, and no water replacement is performed. When $W^*$ is close to 70%, the controller enables the drain pump until the water level sensor confirms that approximately 70% of the volume has been removed and then triggers the fill pump to restore the desired water column. The same fuzzy output is also used as an inhibition signal for feeding control, so that feeding is disabled whenever the turbidity level requires a nonzero water replacement action.
2.4 NodeMCU-based control mechanism
The embedded control logic of the proposed aquarium automation system is implemented through the NodeMCU ESP8266, which serves as the central processing and coordination unit for all sensing and actuation tasks. As shown in Figure 3, each hardware component is electrically interfaced to the NodeMCU through designated analog, digital, and Pulse Width Modulation (PWM) channels, forming a unified microcontroller-based control architecture. The turbidity sensor is connected to the NodeMCU’s Analog-to-Digital Converter (ADC) pin, allowing continuous sampling of water clarity values that are later interpreted by the fuzzy decision block. The dual water level sensor is interfaced through separate digital input lines to detect the two critical thresholds used during water replacement: the lower 30% water remaining cutoff for terminating the drain phase and the upper 16 cm cutoff for halting the fill phase. These level transitions are monitored in real time to ensure precise control of the 70% drain and 70% refill sequence.
On the actuation side, the NodeMCU controls two pump units through transistor- or relay-based driver circuits. As shown in Figure 3, the drain pump and fill pump each receive command signals from the NodeMCU General-Purpose Input/Output (GPIO) pins, enabling the controller to selectively remove or replenish water based on the fuzzy output and current sensor states. The automatic fish feeder is driven through a PWM connection that regulates the servo motor responsible for dispensing pellets at exactly 08:00 AM and 05:00 PM. To maintain accurate scheduling, the system incorporates an external RTC module connected via the Inter-Integrated Circuit (I2C) interface (Serial Clock Line - Serial Data Line (SCL-SDA) lines), ensuring that feeding events remain stable even during network interruptions or power fluctuations. The NodeMCU additionally manages bidirectional communication with the IoT cloud through its built-in Wi-Fi interface, transmitting turbidity readings, pump activation logs, water level events, and feeding cycles to the user’s smartphone dashboard. Through this configuration, the NodeMCU integrates all sensor inputs, executes fuzzy inference, synchronizes feeding, controls pump operations, and maintains remote monitoring, thereby forming the computational backbone that enables fully autonomous aquarium management.
The system operation can be described as a state-based process consisting of four main states: Monitoring, Draining, Refilling, and Feeding. In the Monitoring state, the system continuously reads turbidity and water-level data while waiting for either a turbidity-triggered event or a scheduled feeding time. When the turbidity exceeds the fuzzy-defined threshold, the system transitions to the Draining state, where the drain pump is activated until the lower water-level threshold is reached. After draining is completed, the system transitions to the Refilling state, where the fill pump is activated until the upper water-level threshold is achieved. Once the water level is restored, the system returns to the Monitoring state. The Feeding state is triggered by the RTC schedule but is conditionally executed only when the system is not in the Draining or Refilling states. This state-based representation ensures that feeding and water-replacement operations are mutually coordinated to maintain system stability.
Figure 3. NodeMCU-based hardware control configuration
This section presents the performance evaluation of the proposed IoT-based automatic fish feeding and water-management system under real operational conditions. All sensing, decision, and actuation processes were monitored in real time to verify the system’s ability to maintain water quality, execute partial water replacement, and regulate feeding behavior in a fully autonomous manner. The results include turbidity dynamics, drain-refill transitions, water-level responses, pump activation patterns, and scheduled feeding events, all of which were captured through the integrated IoT dashboard. These observations provide a comprehensive assessment of how effectively the fuzzy-driven control logic responds to environmental changes inside the aquarium. The following subsections describe the experimental environment, the collected data, and the performance outcomes that demonstrate the reliability and stability of the proposed system.
3.1 Experimental setup
The experimental evaluation was conducted using the fully assembled prototype described in Section 2, which operated in an aquarium measuring 48 × 12 × 21 cm. All sensing and control components, including the turbidity sensor, dual water-level sensor, pumps, RTC module, and servo-based feeder, were integrated with a NodeMCU ESP8266 as the central controller. The system was tested under controlled indoor conditions, with turbidity, water level, pump activity, and feeding events continuously recorded via the IoT platform. Multiple test cycles were performed under varying water-quality conditions to ensure repeatability. Performance was evaluated based on response time, accuracy of drain-refill thresholds, and consistency of scheduled feeding (08:00 AM and 05:00 PM). Additional parameters such as turbidity level, water height, pump flow rate, refill time, and fuzzy output were recorded to assess system behavior. A summary of the experimental variables is provided in Table 1.
Table 1. Experimental parameters and measurements
|
Parameter |
Symbol/Unit |
Description |
|
Aquarium dimensions |
- |
Physical size 48 × 12 × 21 cm, used in all experiments |
|
Initial water volume |
Vtank (L) |
Total water volume before drain-refill cycle |
|
Turbidity measurement |
T (NTU) |
Raw turbidity value from sensor before normalization |
|
Normalized turbidity |
Tn (0–1) |
Input to fuzzy logic after min-max normalization |
|
Fuzzy output |
W* (%) |
Output of fuzzy inference indicating proportional water replacement |
|
Drain volume target |
Vdrain (%) |
Target 70% removal based on fuzzy decision |
|
Water level threshold |
- |
Sensor cutoff at approx. 30% of aquarium height |
|
Refill height threshold |
hrefill (cm) |
Upper cutoff at 16 cm during refill |
|
Pump flow rate |
(L/min) |
Effective output of drain and fill pumps during operation |
|
Drain duration |
tdrain (s) |
Time required to reach 30% threshold |
|
Refill duration |
trefill (s) |
Time required to reach 16 cm height |
|
Feeding schedule |
- |
RTC-based feeding at 08:00 AM and 05:00 PM |
|
Feeding inhibition flag |
Φ |
Binary flag (0 disabled, 1 enabled) |
|
Power supply |
- |
5 V DC for sensors, 12 V for pumps |
The experimental evaluation in this study is designed to validate the functional behavior of the proposed system under controlled conditions, focusing on the responsiveness of the fuzzy decision mechanism, the accuracy of water replacement, and the synchronization of feeding operations. The duration of each experimental cycle is intentionally limited to capture complete operational sequences, including turbidity increase, decision triggering, drain-refill execution, and system stabilization. This approach allows clear observation of system dynamics within a controlled timeframe.
3.2 Turbidity and water replacement performance
The performance of the proposed system was first evaluated by observing how the turbidity responded to the fuzzy-based control actions during a complete drain-refill cycle. Figure 4 shows the normalized turbidity profile $T_n$ as a function of time during one representative experiment.
Figure 4. Turbidity response during drain-refill cycle
At the beginning of the cycle, turbidity gradually increased from a relatively clear condition due to accumulated feed residues and suspended waste. Once $T_n$ entered the fuzzy “turbid” region, the controller triggered the water replacement routine, which is reflected by a decrease in turbidity after the decision point. During the drain phase, the removal of 70% of the water volume caused a noticeable drop in $T_n$, and this decrease continued throughout the refill phase as clean water from the 5,200 L tank diluted the remaining 30% of the original water. After the refill cutoff was reached, the turbidity curve stabilized around a lower steady-state value, indicating that the partial water replacement mechanism was effective in restoring water clarity without requiring a full water change. The corresponding water level dynamics are depicted in Figure 5, showing the vertical water height inside the aquarium over the same experimental period. The level remained stable at approximately 16 cm during the initial stage, then decreased linearly when the drain pump was activated, reaching about 6 cm (≈30% of the total volume). At this point, the system switched to the refill phase, increasing the water level back to the 16 cm cutoff. The stable plateau regions before and after the drain-refill cycle indicate consistent threshold control. Combined with the turbidity response, these results confirm that the system can perform a controlled 70% water exchange while maintaining a stable and safe environment for the fish.
Figure 5. Water level dynamics during partial water replacement
To provide a quantitative perspective, the effectiveness of the water-replacement process can be observed through the relative reduction in normalized turbidity before and after the drain-refill cycle. In the representative experiment, turbidity decreased from a high (turbid) state to a stable lower level after the 70% water exchange, indicating a significant improvement in water clarity. In addition, the system consistently achieved the target water-level thresholds, with the drain phase terminating at approximately 30% remaining volume and the refill phase stabilizing at 16 cm. The repeatability of these thresholds across multiple cycles demonstrates the reliability of the control mechanism. Although the evaluation is primarily process-oriented, these results indicate that the proposed system can effectively restore water quality while maintaining stable operating conditions.
3.3 Feeding event verification
The feeding mechanism was evaluated to verify whether the system dispenses feed at scheduled times while enforcing safety constraints during water-replacement operations. The subsystem relies on two triggers: (1) the RTC-based time signal and (2) the environmental safety flag Φ, which indicates system readiness. The flag is set to Φ = 1 only when both pumps are inactive and water conditions are stable, ensuring that feeding is suppressed during turbidity recovery and drain-refill phases. To assess performance, the controller logs both feeding schedules and system states throughout the experimental period.
Figure 6 shows the temporal alignment between the feeding schedule and the system’s operational status. The upper trace indicates the two predefined feeding windows at 08:00 AM and 05:00 PM, represented as binary time markers. The lower trace indicates the status of the system-wide safety flag Φ, where Φ = 1 denotes that feeding is allowed and Φ = 0 indicates that feeding must be suppressed. During the first feeding interval, the system remained in a stable monitoring state with no drain-refill activity, causing the flag to remain at Φ = 1. As a result, the automatic feeder executed a single controlled dispensing rotation precisely at the scheduled time. In contrast, during the second feeding interval, the turbidity reading earlier in the day had triggered a partial water replacement procedure that extended slightly into the pre-feeding period. This caused the flag to temporarily remain at Φ = 0, preventing the feeder from operating despite the RTC signal being active. Only after the refill phase completed and the safety flag returned to Φ = 1 did the system allow feeding, resulting in a delayed but intentional and safe dispensing event later within the same hour. The temporal correlation between the feeding schedule and the system readiness state confirms that the safety mechanism performed as intended. No feed was dispensed during periods of high turbidity or during drain-refill transitions, preventing contamination spikes and avoiding unnecessary stress on the fish. Furthermore, the system maintained precise alignment with the RTC module when feeding was permitted, demonstrating temporal accuracy without drift or offset. The results highlight that the feeding algorithm is not only time-accurate but also context-aware, ensuring that feeding occurs exclusively under safe water conditions.
Figure 6. Feeding schedule vs. system safety flag during real-time operation
3.4 Internet of Things monitoring results
The IoT monitoring module was evaluated to verify continuous real-time visibility of aquarium conditions and actuator activity. All sensing and actuation data were transmitted via the NodeMCU ESP8266 to a cloud dashboard at a one-minute sampling interval, enabling detailed observation of system dynamics. Figure 7 presents synchronized turbidity and water-level data over 120 minutes. Before the drain-refill cycle, turbidity gradually increased due to particle accumulation, while the water level remained stable at 16 cm. Once turbidity exceeded the fuzzy “turbid” threshold, the system initiated the water-replacement process. This is reflected by a sharp turbidity drop after the drain pump activation at minute 60. Simultaneously, the water level decreased to approximately 6 cm (≈70% drained), followed by a linear increase during refilling until reaching 16 cm. After the refill phase, turbidity stabilized at a lower steady-state value, indicating effective restoration of water quality.
Figure 7. Real-time turbidity and water-level signals captured through Internet of Things (IoT) monitoring
As described in Table 2, the timeline shows that the drain pump was active from minute 55 to minute 72, enabling controlled extraction of 70% of the aquarium water. The fill pump subsequently operated from minute 75 to minute 95, refilling the aquarium until the upper-level threshold of 16 cm was reached. Two feeding events were detected during the monitoring period: a morning feeding event around minute 30, which occurred during stable operating conditions, and a delayed evening feeding event around minute 100, triggered only after the refill sequence had fully completed. The safety flag Φ remained inactive (Φ = 0) throughout the drain and refill phases, preventing the fish feeder from operating during periods of unstable water conditions. This confirms that the environmental safeguards integrated into the control system functioned as intended.
Table 2. Summary of actuator activity during the 120-minute Internet of Things (IoT) monitoring experiment
|
Actuator |
Start Time (Min) |
End Time (Min) |
Duration (Min) |
Operational Condition |
|
Drain Pump |
55 |
72 |
17 |
Turbidity exceeded fuzzy “turbid” threshold |
|
Fill Pump |
75 |
95 |
20 |
Triggered after 30% water remaining detected |
|
Feeder Event 1 |
30 |
32 |
2 |
Morning feeding window (08:00) |
|
Feeder Event 2 |
100 |
102 |
2 |
Evening feeding window |
|
Safety Flag $\Phi$ |
55-95 (inactive) |
- |
40 min inactive |
Feeding disabled during water replacement |
Overall, the IoT monitoring results confirm that the system is capable of capturing high-resolution environmental data, visualizing water-quality transitions, and verifying the correct execution of actuator commands. The cloud-based interface provides transparency in system behavior and enables rapid detection of abnormal patterns such as unexpected turbidity spikes, prolonged pump activity, or delayed refilling. Such real-time observability is essential for maintaining long-term aquarium stability and supports the broader goal of autonomous fish-keeping systems where user intervention is minimized.
3.5 Comparative analysis with related works
To further evaluate the contribution of the proposed system, a structured comparison with representative related works is conducted based on key functional and architectural aspects.
As shown in Table 3, most existing systems address individual aspects such as monitoring, feeding, or environmental control, but lack integrated coordination between these components. Systems in reference [15, 16] rely on threshold-based or monitoring-only approaches, while Indrawati et al. [17] applied fuzzy logic but focus on large-scale aquaculture without physical water replacement. Similarly, Chiu et al. [18] introduced adaptive feeding but do not integrate local water management. In contrast, the proposed system integrates fuzzy-based decision-making, proportional water replacement, and context-aware feeding within a closed-loop framework specifically designed for small-scale aquariums. This integration enables coordinated system behavior that addresses both water quality and feeding safety simultaneously.
Table 3. Comparison of related works and proposed system
|
Feature |
Reference [15] |
Reference [16] |
Reference [17] |
Reference [18] |
Proposed System |
|
IoT Monitoring |
✔ |
✔ |
✔ |
✔ |
✔ |
|
Automatic Feeding |
✔ |
✔ |
✔ |
✔ |
✔ |
|
Water Replacement |
✔ (Full/Threshold) |
✘ |
✘ |
✘ |
✔ (Partial 70%) |
|
Fuzzy Logic |
✘ |
✘ |
✔ |
✘ |
✔ |
|
Multi-Parameter Input |
✘ |
✔ |
✔ |
✔ |
✘ (Turbidity-focused) |
|
Partial Water Exchange |
✘ |
✘ |
✘ |
✘ |
✔ |
|
Feeding–Water Integration |
✘ |
✘ |
Partial |
✘ |
✔ |
|
Target System |
Aquarium |
Aquarium |
Pond |
Pond |
Small Aquarium |
The results obtained in this study demonstrate several substantive improvements over existing automatic aquarium systems, particularly those presented in references [15-18]. A key differentiating factor is the ability of the proposed system to execute proportional and biologically aware water replacement, which contrasts sharply with earlier IoT-based aquarium designs. Whereas prior systems such as Ratnasari et al. [15] relied on fixed-threshold triggers followed by full or near-full water changes, the results in Figure 7 show that the fuzzy-based decision block in this study could classify turbidity conditions more gradually and initiate a controlled 70% water-exchange cycle. Experimental data confirmed that this approach successfully restored water clarity while maintaining 30% of the original water, preserving microbial stability and reducing environmental shock-capabilities not addressed in previous research.
Compared with the monitoring-driven architectures in reference [16], which emphasized real-time sensing but offered no active water-management response, the experimental results here validate the advantage of integrating sensing with closed-loop corrective action. The drain-refill events recorded in Table 2 illustrate that the system not only detected turbidity rises but also applied an autonomous remediation sequence until the water returned to acceptable quality. Furthermore, the feeding timeline demonstrates that the system’s safety flag Φ reliably prevented feeding during water-replacement intervals, a safeguard absent in time-only feeding systems such as Muhamad et al. [16]. This coordinated interaction between the fuzzy turbidity model, dual-level sensor thresholds, and feeding inhibition module constitutes a functional synergy that earlier IoT aquarium systems lacked.
The comparison with fuzzy-based aquaculture control systems such as Indrawati et al. [17] further highlights the contribution of this work. Although prior studies successfully used fuzzy inference to handle nonlinearities in water-quality dynamics, their focus was largely on large-volume ponds where water conditioning can be achieved through aerators and temperature regulators without physically renewing the water. The experimental outcomes here demonstrate that for small, volume-sensitive aquariums, physical water replacement is necessary and cannot be substituted with conditioning alone. By combining fuzzy turbidity evaluation with percentage-based water renewal, the proposed system bridges the methodological gap between monitoring-driven IoT designs and environment-conditioning fuzzy controllers, resulting in a hybrid strategy specifically tailored for confined aquarium ecosystems.
Finally, the adaptive feeding approaches explored in reference [18] highlight the importance of intelligent feed control, yet they operate under the assumption that water-quality management is handled by external infrastructure. The proposed system extends the notion of adaptive feeding by embedding it directly within the local water-management loop. The experimental feeding verification (Figure 6) showed that feeding was automatically delayed during turbidity spikes and resumed only after water restoration was complete, ensuring that feed was never dispensed into deteriorated water, preventing contamination spikes, and reducing fish stress. This tight integration of feeding logic with real-time water-quality assessment represents a key advancement beyond the behavior-driven feeding models in reference [18].
Overall, the comparative analysis shows that the contribution of this work lies not in introducing isolated components, but in integrating them into a cohesive autonomous framework. The results confirm that the system effectively combines fuzzy reasoning, partial water replacement, and context-aware feeding within a continuous operational loop. This integration addresses key limitations of previous studies and provides a more stable, efficient, and user-independent solution for small-scale aquarium management. It is important to note that the IoT component in this work is not intended as a primary research contribution, but rather as an enabling infrastructure that supports system integration and real-time observability. The main contribution of this study lies in the coordination between fuzzy-based decision-making, proportional water management, and feeding control within a closed-loop system. The IoT layer complements this design by providing transparency and remote monitoring capability.
However, several limitations should be noted in this study. First, the evaluation does not include a direct quantitative comparison with baseline methods such as fixed-threshold control or manual water replacement, as the primary objective is to demonstrate system feasibility and integration. Second, the experimental duration is limited to short-term operational cycles and does not assess long-term system performance under continuous usage. Factors such as sensor drift, biofouling, long-term turbidity trends, and component durability were not evaluated. Future work will focus on conducting controlled comparative experiments and extended deployment scenarios to evaluate system performance in terms of efficiency, reliability, and long-term stability.
In terms of applicability, the proposed system is specifically designed for small-scale aquarium environments with relatively constrained water volumes. The configuration, including the 70% water-replacement ratio, turbidity thresholds, and water-level limits, is calibrated based on the characteristics of the experimental tank. While the overall system architecture and control logic can be adapted to different aquarium sizes or species, parameter tuning would be required to account for variations in water volume, fish density, feeding behavior, and environmental conditions. Therefore, the current implementation should be interpreted as a validated reference design rather than a universally applicable configuration.
This study proposed an integrated IoT-based automatic fish-feeding and water-management system designed for the unique constraints of small aquarium environments. The method combines turbidity sensing, dual-level water detection, and a Fuzzy Water-Quality Decision Block to initiate a controlled 70% partial water replacement, preserving 30% of the original water to maintain microbial stability. Feeding is synchronized with environmental conditions through a context-aware inhibition mechanism, where RTC-scheduled feeding is temporarily suspended during drain-refill phases or when turbidity is classified as “turbid.” Experimental results showed that the fuzzy-driven decision model effectively restored water clarity without inducing ecological shock, the dual-threshold water control maintained stable aquarium levels, and the feeding module responded reliably to system readiness. IoT telemetry further validated system transparency, allowing continuous monitoring of turbidity, water height, actuator activity, and feeding events in real time. The main contributions of this work include the introduction of a fuzzy turbidity-based reasoning model tailored for compact aquariums, a proportional 70–30 water-exchange strategy, a coordinated feeding inhibition mechanism linked to water quality, and full IoT-enabled observability of system behavior. For future research, the framework may be extended with additional water-quality indicators, adaptive neuro-fuzzy tuning, multi-aquarium scalability, and long-term ecological testing.
This research was funded by Universitas Dian Nuswantoro, Semarang, Indonesia (Grant No. 241/F.9/UDN-09/X/2025).
[1] Prapti, D.R., Mohamed Shariff, A.R., Che Man, H., Ramli, N.M., Perumal, T., Shariff, M. (2022). Internet of Things (IoT)-based aquaculture: An overview of IoT application on water quality monitoring. Reviews in Aquaculture, 14(2): 979-992. https://doi.org/10.1111/raq.12637
[2] Öz, M., Üstüner, E., Çifci, S., Budak, F., İleri, E., Dikel, S. (2025). Artificial intelligence for fish disease diagnosis and management: Innovations, challenges, and One Health implications. Aquaculture International, 33(7): 652. https://doi.org/10.1007/s10499-025-02352-7
[3] Hasimuna, O.J., Mphande, J., Lengwe, M., et al. (2025). An assessment of government-funded small-scale cage fish farming in Siavonga District, Zambia: Performance, challenges and opportunities. Frontiers in Sustainable Food Systems, 9: 1629414. https://doi.org/10.3389/fsufs.2025.1629414
[4] Zhang, K.S., Ye, Z.Y., Qi, M., et al. (2025). Water quality impact on fish behavior: A review from an aquaculture perspective. Reviews in Aquaculture, 17: e12985. https://doi.org/10.1111/raq.12985
[5] Vanderzwalmen, M., Sánchez Lacalle, D., Tamilselvan, P., et al. (2022). The effect of substrate on water quality in ornamental fish tanks. Animals, 12(19): 2679. https://doi.org/10.3390/ani12192679
[6] Nagothu, S.K., Bindu Sri, P., Anitha, G., Vincent, S., Kumar, O.P. (2025). Advancing aquaculture: Fuzzy logic-based water quality monitoring and maintenance system for precision aquaculture. Aquaculture International, 33(1): 32. https://doi.org/10.1007/s10499-024-01701-2
[7] Munguti, J., Muthoka, M., Chepkirui, M., et al. (2024). The fish feed sector in Kenya, Uganda, Tanzania, and Rwanda: Current status, challenges, and strategies for improvement—A comprehensive review. Aquaculture Nutrition, 2024(1): 8484451. https://doi.org/10.1155/2024/8484451
[8] Cui, M., Liu, X.B., Liu, H.H., Du, Z.Z., Chen, T., Lian, G.P. (2025). Multimodal fish feeding intensity assessment in aquaculture. IEEE Transactions on Automation Science and Engineering, 22: 9485-9497. https://doi.org/10.1109/TASE.2024.3507098
[9] Emerenciano, M.G.C., Rombenso, A.N., Vieira, F.N., et al. (2022). Intensification of penaeid shrimp culture: An applied review of advances in production systems, nutrition and breeding. Animals, 12(3): 236. https://doi.org/10.3390/ani12030236
[10] Zou, S.B., Ju, H.Y., Zhang, J.J. (2025). Water quality management in the age of AI: Applications, challenges, and prospects. Water, 17(11): 1641. https://doi.org/10.3390/w17111641
[11] Zainurin, S.N., Wan Ismail, W.Z., Mahamud, S.N.I., et al. (2022). Advancements in monitoring water quality based on various sensing methods: A systematic review. International Journal of Environmental Research and Public Health, 19(21): 14080. https://doi.org/10.3390/ijerph192114080
[12] Shen, Y., Arablouei, R., de Hoog, F., Xing, H., Malan, J., Sharp, J. (2023). In-situ fish heart-rate estimation and feeding event detection using an implantable biologger. IEEE Transactions on Mobile Computing, 22(2): 968-982. https://doi.org/10.1109/TMC.2021.3086496
[13] Alqahtani, A., Bhatia, M., Behal, V. (2025). AquaTwinCare: A digital twin-inspired framework for aquatic animal healthcare. IEEE Internet of Things Journal, 12(24): 54041-54049. https://doi.org/10.1109/JIOT.2025.3619545
[14] Cui, M., Liu, X.B., Liu, H.H., Zhao, J.Z., Li, D.L., Wang, W.W. (2025). Fish tracking, counting, and behaviour analysis in digital aquaculture: A comprehensive survey. Reviews in Aquaculture, 17: e13001. https://doi.org/10.1111/raq.13001
[15] Ratnasari, D., Rodhiyah, Pramudwiatmoko, A. (2020). IoT prototype development of automatic fish feeder and water replacement. International Journal of Engineering Technology and Natural Sciences, 2(2): 51-55. https://doi.org/10.46923/ijets.v2i2.71
[16] Muhamad, F.N., Yulianto, D.T., Fathurohman, M.A.A. (2023). Aquarium monitoring and automatic feeding system based on Internet of Things. International Journal of Research and Applied Technology, 3(1): 123-130. https://doi.org/10.34010/injuratech.v3i1.10012
[17] Indrawati, E.M., Suprianto, B., Kartini, U.T. (2025). Development of fuzzy logic automatic fish feeding system and IOT-based water quality control. Journal of Engineering Research and Reports, 27(3): 56-69. https://doi.org/10.9734/jerr/2025/v27i31417
[18] Chiu, C.C., Liao, T.L., Chen, C.H., Kao, S.E. (2022). AIoT precision feeding management system. Electronics, 11(20): 3358. https://doi.org/10.3390/electronics11203358
[19] Balemans, D., Reiter, P., Steckel, J., Hellinckx, P. (2022). Resource efficient AI: Exploring neural network pruning for task specialization. Internet of Things, 20: 100599. https://doi.org/10.1016/j.iot.2022.100599
[20] Islam, M.M., Kashem, M.A., Alyami, S.A., Moni, M.A. (2023). Monitoring water quality metrics of ponds with IoT sensors and machine learning to predict fish species survival. Microprocessors and Microsystems, 102: 104930. https://doi.org/10.1016/j.micpro.2023.104930
[21] Zhao, S.L., Zhang, S., Liu, J.C., et al. (2021). Application of machine learning in intelligent fish aquaculture: A review. Aquaculture, 540: 736724. https://doi.org/10.1016/j.aquaculture.2021.736724
[22] Rawlins, B., Trevathan, J., Sattar, A. (2022). Embedded fog models for remote aquatic environmental monitoring. Internet of Things, 20: 100621. https://doi.org/10.1016/j.iot.2022.100621
[23] Chandramenon, P., Aggoun, A., Tchuenbou-Magaia, F. (2024). Smart approaches to Aquaponics 4.0 with focus on water quality − Comprehensive review. Computers and Electronics in Agriculture, 225: 109256. https://doi.org/10.1016/j.compag.2024.109256
[24] Gabriel, P.F., Wang, Z.H. (2022). Design and implementation of home automation system using Arduino Uno and NodeMCU ESP8266 IoT platform. In 2022 International Conference on Advanced Mechatronic Systems (ICAMechS), Toyama, Japan, pp. 161-166. https://doi.org/10.1109/ICAMechS57222.2022.10003361
[25] Karunkuzhali, D., Meenakshi, B., Lingam, K. (2022). An adaptive fuzzy C means with seagull optimization algorithm for analysis of WSNs in agricultural field with IoT. Wireless Personal Communications, 126(2): 1459-1480. https://doi.org/10.1007/s11277-022-09801-z