Fuzzy rules based smart irrigation system using adaptive bacterial foraging optimization

The practice of agriculture is heavily reliant on the implementation of irrigation systems. Technology improvements have made it unnecessary to rely on someone else to perform irrigation when we are out and whenever crops need to be watered. Many researchers have attempted to autonomously irrigate crops, but difficulties with accuracy, timing, and cost are rarely addressed and given top priority. The proposed approach employs a real-time sensor, wireless sensor network, the adaptive bacterial foraging optimization (ABFO) algorithm, and a fuzzy irrigation system control to achieve autonomous watering, thereby enabling smart irrigation. This method reduces waste while preserving the container’s water supply. Automated irrigation determines whether crops need to be watered by considering the type of crop, the weather, and the soil moisture and not soil moisture alone. The need for water is calculated using the three aforementioned criteria and fuzzy control drives the automation. Using an arduino-based IoT circuitry, the bioinspired model with algorithm adaptive bacterial foraging optimization, generates the optimized values for three parameters, which are then used by fuzzy logic control to predict the watering requirements of the plants. In terms of accuracy, timeliness, and cost, the suggested approach is advantageous. With this model, it is now possible to completely automate the irrigation system.


Introduction
Renewable energy represents a promising prospect for achieving a sustainable future [1].In today's world, where environmental preservation and energy stability are crucial, renewable energy sources like solar, wind, hydro, and geothermal offer a game-changing solution [2].In contrast to finite fossil fuels, renewable energy utilizes the Earth's inherent processes, offering a pristine and limitless power supply [3].By using these abundant resources, we can reduce the impact of climate change [4], boost economic growth [5], and attain energy independence [6].A transition towards more sustainable energy sources is imperative [7].Renewable energy presents a promising opportunity, offering the potential for a future characterized by enhanced environmental cleanliness, increased sustainability, and a greater emphasis on green practices [8].Transitioning to sustainable practices is crucial for combating climate change [9], reduction pollution [10], and securing a livable future [11].
One of the most effective tools for ensuring social stability and economic prosperity is the growth of the agriculture sector [12].Regarding the crucial economic, social, and territorial challenges highlighted by this industry, India has prioritized development in this area [13,14].The most important source for development is watering to agricultural field [15].The excess or under watering are harmful to crops or agricultural fields, hence proper irrigation systems are required [16].Due to the scarcity of water, which has become a major global concern, an effective and appropriate irrigation water supply significantly increases agricultural production [17].Rainfall and irrigation are the two main water sources for agriculture [18].The precipitation quantity, nevertheless, is inadequate to fulfill the plant's water demands [19].Excessive moisture levels can impede the capacity of plants to assimilate nutrients and elevate the likelihood of disease proliferation [20].Diverse irrigation control techniques that can be utilized and classified into two distinct categories, namely open loop and closed-loop control [21,22].Figure 1  In an open-loop control system, the farmer must manually decide when to irrigate [23].The operator determines irrigation duration, water amount, and pace depending on his understanding of the crop's perceived reaction [24].This method is extensively utilized since it is straightforward to use and doesn't need the usage of sensors [25].However, it can result in some regions receiving excessive irrigation while others receive insufficient irrigation, which might lead to unfavorable water stress [26].Additionally, there are significant water and energy losses, which conflict with the global aim of rationalizing and conserving water resources [27,28].Due to the lack of power in communities, farmers who wish to irrigate crops on farms that are stocked with produce must get up in the middle of the night [29].Additionally, they were unable to touch farmhouses during COVID-19 and water plants, which caused extensive damage to the agricultural sector and a shortage of food [30].
Therefore, intelligent IoT-based automated irrigation systems should have taken the place of the manual irrigation process [31].We are utilizing the data science and IoT relationship for producing smart irrigation with no need for labor-intensive intervention because, as was already noted, present scenarios have their limits [32,33].As a result, the creation of smart irrigation system (closed-loop control) offers an effective substitute for conventional irrigation techniques [34,35].The intelligent irrigation system monitors various parameters that influence irrigation efficacy and dispenses the appropriate amount of water necessary for optimal plant growth and development [36,37].The control action is contingent upon the result, thereby enabling the preservation of the intended output state while assessing the input conditions to ascertain the most favorable course of action [38,39].The data collected by sensors is often used as the basis for the judgments, which are then compared to the intended set points [40].These systems' primary job is to precisely calculate the agricultural irrigation requirements.The authors conducted a comprehensive investigation of multiple pre-existing smart irrigation systems and derived the subsequent conclusions for each individual system.Benzaouia Mohammed et al., [41] in order to create an effective and long-lasting irrigation plan that intends to conserve water in the eastern part of Morocco, a fuzzy logic-based irrigation strategy and closed-loop feedback control were proposed in this work.The duration of irrigation for a specific plant species is established through the utilization of Mamdani's Fuzzification, Trapezoidal, and Triangular Membership functions [42].
The implementation of fuzzy control in irrigation systems ensures the mitigation of the potential hazard of under-irrigation by regulating soil moisture levels to remain above the predetermined threshold set by the user [43].The findings gained demonstrate the system's effectiveness and dependability in both the summer and autumn [44].The work does not explain about automation of the system, also accuracy of the system can be enhanced with optimization approach for sensory value analysis.The system's timeliness is not stated by the researchers and comparison with existing systems is missing to prove the effectiveness of the system.Maona Li et al., [45] make irrigation scheduling easier, a fuzzy inference-based irrigation decision support system that incorporates a lucerne growth model, a soil water model, and pertinent software was created.The irrigation decision support system employed the fuzzy inference algorithm to compute the most favorable irrigation timing and amount, taking into account the soil water content and the difference in lucerne height, in real-world conditions [46].The irrigation decision assistance system's effectiveness has been evaluated.The findings demonstrated that, with NRMSE of 8.28% and 6.29%, respectively, the predictive models performed well in forecasting the development stage of lucerne and soil water.The autonomous irrigation system was proposed by Dr. Geetha S. [47].The system was developed with the aim of providing continuous monitoring of soil moisture levels.The aforementioned components consist of a moisture sensor and a motor or pump.The programming of Arduino boards is carried out through the utilization of the Arduino Integrated Development Environment (IDE) software [48].The circuit's total current draw ranges from 200 to 220 mA.The authors, V. Vinoth Kumar et al., [49] presented a novel irrigation system that makes use of the Internet of Things (IoT).Within this particular system, information is gathered from the user's end pertaining to the condition of soil moisture.This data is then transmitted to the user in real-time through the employment of Wi-Fi technology and an IoT servers.
The authors present a demonstration of the successful application of a PID (PI) controller on a group of 32 strawberry plants grown in coir for a duration of 94 days, as well as on a single potted poinsettia plant [50].The implementation involved a simple modification to the integral function.The efficacy of the limited integral PI controller has been exhibited in its ability to effectively regulate soil moisture levels in the potted poinsettia plant, while simultaneously accommodating the diurnal cycle.This was achieved through a 2-hour watering interval, which ensured that soil moisture levels remained within a narrow range of 1.5%.Souza et al. [51] proposed an irrigation management strategy that utilizes a fuzzy inference system.This approach aims to restrict the amount of water used for irrigation by incorporating data from capacitive soil moisture sensors to determine the soil moisture level, as well as information on precipitation forecasts obtained from a PWS.The indirect automation of the soil moisture measuring process (using a capacitive sensor) enables the farmer to make an irrigation choice more quickly, increasing agricultural productivity and crop output.Still, full automation is required, also timeliness, accuracy and cost of the system is still the unsolved and non-targeted issues in the irrigation system.G. Ravi Kumar [52] presented a modern design approach for the management and surveillance of soil moisture.This approach encompasses functionalities to efficiently construct measurement or control systems within a significantly reduced timeframe.The system's drawback is that it uses a small number of parameters and completely automates the watering system.Additionally, quality attributes attained over the research work are not specifically mentioned in the results.Tian et al. [53] proposed the utilization of wireless monitoring and feedback fuzzy control in the development of an irrigation system that aims to enhance water conservation and irrigation management in hyperarid regions such as Qatar.This is now much assisting with data analysis and system enhancement.The system is simple to use.An early cost-benefit study demonstrated that the system is financially viable.The system is still should predict and automate the irrigation system with more accuracy and also time value of prediction and managing irrigation is also unsolved issue.
Smart irrigation systems using optimization and fuzzy logic controllers have advanced, but adaptive bacterial foraging optimization (ABFO) with fuzzy logic has not been studied.The majority of studies concentrate on conventional optimization and machine learning techniques.Empirical studies of ABFO's adaptability to dynamic agricultural environments and its integration with fuzzy logic of realworld farm contexts still need to be completed.No comparative studies have evaluated the strengths and weaknesses of the ABFO-based system against other optimization techniques.
The objective of this research endeavor is to address the limitations inherent in the existing smart irrigation system, as well as alleviate the challenges associated with manual irrigation methods.The proposed smart irrigation system is comprised of two distinct components.The initial component of the system's configuration involves the utilization of hardware to incorporate a multitude of sensors, which are responsible for gathering precise data pertaining to crop fields.The variables encompassed in this context are weather conditions, soil moisture, and crop type, all of which exhibit a significant correlation with crop water requirements.This information collected from sensors will be process by adaptive bacterial foraging optimization technique to generate optimized input values for increasing accuracy.In the second section, the collected optimized attribute values are utilized to make predictions about the agricultural field's potential water needs using fuzzy logic control system [54].Consequently, this research project combines fuzzy logic and bioinspired optimization with IoT.Based on the soil moisture and weather sensors' recorded circumstances, the fuzzy controller calculates the crop's necessary irrigation time.The fuzzy controller then receives this data and uses well-designed fuzzy rules to manage irrigation.Here, emphasis is placed primarily on the system's cost, timeliness, and correctness.

