Internet of Things-Based Fuzzy Logic Controller for Smart Soil Health Monitoring: A Case Study of Semi-Arid Regions of India †

: The human population continues to grow, and speciﬁc efforts must be made in order to meet foreseeable food demands. In this paper, it is suggested that an IoT-based fuzzy control system be used for smart soil monitoring systems. This study is based on the semi-arid regions of India. A fuzzy classiﬁer is used to categorize the real-time data into three parameters, such as sodium, potassium, and calcium, based on the proposed model, which gets trained from a dataset and then chooses the optimal solution. The real-time data are collected from NPK sensors, which are suitable for sensing the content of nitrogen, phosphorus, and potassium in the territory, which helps in determining the fertility of the soil by facilitating the systematic assessment of the soil condition. With the aid of this system, a farmer would be able to monitor soil health in a real-time environment and also track the growth of their plants. Farmers will be able to enhance productivity while decreasing resource waste with the aid of an IoT-enabled fuzzy system. Experimental data have been collected from Mahoba district, Uttar Pradesh provinces in India, and the results show that the suggested system is a more reliable and precise concept used for precision farming that will certainly enhance the overall production of crops with better quality. These results obtained with the help of the proposed model system have been compared with the existing one with data accuracy that has been improved and well accepted.


Introduction
A networked machine ecosystem is a fitting way to define the Internet of Things [1].This technology has the potential to be widely used in agriculture for crop production improvement and soil health detection.Sensors are frequently employed to monitor soil parameters important for crop development [2].Farmers receive several forms of data from the sensors, which are processed to improve agricultural productivity [3].These sensors are managed by software applications designed expressly for this purpose.Sensors are used primarily for monitoring and control, security and warning, and diagnostics and analysis.It moves farming one step closer to self-sufficiency and independence from human involvement [4].This study covers the IoT technology based on fuzzy logic that is used to monitor soil health in semi-arid locations.To make optimal judgments for precision agricultural activities, the research focuses on sensor technologies for real-time data collection and fuzzy logic controllers (FLCs) [5] for approximate decision-making.This research looks at the uses of various sensors in the agricultural process.These products are for sale in the marketplace.How these sensors are employed in different types of farms and how they benefit farmers, consumers, and the economy [6,7], the materials and procedures used for the testing, the study area, a brief overview of the NPK sensor, fuzzy logic controller, and suggested technique for alert generation system are all included in Section 2 of the paper.Section 3 describes the modeling of various sensor parameters and fuzzy variables.Section 4 details the system's performance study and comparison with existing systems.Section 5 discusses the conclusion and improvement plan.

Materials and Methods
Dry areas with an aridity index of 0.20 to 0.50 are referred to as semi-arid zones [8].Due to historical land use, semi-arid soils commonly experience degradation, which leads to low levels of soil organic carbon (SOC) and poor structure.Human-caused erosion, salinity, and deterioration pose significant difficulties to semi-arid soils.Our research is centered on the Mahoba district of Uttar Pradesh, India, which is classified as semi-arid.We put up numerous sensors in one area to collect datasets for the construction of fuzzy rules based on the proposed model.We use real-world inputs from a few selected sensors for testing.Figure 1 displays the recommended model's block diagram, which is made up of five parts.The first section is concerned with the design of NPK sensors, while the second part is concerned with converting the analog signal to a digital signal (obtained from the NPK sensors).The third step is to create the fuzzy logic controller and inference rules based on the acquired dataset.The fourth step is to install the model in a cloud database, and the fifth step is to generate alarm messages.research looks at the uses of various sensors in the agricultural process.These products are for sale in the marketplace.How these sensors are employed in different types of farms and how they benefit farmers, consumers, and the economy [6,7], the materials and procedures used for the testing, the study area, a brief overview of the NPK sensor, fuzzy logic controller, and suggested technique for alert generation system are all included in Section 2 of the paper.Section 3 describes the modeling of various sensor parameters and fuzzy variables.Section 4 details the system's performance study and comparison with existing systems.Section 5 discusses the conclusion and improvement plan.

