1 Introduction

Agriculture is widely considered as the backbone of human civilization as it serves as the primary source of crops and essential resources. It plays a pivotal role in the growth and development of a country's economy and provides diverse employment opportunities to people [1]. The progress of the agricultural sector is crucial for enhancing the economic landscape of a nation. However, the use of outdated farming techniques by some farmers leads to a decrease in crop and fruit yields. On the other hand, the implementation of technology and machinery has resulted in increased productivity by replacing human labour in various areas of agriculture [2]. The application of modern science and technology is imperative for augmenting production in the agricultural sector. New approaches and technological advancements are continually being put forth and put into practice in order to suit the demands of modern humanity [3]. Due of this, IoT has emerged. IoT is a system of all things that are integrated into gadgets, detectors, computers, applications, and individuals through the Internet context to converse, exchange data, and connect in order to offer a viable approach between both the physical and digital world. IoT has been used in a variety of fields recently, including precision farming, driverless cars, home automation, smart buildings, smart energy, campus administration, medical, and transportation [4].

The rising number of people shows how important agricultural activities are to growing and producing enough food for everyone on the planet. The efficiency of the agricultural production sector is a major factor in the economics of most nations [5]. A nation's prosperity is strengthened by enhanced quality in the agricultural sector. Yet, compared to persons employed in a variety of other industries, such as computing, building, teaching, and more, producers have relatively fewer earnings on the agricultural commodities and goods they produce [6]. Farmers are thus lacking enthusiasm for engaging in agriculture because it takes more labour to develop commodities or food stuffs in the agricultural industry than it does in several other fields, and because the work rewards for producers are considerably lower than ideal. In reality, if producers are not ready for unforeseen circumstances, the economic burden connected with farming or cultivation is also larger because of the immediate effect of unanticipated catastrophic events on farming [7].

The development of technology like IoT has changed the environment of farming and improved operational skills in the industry [8]. Sustainable farming and precision agriculture refer to the use such as IoT technologies in agriculture and farming. According to predictions, the industry for agricultural robots would increase at an annualized pace of 20.31% from 2021 to 2028, reaching USD 15.93 billion. Given the increasing incorporation of technological equipment into farming and the growth of the farm economics market, the agriculture industry is evolving into a convenient scapegoat for attackers to execute attacks [9]. For example, a cyberattack on JBS, a meat production business in the food supply, forced the closure of 13 meat plants. To capability approach, the corporation was forced to pay an extortion of USD 11 million. As a result, safety is viewed as a major issue in industries like agriculture, and improvements in agricultural security products are highly wanted. Smart farming IoT uses are shown in Fig. 1. Farm monitoring, precision farming, supply chain management, tracking and tracing, forest monitoring, and UAV farming are a few of the applications [10].

Fig. 1
figure 1

IoT in smart farming

High agricultural production and resource-efficient practices in farming and agriculture may increase production. Sustainable farming is one of the IoT's possible applications for significant quality management, according to current IoT developments [11]. The monitoring of soil conditions, insect management, crop production, animal herds, water level management, ambient health monitoring, and other Iot devices in sustainable farming are only a few examples. On the farming, sensing equipment is set up nearby the buildings as well as the vicinity of the agricultural field to detect the operational as well as ecological circumstances and transform the observed analogue information into an electronic format [11]. The most common instruments in sustainable farming are those that measure heat, moisture, sunlight, force, and closeness. To organization the detecting data in the cloud, such various sensors are linked to the web via edge bridges or router. The ability to communicate with the cloud offers data analysis and database format, but internet access on a connected home raises worries about privacy and security [12].

The introduction of IoT in farming has completely changed how farmers operate and track their crops. Smart applications may give real-time information on a variety of environmental factors, including temperatures, moisture, soil humidity, and crop development [13]. This information can be utilized to optimize crop output and make well-informed decisions. The enormous volume of data that these sensors produce, nevertheless, presents a considerable problem for data processing and communication [14]. Clustering is frequently used to organize the devices into clusters and choose a Cluster Head (CH) to connect with the default gateway in order to overcome this problem [15]. The efficiency of the IoT system is significantly impacted by the decision as to the right CH and the best method for data transfer. The introduction of IoT in farming has completely changed how farmers oversee and track their crops. This paper presents a novel approach to route and CH selection optimisation using Enhanced Crow Swarm Optimization (ECSO) and modified Fuzzy logic [16]. To determine which CH is best, fuzzy logic is utilized to analyse pertinent factors such energy, distance, overhead, trust, and node degree. Following then, ECSO is used to determine the best route for data transfer according to the selected CH. The suggested strategy can considerably enhance the functionality of IoT-enabled smart farming system, resulting in better crop output and more farmer profitability [17].

The massive volume of data generated by sensors in IoT-enabled smart agriculture systems poses a significant challenge in terms of data processing and transmission efficiency. Clustering has emerged as a popular solution for addressing this challenge by organizing sensors into clusters and selecting a cluster head (CH) to serve as a communication gateway. To select the optimal cluster head, fuzzy logic is employed to evaluate critical parameters, including energy levels, communication range, overhead, trustworthiness, and node degree. The selection of an appropriate CH and the optimization of data communication pathways are critical factors influencing the overall efficiency of IoT systems in agriculture. The proposed method for energy-efficient cluster head selection in IoT-enabled smart agriculture systems combines several innovative techniques to optimize resource allocation and enhance the overall efficiency of the network. The basic framework of this approach involves the integration of modified fuzzy logic, Whale optimization algorithm (WOA), and enhanced crow swarm optimization (CSO) for cluster head selection and path establishment in the IoT network. This work employs enhanced crow swarm optimization (ECSO) to enhance and identify the most efficient data transmission routes. To determine the best-suited CH, fuzzy logic is employed to evaluate key parameters such as energy levels, distances, overhead, trustworthiness, and node degrees. The research presents, the modified fuzzy logic to make intelligent decisions on cluster head selection based on various parameters such as node energy levels, location, and data load. This allows for the dynamic and adaptive selection of cluster heads, ensuring that nodes with sufficient energy and proximity to other nodes are chosen; thereby minimizing energy consumption. The Whale Optimization Algorithm is introduced to further optimize the selection process. WOA is used to fine-tune the fuzzy logic-based decisions, effectively reducing the energy consumption of the selected cluster heads by iteratively refining the selection process. The innovative aspect of the suggested approach to energy efficiency in IoT-enabled smart farm systems is its all-encompassing methodology. It optimizes both cluster head selection and data transmission pathways by combining modified fuzzy logic, WOA, and Enhanced CSO.