Materials and Methods
In present study, two key components are of significance.The first part entails an examination of the hardware configuration of the system, while the second part centers on the application of optimization techniques and fuzzy logic control to predict water requirements for crops.The Arduino platform, which encompasses both software and hardware components, is highly regarded among manufacturers and designers for its extensive range of user-friendly features and robust support network [55,56].Figure 2 depicts the schematic representation of the hardware diagram pertaining to the Arduino board.The subsequent points outline the principal characteristics.Arduino boards possess the capability to receive input data from a variety of sensors, encompassing both analogue and digital signals.This data is then converted into an output, which can entail the activation of various components such as motors, LEDs, or establishing a connection to the cloud.These functionalities enable Arduino boards to perform a diverse range of tasks.

Arduino hardware for desgining IoT System
The board can be programmed to function according to specific instructions by uploading software to the central processing unit (CPU) of the board through the Arduino Integrated Development Environment (IDE).In contrast to conventional programmable circuit boards, the Arduino board does not require an external hardware component.The only necessary component is a USB cable.In addition, the Arduino Integrated Development Environment (IDE) utilizes a simplified version of the C++ programming language to streamline the acquisition of programming skills.The microfunctionality controllers are divided into a more accessible container by Arduino's standard form factor, which is the last but not least.

Adapive bacterial foraging optimization
Hanning Chen et al. [57] have described the ABFO0 and ABFO1 versions of adaptive bacterial foraging optimation.ABFO is an enhancement in BFO to increase its accuracy as well as time execution speed for solving the optimization problems.Here, ABFO is helping to optimize the values obtained from the sensors to increase the accuracy of the irrigation system.Figure 3 and Figure 4 shows the both versions of ABFO.Let's first understand the simple Bacterial foraging optimization.Passino presented the BFOA in [58], continuing the swarm-based algorithm trend.The main concept of the new method is to apply the group foraging strategy of a swarm of E. coli bacteria in multi-optimal function optimization.Bacteria look for nutrients in a way that maximizes the amount of energy they can get in a given amount of time.Each bacterium sends signals to other bacterium to communicate.A bacterium makes foraging decisions after taking into account the two earlier criteria.Chemotaxis is the mechanism by which a bacterium moves by making tiny movements while looking for nutrition, and the main notion of BFOA is to imitate the chemotactic movement of hypothetical bacteria in the issue search space.
In this part, we examine two ABFO variations, dynamic adaptation as shown in Figure 3 and selfadaptation as shown in Figure 4 for irrigation system, which are targeted towards various forms of adaptation.It is noteworthy that the ABFO versions are based on the producer-scrounger foraging theory and the area focused Search theory, respectively.Through the dynamic manipulation of parameters, such as the run length unit of bacteria denoted as Ci, which considers the present state of the search, specifically the quality of the solutions, it is imperative that the bacteria maintain a suitable equilibrium between exploring and profiting during the foraging process within the area of search.The ABFO algorithms can effectively handle complicated, highly multimodal search environments because to this adaptation process.

