Development of Smart Hydroponics System using AI-based Sensing

: This paper proposes a smart hydroponic system that operates automatically us-ing a fuzzy logic algorithm integrating IoT functionalities to support smart agriculture. The system allows for remote monitoring and control via the Internet, providing real-time data on water levels, pH levels, temperature, and nutrient solution temperature. Precise dosing and temperature control are critical for optimal plant growth, and the system schedules temperature measurements to ensure stability. Unstable temperature can affect pH levels, thereby impacting nutrient absorption. The proposed system employs sensors to continuously monitor the electrical conductivity (EC) and pH levels of the nutrient solution. Fuzzy control is utilized to regulate the nutrient solution pump, automatically adjusting EC and pH levels to promote optimal plant growth. This approach reduces the time burden on producers and provides more precise control over the nutrient solution, resulting in improved growth outcomes. The main contributions of this work are the development and implementation of an AI-based system integrating a controller IoT environment, fuzzy logic algorithm, and nutrient film technology (NFT) hydroponics; a user-friendly interface, a hybrid monitoring and control; the establishment of an IoT-based cloud environment for sensor data monitoring; and the implementation of a smart hydroponic system for nutrient sensing, monitoring, and control. The results showed a significant improvement in plant growth outcomes with precise control over the nutrient solution. Additionally, a comparative analysis between smart and conventional hydroponics based on morphological results demonstrated the superiority of the smart system.