Materials and Methods
Dry areas with an aridity index of 0.20 to 0.50 are referred to as semi-arid zones [8].Due to historical land use, semi-arid soils commonly experience degradation, which leads to low levels of soil organic carbon (SOC) and poor structure.Human-caused erosion, salinity, and deterioration pose significant difficulties to semi-arid soils.Our research is centered on the Mahoba district of Uttar Pradesh, India, which is classified as semi-arid.We put up numerous sensors in one area to collect datasets for the construction of fuzzy rules based on the proposed model.We use real-world inputs from a few selected sensors for testing.Figure 1 displays the recommended model's block diagram, which is made up of five parts.The first section is concerned with the design of NPK sensors, while the second part is concerned with converting the analog signal to a digital signal (obtained from the NPK sensors).The third step is to create the fuzzy logic controller and inference rules based on the acquired dataset.The fourth step is to install the model in a cloud database, and the fifth step is to generate alarm messages.

NPK Sensor
The NPK sensor [9] setup includes four 10K resistors to detect the nutrients present in the soil while guarding against LED current overload.To determine the nutritional level of the soil solution, LEDs first transmit light into it.The colorimetric principle states that the chemical composition of the soil affects how much light will be reflected from the solution.An LDR absorbs this light (using the concept of photoconductivity), and the amount of light absorbed will be recorded.The quantity of light absorption (A) in the LDR will calculated using the Beer-Lambert equation, in Equation (1).

NPK Sensor
The NPK sensor [9] setup includes four 10K resistors to detect the nutrients present in the soil while guarding against LED current overload.To determine the nutritional level of the soil solution, LEDs first transmit light into it.The colorimetric principle states that the chemical composition of the soil affects how much light will be reflected from the solution.An LDR absorbs this light (using the concept of photoconductivity), and the amount of light absorbed will be recorded.The quantity of light absorption (A) in the LDR will calculated using the Beer-Lambert equation, in Equation (1).
where 'l' stands for the length of the light path, 'c' is the solution concentration, and 'K' stands for the molar absorptivity.Equation (2) states that the resistance level (R L ) in a light-diffusing device (LDR) impacts how much light will reflect per unit of area (Lux), and Equation (3) uses this information to compute the output voltage across an LDR.
The voltage that results shows the nitrogen, phosphorus, and potassium concentrations in the test soil along with the data gathered by the sensor.

Fuzzy Logic Controller (FLC) for Soil Analysis
A mathematical concept called fuzzy logic deals with information that is imprecise.Fuzzy logic, as opposed to conventional binary logic, allows the representation of degrees of truth.A FLC is a decision-making system that interprets and reacts to input data using fuzzy logic concepts.The inference engine infers the correspondence fuzzy value with the aid of pre-defined fuzzy rules available in the knowledge base, and finally, the defuzzification block converts the fuzzy output value to the corresponding crisp value [10].The fuzzy logic controller's block design is in Figure 2. It receives input data from an NPK sensor and fuzzify it to translate it into desired language phrases (in Figure 3).The inference engine determines the correspondence fuzzy value using pre-defined fuzzy rules from the knowledge base, which is subsequently translated into a corresponding crisp value by the defuzzification block [10].
Eng. Proc.2023, 56, x FOR PEER REVIEW 3 of 7 where 'l' stands for the length of the light path, 'c' is the solution concentration, and 'K' stands for the molar absorptivity.Equation (2) states that the resistance level (RL) in a light-diffusing device (LDR) impacts how much light will reflect per unit of area (lux), and Equation (3) uses this information to compute the output voltage across an LDR.
The voltage that results shows the nitrogen, phosphorus, and potassium concentrations in the test soil along with the data gathered by the sensor.