The key contributions of the research paper are as follows:

  • The research addresses the critical problem of energy-efficient cluster head selection in IoT-based smart agriculture. The research begins with a thorough problem analysis, highlighting the need for optimized resource allocation in the agricultural IoT context.

  • This framework proposes a novel approach that incorporates modified fuzzy logic to intelligently select cluster heads based on parameters like node energy levels, location, and data load. This innovative integration enhances cluster head selection for reduced energy consumption.

  • The research incorporates the WOA to fine-tune the fuzzy logic-based decisions, leading to further optimization of cluster head selection.

  • The research introduces an optimal path selection method using the CSO algorithm, which ensures efficient data transmission while minimizing energy consumption. The approach addresses the crucial challenge of data routing in agricultural IoT systems.

  • It conducts extensive simulation experiments to empirically validate the performance of the proposed method. Through these experiments, it demonstrates the practical applicability and effectiveness of our approach in real-world agricultural scenarios.

2 Related work

2.1 Energy efficient cluster head selection

Amandeep Kumar et al. proposed an energy-efficient cluster head selection mechanism for IoT-enabled smart agriculture applications that utilizes a stabilized routing and a hybrid particle swarm wild horse optimizer [18]. The IoT has become increasingly important in uses for automated farming in recent years. By using actuators and sensing nodes, producers can periodically get information about the moisture of the soil, water utilized, moisture, temperature, humidity, etc. Numerous grouping methods have produced energy-efficient outcomes in wireless sensor network apps. Nevertheless, long-distance transmission and scalable networks are needed for IoT-enabled smart farming uses. The currently available clustering methods are unable to offer SF clarification, while working on latency, end-to-end delay, transmission overhead, etc., has not been fully pursued. In order to reduce energy usage, latency, transmission delay, etc. in SF usages, a stable routing method and hybrid particle swarm wild horse optimizer, based on cross-layer architecture, has been developed. The network is primarily envisioned as a network of bi-concentric hexagons. To address the issues with excessive energy usage in WSN, cross-layer-based optimum CH selection method is created employing hybrid optimization algorithm known as PSWHO. The likelihood of every node with sensors is computed during clustering using cross-layer factors from various levels, including networks, medium and physical access control. Additionally, the expanded deep golden eagle neural networks, deep learning-based routing method, stands presented near investigate the best path for data transmission. In regards to energy economy, QoS effectiveness, and efficiency of computation, the technique has done better. However, the proposed optimizer has a low degree of convergence during the iterative process and is susceptible to falling into local optimal in high-dimensional spaces.

2.2 Lightweight clustering algorithm for smart agriculture

Hemant et al. created a lightweight clustering algorithm for smart farming with industry 4.0. IoT-based smart agriculture is an innovation from Industry 4.0 that is applied in both metropolitan and agricultural settings. A new branch of Industrial Revolution known "Industry 4.0" places a strong emphasis on mechanization, connectivity, artificial intelligence, and information in real time. Smart farming takes become one of core uses of Industry 4.0 due towards the increasing requirement for agricultural technology to boost farm production while fulfilling minimum criteria. The study suggests an AI-based smart agricultural strategy because AI techniques are crucial for enhancing Industry 4.0 specifications' effectiveness. Utilizing routing and clustering methods, researchers create the Lightweight Clustering Interface for Industries 4.0 Integrated Agriculture protocol. Long-distance interactions, energy economy, processing effectiveness, and guaranteed QoS efficiency are all addressed by smart farming, such as the concept of Industry 4.0. The study calculates both the indirect and direct sensing node values during the clustering stage to obtain the combined fitness function measurement. Utilizing the innovative fitness function, the best trustworthy data forwarders and Cluster Head are chosen. Employing a combined fitness function, researchers define the routing and clustering goal functions to minimize energy use and transmission overhead while maximizing network efficiency. A lightweight route-finding method relies on periodic fitness scores for both intra-cluster and inter-cluster data transmission, without requiring specialized processing. The simulation findings show that the LCIPA protocol is more efficient than the base techniques. The created method, however, is complicated and unable to repair database problems [19].

2.3 Optimized dynamic approach and effective cluster-based routing

For IoT-assisted smart Agriculture, Chavan et al. suggested an innovative Optimized dynamic approach and Effective Cluster Based Routing Protocol [20]. Precision farming has entered a new age, and it is anticipated that people will profit more from it. The use of new tools is now necessary in contemporary agriculture in order to achieve better outputs. The IoT currently contributes to novel farming practices. IoT is an adaptable network of sensing nodes that gathers information from the outside world and transmits it to a sink node for processing. An essential component of IoT network is the transmission of information from nodes containing sensors to sink nodes or base stations. To increase the automation in farmland, it is necessary to discover methods to create and use routing algorithms as well as protocols whenever this is feasible. Precision Agriculture is nothing more than automating agriculture in a manner that allows it to function automatically in circumstances where individual participation would be difficult. In an IoT network, sensing nodes have a limited lifespan. Therefore, it is necessary to adopt a strategy that uses little node energy as feasible. Energy-conscious and effective routing methods are required when sending data between servers. The energy efficiency of routing methods can be improved using a variety of clustering algorithm techniques. However, as energy dissipation increases, network life decreases and speed ultimately has a significant impact. Therefore, multi-hop correspondence must be available wherever it is necessary for improved efficiency.

Vatan and Sandip Kumar suggested a neighbourhood-aware clustering protocol is a WSN-assisted IOT system as agricultural applications. Currently, smart farming is essential if you want to increase output and safeguard your products. The agricultural instruments and internet-connected equipment can be used for this. In order to promote smart farming, the base network of wireless sensors can detect a variety of environmental factors and transmit data to devices that connected to internet. However, the sensing units have a short lifespan and receive power by smaller cells. As a result, the clustering algorithm presented in the article requires to increase the usefulness of the sensor nodes. These sensors, which are distributed in a network and are referred to as sensors for pressure, can send signals to an alert system that is connected to the internet wherever an animal enters a farm, enabling the farmer to fight off predators and safeguard his harvests. The cluster leader is chosen so that the cluster it forms contains a larger amount of highly energetic nodes. The sensing network is thought to 3 levels of energy variability among nodes. The protocol has performed better when compared to these other protocols. However, the network has a node's separation issue [21].

2.4 Energy management strategy for IoT-enabled smart agriculture