Introduction
Smart agriculture, alternatively termed precision agriculture, encompasses the application of sophisticated technological innovations aimed at enhancing the efficiency and productivity of agricultural practices.This approach signifies a paradigm shift in the agricultural sector, integrating information technology and various forms of advanced machinery to optimize both the quality and quantity of agricultural outputs.Industry 4.0, also known as the fourth industrial revolution, is characterized by the integration of advanced technologies such as artificial intelligence [1,2], the Internet of Things (IoT) [3], robotics, and big data analytics in various industries [4,5].In the context of agriculture, Industry 4.0 has enabled the development and implementation of smart agriculture practices.Related research of smart agriculture in Industry 4.0 is increased efficiency; smart agriculture practices allow farmers to monitor and manage their crops more efficiently [6], leading to increased yields and reduced waste [7].By using smart sensors and data analytics, farmers can optimize the use of water [7], fertilizer [8], and pesticides [9], reducing their environmental impact [10].Enhanced profitability can help farmers reduce costs [11], increase yields, and improve the quality of their produce, leading to greater profitability.With the help of advanced data analytics and machine learning algorithms, farmers can make more informed decisions about crop management, leading to better outcomes.Smart agriculture practices can help to increase food production and improve the quality and safety of the food supply [12].
In recent years, the development and innovation in hydroponics systems have seen significant advancements, primarily driven by the integration of modern technologies such as IoT, AI, and machine learning.For instance, the design and development of an automated hydroponics system utilizing IoT for data logging and real-time monitoring have enhanced user interaction and control through a web interface [13].Additionally, the revolutionizing of Holy Basil cultivation with AI-enabled hydroponics systems demonstrates how AI and machine learning can optimize growth conditions by processing data from various sensors via cloud services [14].Furthermore, the implementation of an AI-enabled plant emotion expresser in hydroponics highlights the potential of intelligent agents in interpreting plant health to adjust growing conditions, employing techniques like Nutrient Film Technique (NFT), Deep Flow Technique (DFT), and Dynamic Root Floating Technique (DRFT) [15].Complementing these innovations, the AI-driven pheno-parenting model leverages deep learning for real-time plant trait analysis, offering a framework to monitor plant life cycles and provide insights for optimal growth [16].These diverse methodologies underscore the transformative impact of integrating advanced technologies in hydroponics, aiming to enhance efficiency, productivity, and sustainability in modern agriculture.
We propose a smart hydroponic system that operates automatically using a fuzzy logic algorithm, incorporating the Internet of Things (IoT) concept and functionality to support smart agriculture.By using IoT, the system can be remotely monitored and controlled from anywhere via the internet, enabling users to view real-time data such as water levels [17,18], pH levels [19,20], temperature [21,22], and nutrient-rich water-based solution temperature [23].Hydroponics requires precise dosing for optimal growth [12,24].Water temperature is a crucial parameter for hydroponic plants, as temperatures that are too high or too low can hinder nutrient absorption and lead to poor plant development [25].Therefore, temperature measurements are scheduled.Unstable temperature can also cause unstable pH levels [5], which in turn affects nutrient absorption by the plants.The water's pH level plays a vital role in determining the quality of nutrients present in the water [26].
This system allows for decision-making and command-sending based on the real-time parameters displayed.The sensors in the system allow for continuous monitoring of the EC (electrical conductivity) and pH levels of the nutrient solution.Fuzzy control is used to regulate the operation of the nutrient solution pump, automatically adjusting the EC and pH levels to promote optimal plant growth [27].This eliminates the need for producers to spend extended periods measuring and calculating nutrient solution quantities, reducing their time burden.Additionally, the system provides more precise and accurate control over the nutrient solution, resulting in improved growth outcomes.To address these issues, the main contributions of this work are as follows: i.The creation and execution of an AI-based system through the integration of a controller IoT environment, fuzzy logic algorithm, and NFT (nutrient film technology) hydroponics.ii.The development of a user-friendly interface for farmers using the smart-hydroponic application, which enables hybrid monitoring and control of hydroponic farms.iii.The establishment of an IoT-based cloud environment to monitor sensor data.iv.The implementation of a smart hydroponic system for nutrient sensing, monitoring, and control.v.A comparison between smart hydroponics and conventional hydroponics based on their morphology result.
The research demonstrated that the smart hydroponic system significantly improved plant growth outcomes compared to conventional methods.The average temperature was maintained at approximately 30.82°C, ensuring optimal conditions for hydroponic growth.The system effectively managed pH levels, keeping them stable between 6 and 7, which is crucial for nutrient absorption.The TDS (Total Dissolved Solids) values were controlled around 800, preventing nutrient overload.Comparative analysis showed that the smart hydroponic system outperformed traditional systems in maintaining consistent nutrient levels and environmental conditions, leading to healthier and more robust plant growth.The automated nature of the system reduced labor and time required for maintenance, providing a more efficient and reliable alternative to traditional methods.
The remainder of the article is structured as follows: Section 2 provides an overview of the literature review and identifies the problems related to hydroponics.Section 3 discusses the implementation of the proposed smart hydroponic system in detail.Section 4 examines the system's experimental results in detail.Finally, Section 5 presents the study's conclusion and outlines areas for future research.