Fuzzy Logic Controller (FLC) for Soil Analysis
A mathematical concept called fuzzy logic deals with information that is imprecise.Fuzzy logic, as opposed to conventional binary logic, allows the representation of degrees of truth.A FLC is a decision-making system that interprets and reacts to input data using fuzzy logic concepts.The inference engine infers the correspondence fuzzy value with the aid of pre-defined fuzzy rules available in the knowledge base, and finally, the defuzzification block converts the fuzzy output value to the corresponding crisp value [10].The fuzzy logic controller's block design is in Figure 2. It receives input data from an NPK sensor and fuzzify it to translate it into desired language phrases (in Figure 3).The inference engine determines the correspondence fuzzy value using pre-defined fuzzy rules from the knowledge base, which is subsequently translated into a corresponding crisp value by the defuzzification block [10].

Alert Generation System Using IoT
Analog signals are sensed by an NPK sensor connected to an A-to-D converter [11].This produces a digital output linked to an Arduino device equipped with a WI-FI networking module to carry out more investigation into the soil's nutritional insufficiency.After receiving the LDR output voltage, the first step is to run a Python program that employs a fuzzy inference technique to diagnose soil nutrients.where 'l' stands for the length of the light path, 'c' is the solution concentration, and 'K' stands for the molar absorptivity.Equation (2) states that the resistance level (RL) in a light-diffusing device (LDR) impacts how much light will reflect per unit of area (lux), and Equation (3) uses this information to compute the output voltage across an LDR.
The voltage that results shows the nitrogen, phosphorus, and potassium concentrations in the test soil along with the data gathered by the sensor.

Fuzzy Logic Controller (FLC) for Soil Analysis
A mathematical concept called fuzzy logic deals with information that is imprecise.Fuzzy logic, as opposed to conventional binary logic, allows the representation of degrees of truth.A FLC is a decision-making system that interprets and reacts to input data using fuzzy logic concepts.The inference engine infers the correspondence fuzzy value with the aid of pre-defined fuzzy rules available in the knowledge base, and finally, the defuzzification block converts the fuzzy output value to the corresponding crisp value [10].The fuzzy logic controller's block design is in Figure 2. It receives input data from an NPK sensor and fuzzify it to translate it into desired language phrases (in Figure 3).The inference engine determines the correspondence fuzzy value using pre-defined fuzzy rules from the knowledge base, which is subsequently translated into a corresponding crisp value by the defuzzification block [10].

Alert Generation System Using IoT
Analog signals are sensed by an NPK sensor connected to an A-to-D converter [11].This produces a digital output linked to an Arduino device equipped with a WI-FI networking module to carry out more investigation into the soil's nutritional insufficiency.After receiving the LDR output voltage, the first step is to run a Python program that employs a fuzzy inference technique to diagnose soil nutrients.

Alert Generation System Using IoT
Analog signals are sensed by an NPK sensor connected to an A-to-D converter [11].This produces a digital output linked to an Arduino device equipped with a WI-FI networking module to carry out more investigation into the soil's nutritional insufficiency.After receiving the LDR output voltage, the first step is to run a Python program that employs a fuzzy inference technique to diagnose soil nutrients.
A system with software is uploaded in accordance with the detected value, and it also alerts the field owners about required fertilizer on a regular basis.The best fertilizer for the soil is selected in the second stage using the results of the fuzzy rule system.This process generates fertilizer in text form.The third stage of the program flow links the massage agent and transmits the message about fertilizer over the internet.The sensor value and fuzzy logic system response are saved in the embedded program's link to the Google Cloud database for later use.The modeling of fuzzy input parameters and their correspondence with fuzzy outputs is shown in Figure 4.
A system with software is uploaded in accordance with the detected value, and it also alerts the field owners about required fertilizer on a regular basis.The best fertilizer for the soil is selected in the second stage using the results of the fuzzy rule system.This process generates fertilizer in text form.The third stage of the program flow links the massage agent and transmits the message about fertilizer over the internet.The sensor value and fuzzy logic system response are saved in the embedded program's link to the Google Cloud database for later use.The modeling of fuzzy input parameters and their correspondence with fuzzy outputs is shown in Figure 4.