Fuzzy Logic Control:
Fuzzy logic control (FLC) is presently the subject of extensive research in the realm of applying fuzzy reasoning, fuzzy set theory, and fuzzy logic.FLC finds its application in diverse domains such as biomedical instrumentation, security, and industrial process control.In contrast to conventional control techniques, Fuzzy Logic Control (FLC) has demonstrated superior efficacy in addressing intricate, ambiguous problems that a proficient human operator can handle without explicit knowledge of the underlying dynamics.
A control system, consisting of physical components, is employed to manipulate a separate physical system in order to achieve specific desired properties.Control systems can be broadly classified into two categories: open-loop control systems and closed-loop control systems.The input control action in open-loop control systems is independent of the physical system output.On the other hand, the input control action in a closed-loop control system is contingent upon the output of the physical system.Systems that incorporate closed loop feedback are commonly known as feedback control systems.The initial stage in effectively managing a physical variable involves the process of measuring it.A plant can be described as a controlled physical system, wherein a sensor is employed to monitor the regulated signal.The forcing signals of a closed-loop control system's inputs are determined by the system's output responses.The primary control concern can be summarized as follows: The error signal is utilized to modify the output of the regulated physical system.The error signal is computed based on the disparity between the projected response and the observed response of the participant.

Figure 5. FLC working
A supplementary component, commonly referred to as a compensator or controller, can be incorporated into the feedback loop to attain desirable responses and characteristics for the closed-loop control system.Figure 5 displays the closed-loop control system's fundamental block diagram.IE-THEN rules are essentially what the fuzzy control rules are.Now let's workout with the architecture of the irrigation system using all the above concepts.