Utilizing improved intelligence techniques, Asif Irshad Khan et al. [22] suggested a novel energy management strategy for an IoT-enabled smart system for irrigation. Smart agricultural businesses are essential now more to ever because of expanding worldwide population and increasing demand for food. IoT technologies have grown into a major route to cutting-edge farming methods in the context. These IoT devices have encountered energy restrictions and challenging routing strategies due to their limited capacity. As a consequence, delays, energy usage, network lifetime decrease, and data transmitting failures occur in the context of IoT-based agriculture. The research suggests an innovative mix of improved intelligent smart systems for irrigation in order to address the issue and enhance the system's energy management capabilities. Hierarchy Shuffled Shepherd Clustering is utilized in the instance to conduct the best cluster leader development and decision-making process. The suggested Imperial Penguin Jellyfish Optimizer technique also offers the best energy control and routing route. Network Simulator-2 applications are used to simulate the task. The suggested technique's simulation results are verified and contrasted with those from traditional techniques. As a consequence, the findings of the suggested method show that the model that was created has significantly lower energy usage and better network lifespan than the conventional works. However, when the movement of nodes is enhanced, the linguistic factors do not produce enough information.

Hemant et al. [23] suggested an IoT protocol that encompasses multiple layers for intelligent production and smart farming. Researchers have paid a lot of attention to the IoT for Intelligent Production of Smart agricultural devices for automating different agricultural uses. The farm's actuators and sensors, which are utilized to provide producers with recurring information about the farm's weather, soil wetness, sun intensity, water usage, etc. The clustering-based techniques for wireless sensing networks have been shown to be energy-efficient. However, the current clustering methods cannot be practical and have greater latency and delay for different SF applications when taking into account distant communication and extensible systems of IoT-enabled SF. The CL-IoT protocol is an adaptive and efficient protocol designed for remote surveillance and decision-making of rural fields, with a focus on SF applications. In order to reduce network transmission latency, delay, and energy usage, cross-layer-based routing and clustering methods have been developed. The energy imbalance issue in WSNs can be solved by implementing the best CH selection method based cross-layers, where the network layer, medium, and physical access control settings of each sensor are analysed to determine the best CH for optimal data transfer. Additionally, a new probabilistic selection formula based on nature-inspired fitness function has been proposed to identify the best path for data transfer. By taking into account the elements of energy economy, computational effectiveness, and QoS effectiveness, the efficacy of the CL-IoT algorithm was examined utilizing NS2. The CL-IoT maximizes network throughput while minimizing energy usage, transmission overhead, and overall delay when compared to cutting-edge IoT-based agricultural techniques. However, it has difficulties managing clusters of various proportions.

2.5 Energy efficient device for smart agriculture

An enhanced energy-efficient device for IoT-enabled smart agriculture was created by Himanshu Agrawal et al. WSN energy economy is well-researched study issue. Developing the energy-efficient collection of information at the ground stations is an open-source issue, according to a recent paper on IoT-based smart agriculture. The latest advancements in energy-efficient algorithms then models towards keep energy demand at ground stations are the driving force behind the study. The base station is an energy-constrained device that must sustain the energy demands of different sensors and gateway components in order to function. In order to keep energy balance, base station employs energy harvesting. Two key research issues need to be investigated: To determine the solar energy required to maintain energy balance at the base station with solar support for energy gathering, and to calculate the energy requirements of base station at various intervals, certain calculations must be performed. The first query has received a substantial response. Researchers are attempting to answer the second query in the article, which is how to calculate the base station's energy needs for smart agriculture with IoT. Multiple sensor types are utilized in smart agriculture to constantly monitor the landscape and link to the base station, which includes soil, wetness, temperatures, direction of the wind, velocity of the wind, video, drones, etc. As a result, depending on the sort of communication over wireless networks medium being used at any given moment, the base station may require minimal power, less power, or excessive power. The article suggests a new product density approach to calculate the base station's energy needs. Additionally, the residual energy parameter is suggested for an enhanced duty cycling method. When compared to two other algorithms, the effectiveness of the suggested Improved Duty Cycling algorithm performs better in terms of average electricity usage, leftover energy efficiency, throughput, etc. However, because it is made for low speed uses, it is not appropriate for high speed transmission [24].

2.6 IoT-based WSN framework for smart agriculture

An IoT-Based WSN Framework: A Connection to Smart Agriculture was suggested by Khalid Haseeb et al. In many areas, including communication, agribusiness, surveillance, industry, and monitoring, wireless sensor networks have shown study and development interests. IoT-based WSN has utilized farmland output to monitor crop conditions and handle smart farming employing variety of sensors. These instruments are used in the agricultural setting to collect data on crops, trees, temperature monitoring, humidity, watering systems, and more in order to increase output rates through smart farming alternatives. The productivity of agriculture can be negatively impacted due to limitations in the functioning, energy, sending, and memory capacities of sensors. Moreover, IoT-based farming devices must also be safeguarded against malicious attacks, in addition to their effectiveness. To address these issues, the researchers proposed a WSN architecture for smart agriculture with multiple design levels. The agricultural sensors collect relevant data and use a multi-criteria judgement function to select a group of cluster heads for reliable and efficient data transmission. Signal-to-noise ratio is also used to assess the signal strength on transmission lines. Secondly, security is ensured for data transfer from agricultural devices to base stations by utilizing the recurrence pattern of the linear congruential generator. The simulated outcomes demonstrated that, in comparison to other methods, the suggested structure greatly improved communication effectiveness. However, the structure's effectiveness in an intelligent transportation system and mobile-based IoT network is not examined [25]. Table 1 represents the comparison of exiting approach merits and demerits in IoT network.

Table 1 Comparison of existing system merits and demerits in IoT network

3 Problem statement

Traditional cultivation has a tendency to gradually deplete the soil's nutrients, leaving it undernourished and prone to erosion. Harvesting requires a lot of effort. In order to stop pests from producing assaulting, pesticides will be utilized. The products are therefore not in good condition. Additionally, conventional cultivation requires a lot of time for decomposition. The suggested IoT-enabled smart farming is presented to address these challenges. In an attempt to increase output and safeguard the crops, smart farming becomes increasingly important today. In comparison to traditional agricultural techniques, it is significantly more efficient [18]. Smart farming involves the use of sensors and autonomous irrigation techniques to monitor temperature, moisture, and other relevant characteristics of agricultural regions. Farmers would be able to check on their produce from anywhere with this. Numerous clustering methods have produced energy-efficient outcomes in wireless sensing network applications. However, long-distance communication and scalable networks are needed for IoT-enabled smart agricultural uses. Smart agricultural solutions cannot be achieved with the currently available clustering methods, and the impact on transmission end-to-end delay, overhead, latency, etc. has not been fully explored. It is suggested to use adapted fuzzy logic and enhanced crow swarm optimization to optimize cluster head selection and path selection in IoT-enabled smart agriculture in order to get around the limitations. In order to support smart farming, it can detect a variety of environmental factors and transmit data to internet-enabled devices.