Modeling of Sensor and Fuzzy Parameters
The simulation program is used to transport data from the NPK sensor kit to the cloud server and assess performance factors such as throughput, end-to-end latency, and average jitter.It is accomplished by adjusting the network density.Table 1 shows the fuzzy rules created by the fuzzy inference module and the associated output.The network protocols were implemented in Python3.8, and to assess network performance, several simulated scenarios were developed.For testing the model, we chose ten nodes.Similar setups, including internet servers with 6, 7, 14, 19, 23, and 35 nodes, were used to analyze end-to-end throughput, latency, and jitter [12].The implemented network performance was tested in terms of scalability.The proposed system can deploy in real time to examine any type of soil in semi-arid lands.The hardware settings for the sensor nodes are shown in Table 2.

Results and Performance Analysis
The sensor's active mode determines how much energy it uses.The proposed system's sensor has not been used for more than 24 h.Regular soil nutrient monitoring takes two to three days, or roughly 36 h, during the crop's growth.The crops grown in each agricultural area determine the relatively low sensing frequency and data transfer to the cloud.The proposed system outperformed the mentioned algorithms in the experiment

Modeling of Sensor and Fuzzy Parameters
The simulation program is used to transport data from the NPK sensor kit to the cloud server and assess performance factors such as throughput, end-to-end latency, and average jitter.It is accomplished by adjusting the network density.Table 1 shows the fuzzy rules created by the fuzzy inference module and the associated output.The network protocols were implemented in Python3.8, and to assess network performance, several simulated scenarios were developed.For testing the model, we chose ten nodes.Similar setups, including internet servers with 6, 7, 14, 19, 23, and 35 nodes, were used to analyze end-to-end throughput, latency, and jitter [12].The implemented network performance was tested in terms of scalability.The proposed system can deploy in real time to examine any type of soil in semi-arid lands.The hardware settings for the sensor nodes are shown in Table 2.

Results and Performance Analysis
The sensor's active mode determines how much energy it uses.The proposed system's sensor has not been used for more than 24 h.Regular soil nutrient monitoring takes two to three days, or roughly 36 h, during the crop's growth.The crops grown in each agricultural area determine the relatively low sensing frequency and data transfer to the cloud.The proposed system outperformed the mentioned algorithms in the experiment using various machine learning algorithms, as shown in Figure 5 [13][14][15][16][17][18][19][20].We adjusted the frequency of data transmission of numerous sensors to estimate energy conservation.Each sensor takes less than 0.14 mJ of energy to detect, analyze, and transmit data.
using various machine learning algorithms, as shown in Figure 5 [13][14][15][16][17][18][19][20].We adjusted the frequency of data transmission of numerous sensors to estimate energy conservation.Each sensor takes less than 0.14 mJ of energy to detect, analyze, and transmit data.Throughput, or data transport rate through a network, is changed with network density.When analyzing throughput changes, the data transfer frequency is kept constant.Over a node density of 20, the throughput reaches saturation.The average end-to-end latency for every network density is calculated from the latency of the circuit (from the sensor to the server).The average latency increases as node density climbs; as a result, the shared network becomes increasingly congested during data transmission.The average jitter, which varies with node density, is 4 ms.The experimental results show that the suggested system can be deployed in semi-arid agricultural areas to improve soil health and yields.The performance appears to be scalable, viable, and employable.Internet agents (as depicted in Figure 6) send out SMSs about the appropriate fertilizer application depending on the present soil nutrient level in accordance with the system's output.