Literature Review
Hydroponic farming has gained significant traction as an alternative to traditional soilbased agriculture due to its potential for higher yields, reduced water usage, and the ability to grow crops in non-arable regions.Various hydroponic systems, such as nutrient film technique (NFT), deep water culture (DWC), and aeroponics, have been developed to cater to different crops and growing conditions.These systems typically rely on manual monitoring and adjustment of nutrient solutions, which can be labor-intensive and prone to human error.A study by Casamayor(2024) reviewed a prototype of a human-powered hydroponic system and evaluated its environmental and economic impacts [28].For instance, https://ejournal.ittelkom-pwt.ac.id/index.php/infotelNFT systems were praised for their efficient use of water and nutrients but criticized for their susceptibility to pump failures and root drying [29].Similarly, DWC systems were noted for their simplicity and stability but faced challenges related to the oxygenation of the nutrient solution.Despite these advancements, the need for automated and intelligent systems to manage hydroponic farms still needs to be addressed.
The advent of the Internet of Things (IoT) and artificial intelligence (AI) has revolutionized various industries [30,31], including agriculture.IoT refers to a network of interconnected devices that collect and exchange data, enabling real-time monitoring and control.In agriculture, IoT devices such as sensors, actuators, and drones are used to monitor soil moisture, temperature, humidity, and other environmental parameters.AI, on the other hand, involves the use of machine learning algorithms and data analytics to make predictive decisions and optimize processes.In the context of agriculture, AI can analyze vast amounts of data from IoT devices to predict crop yields, detect diseases, and optimize resource usage.According to a review by [10], the integration of IoT and AI in agriculture has shown promising results in enhancing productivity, reducing costs, and minimizing environmental impact.Another study by Mamatha et al. (2023) employed machine learning algorithms to optimize the nutrient formulation for various hydroponically grown crops [32].They collected data on plant growth, nutrient uptake, and environmental conditions to train their models.The AI-driven system provided customized nutrient solutions tailored to the specific needs of each crop, resulting in better growth rates and resource efficiency.
Furthermore, the scalability of AI-based systems presents a critical challenge [33].Many existing solutions are tailored to small-scale setups and may need to perform better in larger commercial operations.There is also a need for more comprehensive studies that consider the economic viability and environmental impact of implementing AI and IoT technologies in hydroponics [6].Lastly, user-friendly interfaces and decision support systems are essential to ensure that farmers can effectively utilize these advanced technologies [34].Addressing these research gaps will be crucial for the development of robust, scalable, and efficient smart hydroponic management systems that can significantly enhance the productivity and sustainability of modern agriculture.

Methodology
The smart hydroponics management system's architecture was designed to seamlessly integrate various components, including IoT sensors, AI algorithms, and control mechanisms.The system comprised the main elements shown in Tables 1 and 2.
The fuzzy inference system (FIS) plays a vital role in the smart hydroponics management system by applying fuzzy logic principles to manage uncertainty and imprecision in the environment.The process begins with fuzzification, where precise input values such as pH, TDS (Total Dissolved Solids), and temperature are transformed into fuzzy sets using membership functions.These functions define how each input is categorized into linguistic terms like "Low," "Optimal," and "High."The core of the FIS is its rule base, which comprises a set of IF-THEN rules derived from expert knowledge or empirical data.For instance, a rule might state: IF pH is Low AND TDS is High THEN the Nutrient Solution is Acidic.These rules allow the system to make decisions based on the combined fuzzy inputs.The fuzzy inference engine utilizes these fuzzy rules to process the fuzzified inputs, producing Web-based dashboard for real-time visualization of sensor data, fuzzy logic decisions, and system status.Users could monitor and control the system remotely, receive alerts, and access historical data for analysis.
fuzzy outputs using logical operations like AND, OR, and NOT.Subsequently, the aggregation process consolidates the fuzzy outputs from all relevant rules into a unified fuzzy set.This combined set represents the overall system's response to the prevailing conditions.Finally, the defuzzification process converts this aggregated fuzzy set back into a precise, actionable output, typically using methods like the centroid or weighted average.This process involves converting the imprecise decisions into specific modifications, such as adjusting the nutrient solution composition.The use of a Fuzzy Inference System (FIS) in hydroponics offers several benefits, including its capacity to handle the inherent variability in sensor readings and environmental elements.By incorporating expert knowledge via its rule base, the FIS provides a versatile and intuitive framework for system control.This adaptability allows for easy adjustments to enhance system performance, making the FIS an invaluable tool for maintaining optimal growing conditions in a hydroponic setting.The fuzzy membership function can be found in Table 2.
The core of the system's intelligence lay in the fuzzy logic controllers, which were developed to manage the nutrient pumps based on real-time readings of EC and temperature.Fuzzy logic algorithms were chosen for their ability to handle the inherent uncertainty and variability in environmental conditions.These controllers were integrated with https://ejournal.ittelkom-pwt.ac.id/index.php/infotelFigure 1: The proposed architecture and fuzzy membership for a hydroponic system.