4 Proposed method for CH and path selection in IoT

The massive volume of data produced by those sensors presents a considerable difficulty in terms of data processing and transmission. Clustering is frequently utilized for solve that problem by grouping sensors into clusters and selecting a CH to interact with the gateway node. The selection of a suitable CH and the ideal channel for data communication are crucial aspects influencing IoT efficiency of the systems. They present a unique strategy to optimize CH selection and route selection utilizing modified Fuzzy Logic and whale optimization. To enhance and find easiest path using ECSO. To determine which CH is best, fuzzy logic is utilized to analyse pertinent factors such energy, distance, overhead, trust, and node degree. Figure 2 shows a diagram illustrating the flow of smart agriculture can be created.

Fig. 2
figure 2

A diagram illustrating the flow of smart agriculture can be created

4.1 Grouping sensors into clusters using k-means algorithm

Unsupervised clustering method called as K-means. Several clustering issues were resolved with ease using. The technique was used to divide a network into several clusters. Based on distance between an elected CH and other nodes in same cluster, the algorithm may primarily divide the node space into k clusters. A squared error function is the goal function that this method seeks to minimize. Equation (1) contains the objective function.

$$A = \sum\limits_{y = 1}^{k} {\sum\limits_{x = 1}^{m} {\left\| {R_{x}^{y} - {\text{ClHe}}} \right\|} }^{2}$$
(1)

Moreover, \(\left\| {R_{x}^{y} - {\text{ClHe}}} \right\|^{2}\) denotes the measure the distance between sensor \(R\) numbers \(x\) belongs to cluster \(y\) and \(ClHe\) for \(m\) sensors. Figure 3 depicts the entire process of the suggested framework.

Fig. 3
figure 3

Entire process flow diagram for proposed system

4.2 Using fuzzy logic and WOA to determine cluster head

A fuzzifier, a rule-based a fuzzy inference engine called and a defuzzifier make up the fuzzy logic control paradigm. The Mamdani Method, the most popular fuzzy inference approach, was chosen because of its ease of use [26]. There are four steps to the process:

  • Fuzzification among the input variables energy, concentration, and centrality involves assessing the degree that the clear entries from all of these variables correspond to the relevant fuzzy sets.

  • Matching the fuzzified inputs to each of the fuzzy rules' precursors is the process of evaluating the rules.

  • Clustering of regulation results is the process of combining all rule outputs.

  • The total of the output of a fuzzy probability is the input used in the defuzzification manage, and the result is a single crisp integer.

When defuzzifying, it locates the location wherein a straight line would split the total set chance into two equal masses. Using the following formula, the COG (Centre of Gravity) is computed and approximated over a sample of points on the aggregate output membership function:

$${\text{CH}} = \left( {\Sigma \mu z\left( c \right)*c} \right)/\Sigma \mu z\left( c \right)$$
(2)

where \(\mu z\left(c\right)\) is the set A membership function.

4.2.1 Whale optimization algorithm (WOA)

The WOA is an intelligent planning tool for population optimization based on animal behaviour. The white shark-pray served as the model for this algorithm. The WOA is animated and applies the design strategy throughout. The term WOA is used to describe each alternative choice. WOA lives together and works together to solve problems. At the end of the algorithm, the candidate solution with highest fitness selected as the optimal set of CHs which is represented in Eq. (3).

$${\text{fitness}} = \vec{X}\left( {h + 1} \right) = \vec{D}^{\prime} .\cos (2\pi p) + \vec{X}^{*} \left( h \right)$$
(3)

here \(h\) is the present iteration, \(\vec{X}\) position vector of most successful solution, \(\vec{D}\) can be an element-by-element multiplication or a position vector.

This part presents a mathematical model of the bubble net attack strategy, including encircling the target and prey search.

Whale optimization algorithm starts the optimization procedure required to resolve an optimization problem by randomly generating a pool of beginning solutions because it is a population-based algorithm. A matrix may be used to indicate a population of \(m\) CHs (i.e. population number) in a \(x\) dimensional search space (i.e. problem dimension), where each CH location denotes a potential solution to a problem:

$${\text{CH}}\alpha = \left[ {\begin{array}{*{20}c} {{\text{CH}}_{{1}}^{{1}} } & {{\text{CH}}_{{2}}^{{1}} } & {....} & {....} & {{\text{CH}}_{{\text{w}}}^{{1}} } \\ {{\text{CH}}_{{1}}^{{2}} } & {{\text{CH}}_{{2}}^{{2}} } & {....} & {....} & {{\text{CH}}_{{\text{w}}}^{{2}} } \\ {...} & {....} & {....} & {...} & {...} \\ {{\text{CH}}_{{1}}^{m} } & {{\text{CH}}_{{2}}^{m} } & {....} & {....} & {{\text{CH}}_{w}^{m} } \\ \end{array} } \right]$$
(4)

With \(\mathrm{COG}\alpha\) denotes the overall amount of simulated devices, \(\alpha\) is the size of cluster head in fuzzy logic, and \(w\) the placement of cluster head within the dimension, \({\mathrm{CH}}_{w}^{i}\) representing the position (capacity) of all \({i}{\mathrm{th}}\) cluster head in the \({w}{\mathrm{th}}\) search space. The domain's starting population is produced using the subsequent uniform random initialization:

Encircling prey: Once the best search agent has been determined, the remaining search agents will make an effort to move closer to the top search agent. These equations illustrate this behaviour:

$${}_{CH}^{ \to } = \left| {\vec{w}.\vec{X}*\left( h \right) - \vec{X}\left( h \right)} \right|$$
(5)
$$\vec{X}\left( {h + 1} \right) = \vec{X}\left( h \right) - \vec{y}. \overrightarrow {CH}$$
(6)

where h is the present iteration, \(\overrightarrow{X}*\) denotes position vector of best solution found thus far, \(\overrightarrow{w}\) and \(\overrightarrow{y}\) denote the coefficient vectors. If there is a better solution, the \(\overrightarrow{X}*\) must be modified based on the equations in each iteration.

The following calculation is made for the vectors \(\overrightarrow{y}\) and \(\overrightarrow{{\varvec{w}}}\):