Methodology
A methodology leverages hardware-based system architecture to collect data pertaining to crop type, weather conditions, and soil moisture levels.The hardware of the Arduino circuit consists of the essential sensors that are responsible for detecting and gathering data related to specific properties.The primary objective of employing Internet of Things (IoT) and bioinspired optimization techniques in conjunction with fuzzy logic control was to develop an affordable smart irrigation system that facilitates farmers' comprehension of optimal water requirements for cultivating nutrient-rich and disease-resistant crops.Data pertaining to the agricultural sector is acquired through the utilization of sensors, subsequently transmitted to the Agricultural Bureau of Field Observations (ABFO).The ABFO will continue with subsequent iterations till the input obtained from the sensors is fully optimized for applying it to the fuzzy logic controller.

Results and discussion
Fuzzy logic control is employed for the purpose of operating the automated system and prediction model, which is responsible for making forecasts regarding water requirements.The optimized sensor data will be used as input to the FLC where fuzzification will be carried out, at the same time the fuzzy inference rules are applied as input to the FLC.When FLC compares the optimized sensor input and applies the inference rules the generated data is applied to the defuzzification phase and finally the need of water requirement is generated by the FLC unit.In the event that the crop field is experiencing water deficiency, the activation of the water pump switch is initiated, thereby facilitating the provision of water to the agricultural field.The water pump switch is designed to automatically deactivate when the FLC model determines that there is an adequate water supply in the agricultural field or when the desired water level has been attained, thereby mitigating water wastage.Figure 6 shows the detailed flow of the working architecture.The architecture shows how bioinspired algorithm like ABFO and FLC can help us to design the efficient and low-cost irrigation system.The necessary data encompasses the input data pertaining to the characteristics of the soil, environmental factors, and the specific crop variety present in the agricultural field.The model illustrates that Internet of Things (IoT) hardware sensors will be utilized as input circuitry for the Automated Border Flood (ABFO) and Fuzzy Logic Control (FLC) based irrigation system.The sensors are sensing the soil moisture information, the weather conditions information and the ABFO will be applied on this information parameters for optimizing these values to enhance the accuracy of the proposed system.The same data is passed to FLC for determining water needs.

Conclusion
The application of IoT based circuits and the bioinspired optimization algorithm ABFO, in conjunction with fuzzy logic control, is the primary focus of this investigation.The ultimate goal of this research is to develop fully automated smart irrigation systems.The purpose of this project is to improve the effectiveness of watering farms and fields of agricultural crops.The text thoroughly explains the methodology applied, emphasizing how objective it was and how closely it adhered to the ABFO and FLC methodologies for calculating water requirements.Because the system requires nothing more than an Arduino board, it is possible to consider it a cost-effective and easily accessible solution that is open to people who own agricultural establishments.Because farmers are not required to physically access the agricultural fields or engage with any other aspect of the system, the burden of operational responsibilities that farmers are responsible for is reduced.Automation that was incorporated into the model will, once the model is instantiated into the real world, carry out the necessary ON and OFF scenarios for a water pump.Future potential comprises adding variables to the system for more comprehensive data analysis.Hardware circuit modifications can boost computational speed, improving system efficiency.These improvements would lead to a more robust data analysis tool.

Figure 6 .
Figure 6.The architectural design of a smart irrigation system