Fuzzy Membership for Temperature (°C) Fuzzy Membership for pH Level Fuzzy Membership For Total Dissolved Solids (TDS)
the system through MQTT broker-client access, allowing for real-time data analysis and decision-making.The fuzzy logic controllers continuously analyzed the sensor data and made precise adjustments to the nutrient levels, ensuring that the hydroponic environment remained within optimal ranges.Automated dosing pumps were employed as part of the control mechanism, which adjusted the nutrient levels based on the recommendations from the fuzzy logic controllers.This closed-loop system is operated by continuously monitoring sensor data and making necessary adjustments to maintain optimal conditions for plant growth.The system architecture also featured a web-based dashboard that provided real-time visualization of sensor data, fuzzy logic decisions, and the overall system status.This user interface enabled remote monitoring and control, allowing users to receive alerts, access historical data, and make informed decisions regarding the hydroponic system.

Experimental results
The temperature values in the dataset range from 27°C to 35°C, with an average temperature of approximately 30.82°C.This indicates consistent environmental control within the specified range, ensuring optimal conditions for hydroponic growth.The set pH range for all entries is uniformly between 6 and 7, maintaining a stable and suitable pH environment for the plants, as shown in For "Pump A and Pump B ON" actions, the time ranged from 15.68 to 29.54 seconds, reflecting normal operation under optimal TDS levels.The "Pump A and Pump B OFF" actions had a time consistently set to 0, indicating immediate response to high TDS values and effective nutrient management.These times reflect the system's normal operation under optimal TDS levels.In contrast, for the "Pump A and Pump B OFF" actions, the time is consistently set to 0, indicating the system's immediate response to high TDS values and its ability to safeguard against nutrient overload effectively.Examining the relationhttps://ejournal.ittelkom-pwt.ac.id/index.php/infotelship between temperature and action time for "Pump Nutrient A and Pump Nutrient B ON" reveals no significant correlation.The system maintains a consistent operational time regardless of slight temperature variations, demonstrating its robustness and reliability.The clear threshold observed at TDS values around 800, where the system switches off the pumps, underscores the efficiency of the fuzzy logic control mechanism in managing nutrient levels.The fuzzy logic system's rules, such as maintaining nutrient adjustment when EC is low and temperature is cold or increasing nutrient adjustment when EC is low and temperature is optimal or hot, are effectively reflected in the data.The system's response to high TDS values by switching off the pumps aligns with the fuzzy logic rule that dictates decreasing or maintaining nutrient adjustment under such conditions.The TDS meter values spanned from 611.61 to 843.16.The system effectively controlled nutrient levels, with pumps switching off when TDS values exceeded 800 to prevent over-nutrification.

Analysis of Nutrient Level Maintenance
The fuzzy logic control system effectively managed nutrient levels by adjusting pump actions based on real-time TDS readings.The consistent pH and temperature ranges provided an optimal growing environment, contributing to stable plant growth.The system's response to high TDS values by switching off the pumps prevented nutrient overload, ensuring the health and productivity of the plants.Analysis of plant growth data showed that the controlled nutrient levels and environmental conditions led to robust and uniform plant development, demonstrating the efficacy of the AI-based approach.The TDS values for the smart system remain relatively stable, around 800 throughout the observation period (from 10:00 to 5:00).In contrast, the TDS values for the traditional system show a sharp decline from 800 at 10:00 to below 200 by 5:00.The stability of TDS values in the smart system indicates effective nutrient level maintenance, ensuring that the plants consistently receive the optimal concentration of nutrients.The declining TDS values in the traditional system suggest poor nutrient management, likely leading to nutrient depletion and potential deficiencies for the plants, as shown in Table 4. Traditional hydroponic systems rely heavily on manual monitoring and adjustments, which can lead to inconsistent nutrient levels and suboptimal growing conditions.In contrast, the AI-based system provided continuous, real-time monitoring and automatic adjustments, maintain-ing nutrient levels within optimal ranges.This resulted in more consistent plant growth and reduced the risk of human error.The automated nature of the AI-based system also significantly reduced the labor and time required for system maintenance, offering a more efficient and reliable alternative to traditional methods.The comparative analysis of plant metrics between traditional and smart hydroponic systems demonstrates the clear benefits of adopting smart technologies.The smart system consistently outperforms the traditional system across all metrics, highlighting the advantages of precise environmental control and nutrient management.This results in healthier, more robust plants with greater biomass, emphasizing the potential of smart hydroponic systems to enhance agricultural productivity and sustainability.