$$\vec{\user2{y}} = 2\vec{Y}.\vec{\user2{r}} - \vec{Y}$$
(7)
$$\overrightarrow {{\varvec{w}}} = {\mathbf{2}}.\vec{\user2{r}}$$
(8)

In all the investigating and exploiting stages, \(\overrightarrow{Y}\) is reduced linearly from 2 to 0 over a number of iterations, and \(\overrightarrow{{\varvec{r}}}\) is a random vector in the range [0, 1].

Bubble-net attack technique: Two strategies are created to statistically simulate humpback whale behaviour in bubble nets:

  1. i)

    Shrinking encircling mechanism: The value of \(\overrightarrow{Y}\) an is decreased to produce this behaviour. Take note that \(\overrightarrow{{\varvec{y}}}\) an also results in a reduction in the range of fluctuations of \(\overrightarrow{Y}\). Or to put it another way, \(\overrightarrow{Y}\) is a random number in the range [Y, Y] where Y decreases from 2 to 0 during the period of iterations. The new position of a search agent may be determined somewhere within the agent's starting position and the position of the best agent right now by using random values for \(\overrightarrow{Y}\) in the range [1, 1] displays the possible places that may be reached by 0 < Y < 1 in a 2D space from (X, Y) towards (X, Y).

  2. ii)

    Spiral updating position: Then, to replicate the helix-shaped motions of humpback whales, a spiral equation is developed connecting the location of the whale and its prey in the following way.

    $$\vec{c}\left( {h + 1} \right) = \overrightarrow {CH}^{\prime} .e^{zp} .{\text{cos}}\left( {2\pi l + \vec{c}^{*} \left( h \right)} \right)$$
    (9)

Here is \({\overrightarrow{CH}}^{\prime}=|{\overrightarrow{c}}^{*}\left(h\right)-{\overrightarrow{c}}\left(h\right)|\) variable for determining the form of the spiral with logarithms, l is an arbitrary integer in the range [1, 1], and. is an element-by-element multiplica- tion, and denotes the distance of the i th whale to the prey (best answer so far).