Conclusions
It is challenging to routinely evaluate soil nutrients in agricultural fields by conventional testing methods.The suggested system notifies the farmer by SMS of the absence of critical soil nutrients, specifically nitrogen, phosphorus, and potassium.Throughput, or data transport rate through a network, is changed with network density.When analyzing throughput changes, the data transfer frequency is kept constant.Over a node density of 20, the throughput reaches saturation.The average end-to-end latency for every network density is calculated from the latency of circuit (from the sensor to the server).The average latency increases as node density climbs; as a result, the shared network becomes increasingly congested during data transmission.The average jitter, which varies with node density, is 4 ms.The experimental results show that the suggested system can be deployed in semi-arid agricultural areas to improve soil health and yields.The performance appears to be scalable, viable, and employable.Internet agents (as depicted in Figure 6) send out SMSs about the appropriate fertilizer application depending on the present soil nutrient level in accordance with the system's output.
using various machine learning algorithms, as shown in Figure 5 [13][14][15][16][17][18][19][20].We adjusted the frequency of data transmission of numerous sensors to estimate energy conservation.Each sensor takes less than 0.14 mJ of energy to detect, analyze, and transmit data.Throughput, or data transport rate through a network, is changed with network density.When analyzing throughput changes, the data transfer frequency is kept constant.Over a node density of 20, the throughput reaches saturation.The average end-to-end latency for every network density is calculated from the latency of the circuit (from the sensor to the server).The average latency increases as node density climbs; as a result, the shared network becomes increasingly congested during data transmission.The average jitter, which varies with node density, is 4 ms.The experimental results show that the suggested system can be deployed in semi-arid agricultural areas to improve soil health and yields.The performance appears to be scalable, viable, and employable.Internet agents (as depicted in Figure 6) send out SMSs about the appropriate fertilizer application depending on the present soil nutrient level in accordance with the system's output.

Conclusions
It is challenging to routinely evaluate soil nutrients in agricultural fields by conventional testing methods.The suggested system notifies the farmer by SMS of the absence of critical soil nutrients, specifically nitrogen, phosphorus, and potassium.

Conclusions
It is challenging to routinely evaluate soil nutrients in agricultural fields by conventional testing methods.The suggested system notifies the farmer by SMS of the absence of critical soil nutrients, specifically nitrogen, phosphorus, and potassium.It does this through the system's integrated NPK sensor and fuzzy system.The outcomes of the proposed model performed are to better understand how the built IoT system works and to describe its intended purpose.The experiment shows that the suggested system is an accurate, low-cost, and intelligent Internet of Things (IoT) system that instantly alerts the farmer by SMS about the fertilizer that needs to be applied at the right moment.This system might be a helpful tool for farmers in the agricultural industry.

Figure 1 .
Figure 1.Study location of Mahoba district, Uttar Pradesh provinces in India (credit to Google map of geo-tagged image).

Figure 1 .
Figure 1.Study location of Mahoba district, Uttar Pradesh provinces in India (credit to Google map of geo-tagged image).

Figure 3 .
Figure 3. Schematic flow of IoT-based soil health-monitoring module.

Figure 3 .
Figure 3. Schematic flow of IoT-based soil health-monitoring module.

Figure 3 .
Figure 3. Schematic flow of IoT-based soil health-monitoring module.

Figure 4 .
Figure 4. Modeling of the input and output linguistic parameters.

Figure 4 .
Figure 4. Modeling of the input and output linguistic parameters.

Figure 5 .
Figure 5. Comparative performance analysis of proposed system.

Figure 6 .
Figure 6.Alert message received by the land owner.

Figure 5 .
Figure 5. Comparative performance analysis of proposed system.

Figure 6 .
Figure 6.Alert message received by the land owner.

Figure 6 .
Figure 6.Alert message received by the land owner.

Table 1 .
Fuzzy inference rules generated by the system.If N is Low and P is Low and K is Low then Health is LowIf N is High and P is Low and K is Low then Health is Medium If N is Low and P is High and K is High then Health is High

Table 1 .
Fuzzy inference rules generated by the system.If N is Low and P is Low and K is Low then Health is LowIf N is High and P is Low and K is Low then Health is Medium If N is Low and P is High and K is High then Health is High