Conclusions
The study quantitatively demonstrates that using artificial intelligence (AI) in hydroponics outperforms traditional methods.AI-based hydroponics resulted in an average plant height of 28 cm, compared to 27.5 cm in traditional methods.The average stem diameter was 1.77 cm for AI-based systems, slightly higher than the 1.75 cm observed in traditional systems.Plants grown with AI had an average leaf width of 16 cm and leaf length of 20.32 cm, compared to 14.45 cm and 19.55 cm in traditional methods.AI systems achieved an average root length of 26.1 cm, significantly longer than the 22.3 cm in traditional methods.AI-grown plants had a green index of 40, whereas traditional methods achieved 35.AI systems produced an average of 26 leaves per plant, compared to 18 in traditional methods.The average wet weight of plants in AI-based hydroponics was 216 g, significantly higher than the 161.2 g in traditional systems.
The AI system continuously monitors and adjusts water, nutrient, and environmental conditions, leading to resource savings.The system's real-time adjustments minimized wastage, enhancing overall resource efficiency.AI automation reduced the need for manual intervention, allowing for more scalable and sustainable hydroponic farming operations.This automation freed farmers from extensive monitoring and adjustment tasks, enabling them to focus on other important farm activities.Consistent and optimal nutrient management led to healthier plants with higher yields, showcasing the potential of AI in modern agriculture.Despite its advantages, the implementation of the AI-based system faced several challenges.Effective nutrient management relies on accurate sensor readings, and any discrepancies can lead to suboptimal adjustments, requiring regular calhttps://ejournal.ittelkom-pwt.ac.id/index.php/infotelibration and maintenance.The fuzzy logic models need fine-tuning to accurately predict and adjust nutrient levels based on fluctuating environmental conditions.Integrating IoT sensors, control mechanisms, and data processing units requires careful coordination and robust software development.These quantitative findings highlight the significant advantages of AI-based hydroponics in terms of growth metrics, resource efficiency, automation, and overall plant health despite some challenges in implementation.In conclusion, the AI-based hydroponics management system demonstrated significant advantages in maintaining optimal nutrient levels, improving plant growth, and enhancing resource efficiency.While challenges related to sensor accuracy and algorithm performance were encountered, the potential for further improvements and the promising results observed suggest that AI-based approaches could play a crucial role in the future of sustainable agriculture.

Figure 2 :
Figure 2: Comparison of temperature, humidity, and nutrient levels in smart vs. traditional hydroponic systems.

Table 1 :
System architecture and integration EC), temperature, humidity, and nutrient concentrations.It's important to position these sensors in the nutrient solution reservoir where the water and nutrients are combined.This ensures that the readings accurately represent the nutrient solution being distributed to the plants.It is essential to position a temperature sensor in the grow bed or near the plant root zone to accurately monitor the micro-environment where the roots are located.This is crucial for preventing potential root stress caused by temperature fluctuations.Data Collection and TransmissionReal-time sensor data collection is transmitted wirelessly to an MQTT broker via a secure Wi-Fi network.Stored in a cloudbased database for scalability and accessibility.

Table 2 .
16e TDS meter values span from 611.61 to 843.16.The first 15 rows exhibit TDS values between 611.61 and 796.29, while the last 5 rows have values exceeding 800, prompting the system to switch off the pumps to prevent potential over-nutrification.The average TDS value for the first 15 rows is approximately 695.43, whereas for the last 5 rows, it is around 821.92.This clear threshold around TDS values of 800 highlights the system's effectiveness in managing nutrient concentrations, as shown in

Table 3 .Table 3 :
The results of TDS control

Table 4 :
Comparison of plant metrics