$$\vec{c}\left( {h + 1} \right) = \left\{ {\begin{array}{*{20}l} {\vec{c}*\left( h \right) - \vec{y}.\overrightarrow {CH} \quad {\text{if}}\;l < 0.5} \\ {\overrightarrow {CH}^{\prime} .\cos (2\pi p) + \vec{c}^{*} \left( h \right)\quad {\text{if}}\;\;l < 0.5} \\ \end{array} } \right.$$
(10)

where p falls between [0, 1] at random.

Search the prey:The following equation is a description of the mathematical model used to find the prey.

$$\overrightarrow {CH} = \left| {\vec{w}.\overrightarrow {Cran} - \overrightarrow {c} } \right|$$
(11)
$$\vec{c}\left( {h + 1} \right) = \overrightarrow {{{\text{Cran}}}} - \vec{y}.\overrightarrow {{{\text{CH}}}}$$
(12)

where \(\overrightarrow{Xran}\) is denoted by the random position vector (a random cluster) from the present position, \(\overrightarrow{CH}\) denotes the cluster head of current position.

figure a

Algorithm 1: WOA algorithm

4.2.1.1 Enhanced Crow Swarm Optimization for find the path

The optimal path for data transmission based on the selected CH refers to the best path that can be used to transmit data between a source node and a destination node in a IoT network, in view of the specific characteristics of the selected CH (Channel). In a IoT network, data can be transmitted over multiple paths, and the selection of the path can have significant impact on performance of the network. Optimal path is the one that provides the highest data transmission rate, signal strength, or other relevant metrics that are important for the specific application. The selection of the CH can also have a significant impact on performance of network, different channels may have different characteristics in terms of interference, noise, and other factors. Therefore, finding the optimal path for data transmission based on the selected CH requires considering both the characteristics of the channel and the available paths. Optimization algorithms such as ECSO can used to search for the optimal path of data transmission based on the selected CH, by evaluating the fitness of candidate paths and iteratively refining the search based on the feedback from the fitness function. The optimal path identified by the algorithm is expected to provide the highest performance in terms of the specific metrics used to evaluate the fitness of the path. Algorithm 1 represents the efficient way to cluster head path selection using ECSO.

In these subgroups, the CSO method and its computational formalism are presented.

The optimum crow's position within the group determines every crow's updated location, which may be calculated using the following Eq. (13).

$$L_{q + 1} = L_{q} + G_{q + 1} *\cos (\theta )$$
(13)

If is a departing angle and \(L_{q + 1}\) is a new location, \(\theta\) is an angle, the velocity value is \(G_{q}\).

Group Division: Suppose that the crow's computational programme chooses the simplest cluster when selecting food area then also calculates overall numbers that did not receive logical food on this journey. Teams carrying risky food can consume sensible food during the upcoming food search mission. Based on the animal's attributes, such as speed, departure angle, and location, this behaviour is defined by Eq. (14):

$$E_{q + 1} = (J*E_{q} ) + (L_{{{\text{best}}}} - L_{q} )*J$$
(14)

here \(q\) denotes present iteration, \(J\) is random number belongs to (0,1), \(L_{q}\) is position vector, and \(L_{{{\text{best}}}}\) is position vector of best solution thus far.

Update angle: Worst crow angle may be adjusted in accordance with the following Eq. (15) when best crow follows behaviour.

$$\frac{{\theta_{q + 1} = (\theta_{q} + \theta_{{{\text{best}}}} )}}{2}$$
(15)

where \(\theta_{q}\) is present angle of the crow, \(\theta_{{{\text{best}}}}\) is angle of the finest crow, and \(\theta_{q + 1}\) is new angle of crow.

Reading the data from the issue database is the initial step. Next produce numerous units for each of the nine measurements, with a total of 100 units scattered at random. They used the CSO technique to resolve this issue in the second step. It begins by figuring out what each crow's speed limit and angle should equal. Depending on speed, current position, and crow angle, they update position (number of units). Before updating the position, the speed must be adjusted by taking into account the previous speed, which varies depending on location of the best crow and current

figure b

Algorithm 2: Cluster head path selection using ECSO

5 Results and discussion

The result section focuses on evaluating the proposed system's performance in the context of IoT-enabled smart agriculture. The evaluation is conducted using a combination of Enhanced Crow Swarm Optimization and improved fuzzy logic to optimize cluster head selection and route selection. Various key parameters are assessed to gauge the system's effectiveness, which includes throughput, packet delivery ratio (PDR), delay, and energy efficiency. The section also discusses the fitness function used for optimization, which is determined by factors such as energy balance, the quantity of cluster heads, total distance for intra-cluster communications, and overall distance between cluster heads and the base station. The fitness function is optimized through fuzzy logic and the Whale Optimization Algorithm. The results are then compared for different cluster scenarios to determine how the system's performance changes as the number of clusters increases. The study also highlights the significance of throughput, PDR, delay, and energy efficiency as critical performance metrics, providing equations and explanations for each. It includes a comparison of the proposed system's performance with other existing approaches, demonstrating that the proposed system achieves superior results in terms of throughput, PDR, delay, and energy efficiency when compared to EQSR, E2S-DRL, and QSEAP.

Using ECSO and improved fuzzy logic, the Cluster Head selection and route selection are optimized. To choose the best cluster head, fuzzy logic is utilized to assess important factors including energy, range, overhead, trustworthiness, and node degree. The best data transfer route is then determined using ECSO depending on the chosen cluster head. Simulations are carried out in Matlab R2016b on an Intel Core i7-1065G7 computer running at 1.30 GHz and with 8 GB of RAM. Throughput, packet delivery ratio, latency/delay, and energy efficiency are used to evaluate it.

Figures 4, 8, 12, 16, and 20 depict the randomly distributed sensor node has been grouped into cluster based various node conditions (K = 5, 10, 15, 20 & 25). Figures 5, 9, 13, 17, and 21 depict the cluster head selection of various node conditions. Figures 6,  10, 14, 18, and 22, and depict the best route selection for various node conditions. Figures 7,  11, 15, 19, and 23 depict the throughput, PDR, delay and energy efficiency analysis for various node conditions.

Fig. 4
figure 4

Analysing randomly distributed sensor node grouped into cluster (K = 5)

Fig. 5
figure 5

Analysing cluster head selection for K = 5

Fig. 6
figure 6

Analysing best route from selected cluster head for K = 5

Fig. 7
figure 7

Various performance analyses for cluster head K = 5

Fig. 8
figure 8

Analysing randomly distributed sensor node grouped into cluster (K = 10)

Fig. 9
figure 9

Analysing cluster head selection for K = 10

Fig. 10
figure 10

Analysing best route from selected cluster head for K = 10

Fig. 11
figure 11

Various performance analyses for cluster head K = 10

Fig. 12
figure 12

Analysing randomly distributed sensor node grouped into cluster (K = 15)

Fig. 13
figure 13

Analysing cluster head selection for K = 15

Fig. 14
figure 14

Analysing best route from selected cluster head for K = 15

Fig. 15
figure 15

Various performance analyses for cluster head K = 15

Fig. 16
figure 16

Analysing randomly distributed sensor node grouped into cluster (K = 20)

Fig. 17
figure 17

Analysing cluster head selection for K = 20

Fig. 18
figure 18

Analysing best route from selected cluster head for K = 20

Fig. 19
figure 19

Various performance analyses for cluster head K = 20

Fig. 20
figure 20

Analysing randomly distributed sensor node grouped into cluster (K = 25)

Fig. 21
figure 21

Analysing cluster head selection for K = 25

Fig. 22
figure 22

Analysing best route from selected cluster head for K = 25

Fig. 23
figure 23

Various performance analyses for cluster head K = 25

The number of clusters into which the nodes have been divided into K = 5 in this scenario. A popular method for clustering sensor nodes based on their proximity to one another and the similarity of the data they gather is the K-means clustering algorithm. The algorithm operates by updating the cluster centres based on the updated assignments after repeatedly allocating nodes to the closest cluster centre.

For effective data collection and transmission in a sensor network, the cluster head selection procedure is crucial. There are five clusters in the context of K-means clustering with K = 5, and each cluster requires a cluster head. There are several methods for choosing a cluster head, including picking a node at random from the cluster, choosing the node with the greatest energy, and choosing the node with the most connections to other nodes.

Each cluster in the context of K-means clustering with K = 5 has a cluster head who acts as the coordinator for the cluster's nodes. The cluster head oversees gathering data from the nodes and sending it to the base station or another cluster head at a higher level.

The performance of the network may be assessed using many metrics such as throughput, packet delivery ratio, latency, and energy efficiency in a wireless sensor network with K-means clustering and K = 5. These metrics can provide information about the network's performance and efficiency, as well as point out areas that could want improvement.

Iteration vs. Throughput: Throughput describes the volume of data that can be sent across a network in a specific length of time. We may assess the network's performance over time by charting throughput versus the number of rounds. If the throughput grows over time, the network is functioning effectively and has the capacity to handle more data. Throughput fluctuations over time may be a sign of congestion or other problems that are affecting the network's performance.

Iteration vs. Packet Delivery Ratio: The packet delivery ratio measures the proportion of packets that reach their destination without error. We may assess the network's dependability over time by charting PDR versus the number of iterations. The network is dependable and capable of transmitting data successfully if the PDR is high and consistent throughout time. The network's dependability may be affected by problems like packet loss or interference if the PDR is low or fluctuates dramatically over time.

Iteration vs. Delay: The duration of the data transmission from the source node to the destination node is referred to as the iteration. We may assess the network's speed and effectiveness over time by charting latency versus the number of iterations. The network is effective and capable of sending data fast if the delay is small and consistent across time. The performance of the network may be impacted by problems like interference or congestion if the delay is substantial or fluctuates dramatically over time.

Energy efficiency vs. Iteration: The quantity of data that may be transferred over the network per unit of energy consumption is referred to as energy efficiency. We may assess the network's energy usage and efficiency over time by displaying energy efficiency versus the number of repetitions. The network is energy-efficient and can transport data with little energy if the energy efficiency is good and consistent across time. Low energy efficiency or substantial fluctuations over time might be an indicator of network performance problems like high energy consumption or ineffective routing.

The algorithm will try to cluster the sensor nodes into 10 clusters based on their closeness to one another if K is set to 10. Each data point is iteratively allocated to the closest centroid (or cluster centre) in the K-means clustering method, which then updates the centroids based on the mean of the data points assigned to each cluster.

In a wireless sensor network with K-means clustering and K = 10, the selection of cluster heads is an important step in the clustering process. Cluster heads are responsible for managing and coordinating the nodes within their respective clusters, collecting data from the nodes, and transmitting it to the base station or higher-level cluster head.

The choice of the optimum path from a chosen cluster head to the base station or higher-level cluster head is a crucial component of network performance in a wireless sensor network with K-means clustering and K = 10. Throughput, packet delivery ratio, and latency metrics may all be impacted by the optimum route choice.

The performance of the network may be assessed using a variety of metrics in a wireless sensor network with K-means clustering and K = 10. Following are some typical performance evaluations for cluster heads with K = 10. These performance evaluations can assist network designers in tailoring the network to meet various needs, including high throughput, dependable packet delivery, minimal latency, and energy economy. They can also aid in locating performance bottlenecks and potential areas for development.

The sensor nodes in a wireless sensor network with K = 15 and K-means clustering are divided into 15 clusters according to their location and other characteristics like energy level, data type, or application. With the help of clustering, networks may operate more effectively and efficiently while using less power.

The choice of cluster heads is a crucial component of network performance in a wireless sensor network with K-means clustering and K = 15. The cluster heads are in charge of directing data to the base station or a higher-level cluster head and overseeing communication within their own clusters. Metrics like as throughput, packet delivery ratio, and energy efficiency can be impacted by the choice of cluster heads.

Analysis of the optimum path from a chosen cluster head for K = 15 is shown in Fig. 14. However, in a wireless sensor network with K-means clustering and K = 15, the optimum path from a chosen cluster head can typically be established using a variety of routing techniques.

The performance of the network may be assessed using a variety of metrics in a wireless sensor network with K-means clustering and K = 15. The following are some typical performance evaluations for cluster head K = 15.

The sensor nodes in a wireless sensor network with K = 20 and K-means clustering are divided into 20 clusters according to their location and other characteristics like energy level, data type, or application. With 20 clusters as opposed to K = 5, K = 10, or K = 15, the clustering procedure remains the same.

The cluster head selection procedure is a crucial component of network performance in a wireless sensor network with K-means clustering and K = 20. The cluster heads oversees directing data to the base station or a higher-level cluster head and overseeing communication within their own clusters.

Using routing methods like shortest path, energy-aware routing, or multi-path routing, the optimum path from a chosen cluster head may be found in a wireless sensor network using K-means clustering and K = 20. The optimum route will be determined by a few variables, including network structure, node location, and data transmission needs.

The performance of the network may be assessed using measures such as throughput vs. iteration, packet delivery ratio vs. iteration, latency vs. iteration, and energy efficiency vs. iteration in a wireless sensor network with K-means clustering and K = 20. These measurements aid in determining how effectively, efficiently, and quickly the network can transport data. The analysis may be used to tailor the network to meet certain needs, like increasing throughput or reducing energy use.

The sensor nodes in a wireless sensor network with K = 25 and K-means clustering are divided into 25 clusters according to location, energy level, data type, or application. By lowering communication overhead and energy consumption, the clustering process seeks to increase network performance and efficiency. Various techniques and criteria, including shortest path, energy-aware routing, and multi-path routing, can be used to choose cluster heads and the optimal routes from them. Metrics like as throughput, packet delivery ratio, latency, and energy efficiency can be used to gauge the network's performance.

The cluster head selection procedure in a wireless sensor network with K-means clustering and K = 25 selects a node from each cluster to serve as the central communication node. The decision may be made considering a number of variables, including the node's location, residual energy level, degree, or proximity to the base station. The cluster head oversees directing data to base station or higher-level cluster heads and overseeing communication within its cluster. By lowering communication overhead and energy use, choosing an effective cluster head can enhance network performance.

Using several routing methods such shortest path, energy-aware routing, or multi-path routing, the optimum route from a chosen cluster head may be found in a wireless sensor network using K-means clustering and K = 25. The optimum route is chosen based on a few variables, including network structure, node location, and data transfer needs. The path should enable reliable data transfer with a minimum amount of latency, minimize energy usage, and lower communication overhead. The network's unique needs and the type of data being delivered determine which routing method is used.

In the context of clustering algorithms, K refers to the number of clusters or groups that data points are partitioned into. In this case, K = 25 means that the data has been divided into 25 clusters or groups. Performance analyses for cluster head K = 25 typically involve evaluating the quality of the clustering results, as well as the efficiency and scalability of the algorithm used to generate the clusters.

5.1 Fitness function

An individual's capacity for survival is influenced by their fitness level. Depending on a fitness function, the fitness value of every person is determined. The following four parameters make up the fitness function in this study.

  • Balance of Energy (Er)

  • The quantity of Cluster Heads (NCH)

  • Total Distance for Intra-cluster Communications (TIC)

  • Distance overall between Cluster Heads and Base Station (TBSD)

The value of the last element depends on the initial one. The overall range between fewer cluster heads and the base station is also less, however the total distance for interaction inside the cluster is longer. A larger amount of cluster heads has a generally lower range for intra-cluster interaction but a greater average distance from cluster heads to base station.

The fitness function obtained when fuzzy is optimized with WOA. Equation (12) depicts fitness function,

$${\text{Fitness Function}} = w1 * Er + w2 * N_{{\text{CH }}} + w3 * T_{{{\text{IC}}}} + w4 * T_{{{\text{BSD}}}}$$
(16)

where, Fitness is the fitness value that we want to optimize. w1, w2, w3, and w4 are weighting factors that represent the importance of each parameter. These weights can be adjusted based on the specific requirements of your optimization. Er is the balance of energy. \(N_{{\text{CH }}}\) is the quantity of Cluster Heads. \(T_{{{\text{IC}}}}\) is the total distance for intra-cluster communications. \(T_{{{\text{BSD}}}}\) is the distance overall between Cluster Heads and the Base Station.

When the fitness function has been scaled, the study's fitness value is represented by Eq. (13):

$$f = {\text{Er}} + \left( {K - N_{{{\text{CH}}}} } \right) + \frac{{T_{{{\text{IC}}}} }}{K} + \frac{{T_{{{\text{BSD}}}} }}{K}$$
(17)

K indicates the total number of nodes in the network.

The fitness function demonstrates that reducing the overall distance between cluster heads and base stations is given higher priority. Table 2 depicts the fitness value of the proposed system and its performance evaluation is represented in Fig. 24.

Table 2 Fitness value of the proposed system
Fig. 24
figure 24

Fitness analysis of each cluster node

Table 1 shows that if the number of cluster nodes grew, the system's fitness value also increased.

The fitness value typically reflects how well the clustering algorithm has separated the data into distinct groups or clusters, with higher values indicating better separation. It is important to note that the optimal number of clusters can vary depending on the specific data and problem being addressed. Therefore, it is recommended to evaluate the clustering algorithm for different numbers of clusters and choose the one that provides the best results based on the fitness value and other performance metrics.

5.2 Throughput (T)

The entire quantity of packets transferred from a sender to a recipient in a predetermined period of time is known as throughput. Since the data these messages correspond to might be supplied across a logical or physical connection or it could travel by a specific network node, it often reduces as the quantity of nodes grows. The standard unit of measurement for throughput is bits per sec (bit/s or bps), while it can also refer to information packets per second or data packets per time frame. The value of successfully delivered messages via a communication connection is known as throughput. Table 3 depicts the proposed system throughput (T) value comparison for different iteration and its performance evaluation is represented in Fig. 25. It provides information about how quickly data is effectively transmitted to the base station and is provided by Eq. (18).

$$T = \left( {\frac{{P_{d} \times P_{s} }}{{P_{t} }}} \right)$$
(18)
Table 3 Compute throughput of the proposed system
Fig. 25
figure 25

Performance assessment of throughput in each iteration

The delivered packets are denoted by Pd. Pt is the time it takes to distribute the packets, and Ps is the volume of the packet.

5.3 Packet delivery ratio (PDR)

It shows the proportion between the overall amounts of packets the base station receives and the entire quantity of packets every node send. The higher the PDR number, which is often expressed as a percentage, the better it is thought to be. Table 4 depicts the proposed system packet delivery ratio comparison for different iteration and its performance assessment is represented in Fig. 26. The suggested approach has a higher percentage of packets delivered since it has a large throughput which is represented in Eq. (19).

$${\text{PDR}} = \left( {\frac{{P_{r} \times 100}}{{\sum\nolimits_{k = 1}^{m} {P_{g} } }}} \right)$$
(19)

whereas, Pg is the entire number of packets created by the source nodes, m refers to the amount of sensor nodes, and Pr is the entire number of packets obtained by the sensor nodes.

Table 4 Compute the packet delivery ratio of the proposed system
Fig. 26
figure 26

Performance assessment of PDR in each iteration

5.4 Delay (D)

The duration required for a packet of data to travel from one specified location to another is known as packet delay. It depends on the speed of the communication system, including such copper cable, optical fibre, or radio signals, as well as the transmission delay made by devices along the way, such as routers and modems. Table 5 depicts the proposed system delay/latency comparison for different iteration and its performance assessment is represented in Fig. 27. Increasing system efficiency is indicated by a little latency. Mathematically, the entire network latency that occurs during communication is represented in Eq. (20):

$$D = \left( {\frac{{\sum\nolimits_{k = 1}^{{P_{r} }} {\left( {T_{rk} - T_{rg} } \right)} }}{{P_{r} }}} \right)$$
(20)

where Trg is the timeframe when every source node generates a data packet and Trk is the timeframe at which the sensor node receives a data packet.

Table 5 Compute the delay/latency of the proposed system
Fig. 27
figure 27

Performance assessment of delay in each iteration

5.5 Energy consumption efficiency (E)

The total of the received energy multiplied by the total amount of nodes and the transmitted energy is the energy consumption (E) assessment which is calculated by using Eq. (21). Table 6 depicts the proposed system efficiency comparison for different iteration and its performance assessment is represented in Fig. 28.

$$E = \left( {E_{r} \times N} \right) + E_{t}$$
(21)

where N represents the total number of nodes, Er is the receiving energy, and Et is the transmitting energy.

Table 6 Compute the energy efficiency of the proposed system
Fig. 28
figure 28

Performance assessment of energy efficiency in each iteration

5.6 Comparison of proposed system with other existing approaches

To evaluate the efficacy of the suggested system in terms of throughput, PDR, delay, and energy efficiency in comparison to other existing approaches like EQSR, E2S-DRL, and QSEAP. Table 7 compares the proposed system with other current methods using a variety of performance criteria.

Table 7 Compute the proposed system with other existing work

Figure 29 depicts the throughput for the suggested technique and the other three current methods after conducting a throughput study. The suggested approach's throughput is 3% higher than that of its nearest approach, OSEAP. Because to congestion brought on by individual nodes that aren't part of clusters, the graph shows that the EQSR has the poorest throughput. By using goal functions for many parameters like energy, distance link quality, etc., the suggested solution has resolved the issue.

Fig. 29
figure 29

Throughput performance analyses of proposed system with other existing approach

Figure 30 shows the network latency in seconds for the three methods and suggested approach. The bar charts in Fig. 30 were created using data from Table 6, which displays the average delay rates for each of the four strategies. It should be noted that the highest average latency for the suggested technique in a network with 20 nodes is 0.11 s. When the size of the network grows, the latency for the other methods also grows.

Fig. 30
figure 30

Delay performance analyses of proposed system with other existing approach

Figure 31 depicts the energy efficiency for the suggested technique and the other three current methods after conducting an efficiency study. The suggested approach's energy efficiency is higher than other approaches. The graph shows that the OSEAP and EQSR have the poorest energy efficiency approach.

Fig. 31
figure 31

Energy performance analyses of proposed system with other existing approach

6 Conclusion

In conclusion, the proposed approach using modified Fuzzy Logic, whale optimization algorithm, and Enhanced Crow Swarm Optimization can effectively optimize the CH selection and path selection for IoT-enabled smart agriculture systems. Throughput reflects the data transmission capacity, ensuring that a cluster head can efficiently handle and relay information. A high Packet Delivery Ratio indicates the cluster head's effectiveness in successfully delivering data packets to their intended destinations, reducing wasteful retransmissions. Minimal network Delay highlights the promptness of data delivery, ensuring that critical information reaches its destination without undue latency. Energy Efficiency, as a fundamental criterion, signifies how effectively a cluster head utilizes its resources, including energy, to perform its tasks. An energy-efficient cluster head should maximize data transmission and minimize energy consumption, ultimately prolonging the network's operational life. By evaluating relevant parameters and employing optimization algorithms, the proposed approach can improve the performance of the system in terms of throughput, packet delivery ratio, delay, and energy efficiency. The results of the simulation experiments demonstrate the superiority of suggested approach over existing ones, which highlights its potential to revolutionize the way farmers monitor and manage their crops. By optimizing the IoT system, proposed approach can lead to better crop yield and higher profitability for farmers, making it a promising solution for smart agriculture. In the future, to improve the usability of the proposed approach, a user-friendly interface can be developed that allows farmers and other stakeholders to easily interact with the system, visualize data, and make informed decisions. This can help to increase adoption and usage of the system, leading to more effective and efficient agricultural practices.