IoT-Based Automated Management Irrigation System Using Soil Moisture Data and Weather Forecasting Adopting Machine Learning Technique

Document Type : Original research articles

Author

Electrical Engineering Department, Faculty of Engineering, Sohag University, Sohag, Egypt

Abstract

Automated irrigation systems have become essential for farmers as they conserve water and help farmers better understand the needs of their crops. In this paper, we aimed to reduce water consumption and waste due to agricultural uses, specifically irrigation. The main contribution of this paper is to use pH sensors, light sensors, humidity sensors, soil moisture sensors, and Arduino microcontrollers together with machine learning to predict proper crop needs based on the soil moisture data and weather forecasting. This was worked in a way that if the weather were to be rainy and the plant would receive a small percentage of its water need. As a result, the system would predict this and would give the user the option to save this amount of water. Once the data was collected by the sensors and the Arduino, it would be sent to an IoT server and then onto the processing layer which contains a devised machine-learning model. This model uses semantic knowledge and a programmed algorithm to provide the user with automated control over the water valves that irrigate the crops. The adopted machine-learning model ran using the KNN algorithm and it was able to optimize the accuracy by running statistical analysis. The obtained results indicate that the adopted new sensors and weather prediction yield efficient and economical water usage and reduction in water consumption usage.

Keywords

Main Subjects


  1. Introduction

Agriculture uses up to 85% of the world's water resources. Consequently, ensuring that the water is utilized in the most efficient way possible is crucial. In addition to the use of water in agriculture, maintaining a healthy and sufficient food supply is a very difficult task that also heavily depends on water. Keeping all this in mind, the global demand for freshwater is steadily increasing [1]-[3]. Therefore, continuing to use traditional irrigation systems in countries with limited resources will be very harmful when it comes to freshwater consumption. These systems are manual, requiring the farmer to personally water the crops at various times by drawing water from the source. This method is inefficient and there are already other techniques that are more effective. Firstly, surface irrigation, the most common system that uses gravity to deliver water to crops is classified into three main types: border, basin, and furrow systems. The first type is the basin system, which consists of level, diked areas that receive an uncontrolled flow. The second type is the border system, which differs from the basin system in that the borders are rectangular, with a sloping surface, and are not diked at the tail's end. The third kind is a furrow, whose main purpose is to control flow along with avoid the flooding of the whole region in which the soil surface is irrigated, and channels are made, with water leaking through the walls and bottom of these furrows. Besides surface irrigation and its types, other methods are also quite common. Such as sprinkler irrigation, which is an approach for distributing water in a controlled manner, like rainfall. Water can be spread out via pumps, valves, pipelines, and sprinklers. Irrigation sprinklers can be used for a variety of applications, including industrial, residential, and agricultural. Thirdly drip irrigation is a preferred option, as it is the most effective means of supplying crops with water and nutrients. Since it delivers water and nutrients directly to the plant's root zone in precise amounts and at the proper times, ensuring that each plant gets accurately what it needs. Farmers may enhance yields while saving water, fertilizer, and energy.

Water and fertilizers are spread around the field using tiny, knotted pipes called 'drippers'. Each dripper administers water and fertilizer droplets, ensuring that water and nutrients are supplied uniformly and directly to the root region of each plant across the field [4]. The more recent method, however, is smart irrigation which is emerging using data-intensive methods to increase agricultural efficiency while reducing its environmental impact. This is accomplished by collecting data from numerous sensors and constructing an IoT system. As a result, because irrigation water is used only when it is needed by plants, water consumption is decreased in contrast to traditional automatic system timers that irrigate the crops depending on a schedule designed by the farmer. This kind of system exists as a complete controller or sensor that could be added to an existing irrigation timer to create a smarter controller. And finally, these improvements are brought depending on soil conditions, nutrients, humidity, temperature, and weather conditions.  

     The rest of the paper is consolidated as follows. Section 2 is dedicated to a literature review of the related works. Sections 3 and 4 discuss the architecture and implementation of the proposed system respectively. Sections 5 and 6, investigate the weather forecasting data along with the results and discussions respectively. Finally, Section 7, concludes the paper and suggests possible future improvements.

  1. Literature Review

     In many countries, inefficient irrigation is responsible for a large part of wastewater, and as a result, they require a more advanced-efficient irrigation system. Traditional methods of irrigation without the use of cloud computing as well as, edge computing yields unstable watering results for the crops. Therefore, we intend to create a smart-reliable system that has a more consistent irrigation pattern. During the last couple of decades, irrigation systems using IoT services in addition to sensors have been developed. These systems prove helpful in solving some of the challenges, however, there are many improvements to be made. One of the biggest breakthroughs in irrigation that have several layers is the Smart Water Management Platform, also known as SWAMP.

     The device and communication layer are the very first layer/step in the SWAMP architecture, where several sensors of different types are employed to gather valuable information, such as humidity and temperature. The second layer, known as the data collection, security, and management layer, is responsible for collecting and managing the data from the sensors. The third layer is called the data management layer. This layer is responsible for the processing, storing, and distributing of the data. Also, it takes the use of the Semantic Calculator to prepare the data for the following layer. The fourth layer, known as the water irrigation and distribution layer, uses common-traditional strategies for estimating irrigation costs of how much water may be needed [5]. However, even though the SWAMP system did solve several challenges, it introduced new ones, mainly because it consumes a lot of energy. Therefore, the energy-efficient water management platform or EEWMP shown in Fig. 1 was introduced, with strategies for reducing redundant data. The experimentally collected data demonstrated that the EEWMP consumes less energy by about 30% and causes an increase in network stability by almost double the amount, of SWAMP. The destination packets were 1.5 times more in EEWMP than in SWAMP since the network has become more stable [6].

     The field sensors are the hardware devices that collect the data required using sensors and then send it for processing using a specified communication technique as depicted in Fig. 2. This could be considered the first step. Afterward, this data is transmitted to the In-Field Sink, which has the main task of collecting the information gathered by the sensors and sending it to the outer sink for analysis. The step in the system consists of the outer sink, which receives the data send from the infield sink and forwards it to the second part. The fusion center then reduces the communication traffic and conserves the energy lost during communication and computation. The IoT service cloud could be taken into consideration in the fourth step, an IoT service cloud is a service that works online to process, store and manage data received. These clouds are accessible with computer devices.

     The IoT server is utilized in the EEWMP application to capture and identify user data. Finally, the following three parts are the Valves Controller, which is one of the most essential parts of the system, as it controls the water release in all the valves in the field. The valves, if necessary, must shut off and reopen the water supply to various fields under instruction from the main valve controller. Lastly, User Connectivity, the user’s main way of connecting to the system applying any module type is quite important, as it is responsible for sending the user any updates/info using notifications.

 

 

Fig. 1: Architecture of Proposed Energy-Efficient Water Management Platform (EEWMP).

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Fig. 2: Proposed Irrigation System

  1. Architecture of the proposed system

The suggested system in question can select intelligent/ accurate decisions when deciding whether to irrigate the crops. However, such a process cannot depend entirely on the developed machine learning system’s predictions and decisions. This is because the developed system needs certain information to draw such conclusions. This group of information is what we call ontology. It consists of the following list of information: soil pH value, temperature, humidity, and soil moisture, in addition to light intensity. Therefore, the proposed system’s decisions depend partially on the ontology results and the trained-smart machine-learning model. To be specific, the split in importance is a 50/50 split. The proposed intelligent architecture of the watering system is seen in Figure 3. We found that including a solar panel for energy generation is a good option that could replace the usage of batteries and must maintain and change the batteries occasionally. The basic or rather generic IoT architecture is made up of the following three layers, network layer, application layer, and perception layer. However, our proposed system has a slightly modified architecture that contains four layers, which are perception, transport, processing, and application layers respectively in the same order.

      To start, the perception layer, which is also called the physical layer, consists of the sensors that collect and assemble our data. This layer is responsible for determining the weather (temperature and humidity), the soil’s pH moisture level, as well as light intensity. Afterward, the transport layer comes into question to deliver the collected information/ data to the processing layer through any of the known wireless means (4G, 5G) or even through LAN. The processing layer uses and works with all the incoming data using several methods and technologies such as cloud computing and edge computing. In addition, this layer consists of the machine-learning model as well as all the databases used in the system. Finally, the application layer, this layer is responsible for offering the end-user options/applications that can be taken according to the processing of the system. The system developed uses a Global System for Mobile Communication (GSM) module with a sim card for storage which operates over a subscription to a mobile operator.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Fig. 3: The Four Layers of the System

 

  • Sensor Data

     As we can see in Fig. 4, the first part of the process is the series of data collected by the sensors within the system. Whether it is related to the soil or the weather. The Arduino microcontroller serves as the perception layer in this scenario [7]. Following that, we can observe the transport layer, which, as previously mentioned, transfers data using a GSM module onto the processing layer, where the data centers gather and analyze the information to make appropriate choices/decisions for the application layer. Most of the used components are fortunately easy to gather and set up. Then the system we devised should be easy to deploy in the real environment. In the proposed system, the Arduino receives analog data collected by the sensors and continues to send this data every 30s through the GSM module to the data centers.

 

 

    

 

 

 

 

 

 

 

 

 

 

Fig. 4: Representation of Ontology

When these procedures are complete, the final recommendations/ suggestions based on the decision support system in Fig. 5, will be shown on the mobile application. This would give the user instant commands on whether to water the field. Soil type, climate type, and crop type all change over time. Ontology inhabits these parameters in the developed intelligent system for greater competence and precision. We built the system to be functionally capable of responding to most scenarios. The semantic knowledge base for the developed smart irrigation system is described in the following section.

 

 

 

 

 

 

 

 

 

 

 

 

Fig. 5: Architecture of The Decision Support System

  • Semantic Knowledge Base

     The semantic database model’s (SDM) importance relies on the fact that it handles the data collected from the real world, meaning that it contains information about crop types, weather conditions, soil types, and quality as seen in Figure 7. Semantic knowledge is the general ontology information to be always recalled at any time. One very popular example would be the case of rice or sugar cane, both are crops that usually require more irrigation and such a fact should be a sort of background knowledge of sorts for our system. In addition, there are several types of soil structures, we generally classify these into four types, sandy, silt, clay, and loamy. Each of the mentioned types affects the amount of water the crops would need (due to some types keeping water better than others). Accordingly, this database is very important to build up an automated irrigation system.

  • Analysis Technique Using K-Nearest Neighbour

The k-Nearest Neighbour algorithm is one of the more machine learning algorithms that use a non-parametric, supervised learning classifier, which uses proximity to make classifications or predictions about the grouping of an individual data point. This method analyses the new case/data to those that already exist, assuming that they are similar, and then places the new case/data in the category that is most like those that already exist. It saves all available knowledge and designates new information points according to similarities. This means that when new information becomes available, the KNN algorithm can swiftly classify it into an appropriate group.

Once the collected data is added, we calculate a Euclidean distance between the new data and the ones that already exist to predict and categorize the resultant point. This is done by choosing the nearest K values to the indicated K (being 5 in our application) and then calculating the Euclidean distance from this point to the nearest data points. Once this process is completed, the system categorizes the new data point to an already existing category and the process can now go on to application options. The Euclidean distance ( ) is computed using the following equation.             

                                                                     (1)

  1. The Proposed System Implementation

As previously mentioned, the system proposed uses an Arduino microcontroller, which receives the data and transfers it to the server via the GSM module. When the information reaches the processing layer’s edge server, which is the first processing layer, the data is employed to predict the subsequent required water level. These planned results are transferred to the IoT server to carry out the second processing layer. In this step, the trained machine-learning model aims to analyze and decide the level of water needed by the crops.  

  • Hardware Setup

For the System, the embedded system sensors used in the IoT-based systems provide specific and cost-effective sensing and allow real-time data to be recorded and evaluated. his enables the system to compute and take accurate decisions. As shown in Fig. 6, we employ several sensors to collect various data about the environment, and the SIM808 GSM module is used to transmit the data to the system's processing layer. The GSM module also has a data SIM card added to it to be able to facilitate real-time data transferring. The hygrometer sensor that was used in our setup to collect data about soil moisture is depicted in Fig. 7. On the other hand, air humidity is recorded using the AM2302 DHT22 sensor to be specific as depicted in Fig. 8.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Fig. 6: Schematic of the Proposed System

  • HL-69 Soil Hygrometer Sensor

Figure 7 illustrates the HL-69 soil hygrometer sensor chosen to detect the humidness of the soil in question. It is mainly employed to provide more accurate and specific readings than other moisture sensors. The sensor's working mechanism is that the output voltage varies with the amount of water in the soil. The following are the primary characteristics of the HL-69 soil hygrometer sensor: The output voltage will drop if the ground is wet, and it rises if the ground is dry. The soil moisture sensor on the hygrometer generates an analog signal that the Arduino converts to digital. This sensor consists of two parts: an electronic board and two water-detecting pads. On the board is an LM393 comparator chip. There are two lamps. Red and green lights indicate power supply and digital switching output, respectively.

 

  • AM2302 DHT11 Temperature Sensor

Figure 8 shows the DHT22 temperature sensor that could determine and sense the temperature and humidity levels of the air. It consists of two components: a humidity sensor and a thermistor. The temperature range of the DHT22 sensor is 0-50%, with an accuracy of 2-5, and the humidity range is 20-80%, with an accuracy of 5. The DHT22 sensor has an I/O voltage range of 3V to 5V and a maximum current of 2.5mA when data is requested during conversion.

  • BH1750 FVI Light Sensor

Figure 9 shows the BH1750 digital sensor used to measure the light intensity. It can even measure minimal light traces, making it very accurate, as it converts these signals to 16-digit numeric values. This feature is commonly used in mobile phones to optimize the screen’s brightness based on ambient lighting [8]. The BH1750 sensor is employed to measure the light intensity in the range of 0 to 65,535 Lux. It has a built-in 16-bit AD converter that converts light detection into a 16-digit number.  

A.4. SEN0169 V2 pH Sensor Kit

As shown in Fig. 10, this pH sensor kit can precisely measure a solution's pH and reflect its acidity or alkalinity. This sensor is extensively employed in several applications, including aquaculture, aquaponics, and water testing in the environment. It has a wide voltage input range of 3.3V to 5.5V, a hardware-filtered output signal, a low-jitter gravity connector, and a plug-and-play BNC connector. The application library provides 2-point calibration and automatically identifies standard buffer solutions. It has a consistent size, which makes designing mechanical structures easier. This kit also has two potentiometers included, one is to control the maximum measured value, and the other is to change the measured offset value. The accuracy of this pH kit is ± 0.1 pH (25 ℃), and the response time is less than or equal to 5 seconds.

 

 

 

 

Fig. 7: HL-69 Soil Hygrometer Sensor

Fig. 8: AM302 DHT11 Temperature Sensor

 

 

 

 

 

Fig. 9: BH1750 FVI Light Sensor

Fig. 10: SEN0169 V2 pH Sensor Kit

 

  1. Weather Forecasting Data

The forecast is the final type of weather data that is currently available. It gives a detailed forecast of the weather's behavior during the next few days. Numerous organizations produce weather forecasts [9]. To create the most accurate weather forecast, the output from various forecast models will be integrated, which will then give the best forecast estimate. One of the most organizations that offer accurate climate and environmental intelligence platforms is Ambee [10]. It is the world's most precise platform for environmental and climate intelligence. Ambee, is a provider of environmental and climatic information and creates hyperlocal datasets for weather, pollen, air quality, and other climate variables. The organization was established with the goal of democratizing access to environmental data and tools that promote better and healthier living. It also offers a free dataset that we will use in the IoT-based irrigation system. 

  1. Results and Discussion

The proposed irrigation system manages to develop and come up with assisting findings, according to the capabilities of the machine learning system devised. The proposed setup including all sensors and microcontrollers was deployed into the field. The GSM module was used to transfer the data they had acquired, and onto the mobile application where proper actuation options were presented to the user/farmer giving him the choice of either opening or closing the irrigation valve.

  • Preparing the Training Dataset

The proposed system has been created in such a way that it would be completely automated. Therefore, the sensor data received from the field is processed depending on the trained machine-learning model. This has been completed by considering five different classes for preset characteristic sensor values. Namely, these, are highly needed (HN), needed (N), average (A), not needed (NN), and highly not needed (HNN). The classification is based on the values and ranges of humidity, soil moisture, and temperature as illustrated in Table 1 for some sensors included in the system. While setting up the table of data, some information must be studied. For example, the reading from the AM2302 DHT11 sensor is employed to measure both weather humidity and temperature. It has humidity readings in the range of 20% to 80% and temperature readings ranging from 0 to 50 degrees (°C). Using these sampled data and ranges, we came up with a sampled training dataset in Table 2. This table shows the structure of the sampled training dataset considering the weather broadcasting and the sensors data. This will be provided to the machine-learning algorithm to aid in the process of predicting the required water levels based on readings from the sensors, information on the soil's wetness, and weather predictions.

 

Table 1: Different Classes of Sensors’ Data

Class

Humidity (%)

Soil Moisture (%)

Temperature (C)

Weather condition

 

 

Highly Not Needed

>80

80-100

<20

Flooding

 

Flooding

Not Needed

61-80

61-80

20-24

Heavy Raining

 

Heavy Raining

Average

46-60

45-60

25-34

Raining

 

Raining

Needed

30-45

34-45

35-45

Cloudy

 

Cloudy

Highly Needed

<30

<30

>45

Dry

 

Dry

 

 

Table 2: Samples of Dataset

Humidity

Soil Moisture

Temperature

Weather Condition

Labels

Ontology

Decision

100

100

1

5

-1

-1

 

99

99

2

1

-1

0

 

98

98

3

1

-1

1

 

97

97

4

3

0

2

 

96

96

5

4

1

3

 

95

95

6

1

-1

-1

 

94

94

7

3

-1

0

 

93

93

8

2

-1

1

 

92

92

9

4

0

2

 

 

  • Training of the KNN Model

The fact that, at a given temperature, different crops have different water requirements is considered since certain crops require more water within their nature. For example:

Rice > Sugarcane > Maize > Cotton > Wheat.

This general rule helps identify temperature, humidity, soil moisture ranges, and preferred pH conditions for all the specified types of crops to clarify this broad principle further [11]. This rule is adopted to define the working rules of different types of crops as illustrated in Table 3. One more working condition that is considered is the soil type since different soil types have different watering needs as well. These are listed in the following sequence, from most needing to least; sandy soil as it is the worst at holding water, clay soil as it is not a good absorber, organic soil, hot and dry soil, hot and humid and lastly the best at holding water would be cold and humid [12].

 

Table 3: Conditions of Different Crops

Condition

Humidity

Soil moisture

Temperature

Class

Ontology Decision

1

н <20

SM <20

т >50

HN

HN

2

н <40

SM <40

т >40

N

HN

з

н <60

SM <60

т >30

А

HN

4

н <80

SM <80

т >20

NN

HN

5

н >80

SM >80

т <20

HNN

HN

6

н <20

SM <10

т >57

HN

N

7

н <30

SM <30

т >40

N

N

8

н «0

SM <40

т >35

А

N

9

н <60

SM <60

т >30

NN

N

10

н >60

SM >60

т <30

HNN

N

11

н <20

SM <10

т >57

HN

А

12

н «30

SM «ЗО

т >40

N

А

13

н <40

SM <40

т >35

А

А

14

Н <60

SM <60

т >30

NN

А

15

Н >60

SM >60

т «30

HNN

А

16

Н <30

SM <40

т >50

HN

NN

17

Н <40

SM <б0

т >40

N

NN

18

Н <60

SM <80

т >30

А

NN

19

Н <90

SM <100

т >20

NN

NN

20

н >90

SM >100

т <20

HNN

NN

21

н <30

SM <30

т >50

HN

HNN

22

н <50

SM <б0

т >40

N

HNN

23

н <60

SM <80

т >30

А

HNN

24

н <80

SM <90

т >20

NN

HNN

25

н >80

SM >90

т <20

HNN

HNN

 

  • Implementation Using Edge Computing

We define routes to where Hypertext Transfer Protocol (HTTP) request is managed throughout the course of deploying the learning algorithm via Flask API. One route handle one HTTP request. Data travels through the system from one part (perception layer) to the next (edge server). We introduced edge computing in the first place because if it is removed, the IoT server would receive all incoming data from the sensors. Then these readings are used to predict the needed water levels. However, in this case, the server would be overflown with data every 30 seconds from the sensors, and this will cause the system to slow down and be quite ineffective. Therefore, an edge server is required as it prohibits this from happening and maintains the stable/steady flow of data [13].

  • Mobile Application

An Android platform is provided for farmers. wherein a dropdown menu displaying the input parameters, such as crop type, climatic type, and soil type, is utilized. Users can choose from them before sending the command to the device placed in the field. The ontology portion of the mobile app interface contains the data recorded about the different types of soil, crops, and climates. The set of data extracted from the ontology section is then sent to the IoT server for the machine-learning model to work on finding a suitable decision. This decision/option is then displayed on the app as text.

 

     To explore that, consider the case of choosing the crop type to be sugarcane. In this case, the soil type is dry, and the climate is hot. The readings for the soil water content, temperature, soil pH, and humidity from the sensors will be supplied to the machine-learning model when these settings have been chosen and the send button has been clicked, in addition to the ontology results for the selected details. Therefore, the machine-learning model can finally provide a resulting decision for the user to follow. In this case, the shown message indicates that the field highly needs to water. The degrees of water need/ necessity are listed using a range from -1 to 3 as shown in Table 4 to help specify which degree of watering is needed.

 

 

 

Table 4: Codes of Labels for different classes

Class

Codes of Labels

Highly Not Needed

-1

Not Needed

0

Average

1

Needed

2

Highly Needed

3

    One of the additional options added to the application is the fact that when the pH level of the soil is outside the optimal range. When this happens, the application will notify the user that the soil needs fertilizer added to neutralize its pH since, if the pH change is not addressed right away, it may negatively affect the growth of the crops. In addition, a similar option will be available in the application when it comes to light intensity. When the crops are not receiving proper illumination, a notification will also be sent to the user to offer additional illumination sources for the crops. Observed is the fact that these effects differ from one crop to another. The machine learning model will be able to recall from its ontology background.

  • Performance Evaluation

   After many executions of the KNN algorithm, we were able to complete the statistical analysis to determine the value of k for best performance. In addition to this value, we ran several tests using different methods of measuring precision, recall, and F1-score [14]. These methods work in the following way: precision tries to respond to the doubt “What percentage of identifications were correct?”. Therefore, it could be computed by dividing the true positive (TP) values by the summation of both TP and false positive (FP) values. While recall tries to answer the doubt “What percentage of true positives, were correctly identified?”. In this case, recall is computed by dividing the number of true positives by the summation of the true positives and false negatives (FN) values. Additionally, we used the F1-score, which is essentially a harmonic mean of both. The following formula was used to determine the applicable traditional F1-score value:

                                                                                                         (2)

     However, to increase accuracy as much as credible we had to keep in mind the general rules of choosing the k value in the KNN algorithm. These include that if the classes in question are two, k should have an odd value, and if the classes are more than two, k should not be a multiple of the number of cases. In the proposed application, the number of classes in question is expected to be five, namely, HN, N, A, NN, and HNN as illustrated in Table 4. Therefore, to choose a k value that is as accurate as possible, we plot a graph of k against mean error and went on to decide which value is optimal and compare it to the value of k=5.

  • Comparison with Other Methods

The key benefits of the suggested approach include wastewater reduction, increased crop yield productivity, better product quality, and enhanced costs and safety. It has a better performance compared with the recently developed irrigation systems utilizing machine-learning techniques. However, automation in agriculture frequently results in the substitution of machinery for human labor, which may result in the loss of jobs among farmers. Local economies and communities may suffer as a result, particularly in places where farming is a significant source of employment. The following are the findings of the comparison with other methods.

  • Case 1:

     To compare the speed of the proposed method with that presented recently in [15], the error rate versus k values is computed as seen in Table 5. It shows that the error starts high and increases as k increases, where the irrigation system uses only soil moisture data compared to the proposed system in which weather forecasting is also considered employing machine learning techniques. However, at k= [10:11] the error dropped to a low of 0.3 for that of [15], and at k= [9:10] the error dropped to a low of 0.25 for the proposed system. Therefore, we can say that the best value for k in the proposed case is 10 as it is the largest value of k where the error stays minimal. In the end, we compared the k value 10 to the chosen k=5 and decided which gave us better accuracy results as we can see in Tables 6 and 7. Figure 11 illustrates the error rate versus k value and indicates the best values for k in [15] and the proposed system model.

  • Case 2:

     The obtained results matched those described in references [16-20] when the weather forecasting conditions are released. These methods consider the following cases: 

  • Precision irrigation management using machine learning and digital farming solutions.
  • Smart irrigation monitoring and control strategies for improving water use efficiency in precision agriculture.
  • Integrating remote sensing techniques and meteorological data to assess the ideal irrigation system performance scenarios for improving crop productivity.

 

   So, the proposed method has the advantage over the previously published solutions as it benefits from adopting the weather forecasting conditions in determining the amount of water usage and the decision of for improving water use efficiency.

Table 5: Error Rate versus k Value

k

2

3

4

5

6

7

8

9

10

11

12

13

Mean Error of ref. [15]

0.30

0.35

0.45

0.35

0.50

0.35

0.35

0.30

0.30

0.30

0.35

0.35

Mean Error of the proposed system

0.20

0.30

0.40

0.30

0.45

0.40

0.30

0.25

0.25

0.35

0.30

0.30

k

14

15

16

17

18

19

20

21

22

23

24

25

Mean Error of ref. [15]

0.30

0.30

0.40

0.30

0.30

0.35

0.40

0.4

0.4

0.5

0.45

0.45

Mean Error of the proposed system

0.25

0.25

0.35

0.25

0.25

0.30

0.35

0.35

0.35

0.45

0.35

0.35

 

Table 6: Accuracy with k = 5

Codes of Labels

Precision (%)

Recall (%)

F1-score (%)

-1

80

100

89

0

33

20

25

1

25

33

29

2

0

0

0

3

100

100

100

 

 

 

 

 

 

Table 7: Accuracy with k = 11

Codes of Labels

Precision (%)

Recall (%)

F1-score (%)

-1

80

100

89

0

100

50

67

1

33

100

50

2

0

0

0

3

83

83

83

 

 

 

 

 

  • Case 3:

   The proposed machine learning model is compared with the methods described in [21]. The authors reported using the neural network, support vector machine (SVM), logistic regression, Naive Bayes, and K-Nearest Neighbours (K-NN) algorithms based on the data gathered. Table (6) indicates the comparison results. With a recognition rate of 98.6% and a root mean square error (RMSE) of 0.1, the results demonstrated that the proposed model is better compared to previous models. For enhanced visualization and management of water usage, we developed a mobile application that combines various sensor data and weather forecasting.

 

Table 6: Comparison with the results presented in reference [21]

Models

Parameter

Accuracy

RMSE

K-Nearest Neighbors

k = 3

98.3%

0.12

Neural Network

Sequential, Epochs = 50

97,2%

0.16

Naïve Bayes

GaussianNB

97%

0.17

Support Vector Machine

Linear SVC

96,7%

0.17

Logistic Regression

Logistic Regression

96.2%

0.19

The proposed K-Nearest Neighbors

k = 5

98.6%

0.10

 

 

Fig. 11: The error rate versus k value and indicates the best values for k in [15] and the proposed system model.

  1. Conclusion and Future Work

     In this paper, we aimed to reduce water consumption and waste due to agricultural uses, specifically irrigation. We did this by improving upon already developed intelligent irrigation systems that used sensors and microprocessors, Arduino specifically. The proposed main idea to improve the system’s performance was to introduce the concept of weather forecasting. This was designed such that, for example, if it were to rain, the plant would receive 20% of the water it required. As a result, the system would give the user the option to save the predicted amount of water. The data would be transferred to an IoT server after being gathered by the sensors and Arduino, and then onto the processing layer, which comprises a created machine-learning model. This model uses a semantic knowledge base along with a programmed algorithm to provide the user with automated control over the water valves that irrigate the crops. The user receives these options through a mobile application and would immediately control the watering of the crops. The machine-learning model employed ran using the KNN algorithm. It was able to optimize the accuracy by running statistical analysis to decide the best value of k at which the error is minimal. Other improvements to the system include the inclusion of a solar panel to the system to save the energy consumed by the system. Additionally, a wide range of sensors are used to ensure that the crops grow in the best conditions possible. The introduced sensors include a pH sensor, light sensors, temperature, humidity sensors, and soil moisture sensors onto already existing smart irrigation systems to help predict proper crop needs and save irrigation water. The obtained results indicate that weather prediction yields efficient and economical water usage. 

     By using a Raspberry Pi instead of Arduino, this system might be improved. This would offer the system a much faster processing speed and larger RAM to run the incoming data. However, in this case, the cost of the system would increase immensely, and therefore, the replication of the system would be inconvenient. Another possible improvement would be the development of a better machine-learning model. Many different algorithms could be used and developed in addition to the KNN algorithm and potentially lead to better accurate results in determining the required watering level [22]-[23].

  • Khaled Obaideen, Bashria A.A. Yousef, Maryam Nooman AlMallahi, Yong Chai Tan, Montaser Mahmoud, Hadi Jaber, Mohamad Ramadan, “An overview of smart irrigation systems using IoT,” Energy Nexus, Vol. 7, 2022.
  • Bzdok, M. Krzywinski, and N. Altman, “Machine learning: supervised methods,” Nature Methods, vol. 15, pp. 5-6, 2018.
  • [Asmae El Mezouari, Aziz El Fazziki, Mohammed Sadgal, "Smart Irrigation System," IFAC-Paper Online, Vol. 55, Issue 10, pp. 3298-3303, 2022. https://doi.org/10.1016/j.ifacol.2022.10.125.
  • Sharma, D. (2022) Swamp: A high-precision smart irrigation system, Analytics Vidhya, Sept. 27, 2022, https://www.analyticsvidhya.com/blog/2022/09/swamp-a-high-precision-smart-irrigation-system/ (Accessed: April 22, 2023).
  • Ullah, R. et al. (2021) EEWMP: An IOT-based energy-efficient water management platform for smart irrigation, Scientific Programming. Hindawi,/ (Accessed: April 22, 2023).
  • Sarwar, I. S. Bajwa, N. Jamil, S. Ramzan, and N. Sarwar, “An intelligent fire warning application using IoT and an adaptive neuro-fuzzy inference system,” Sensors, vol. 19, no. 14, p. 3150, 2019.
  • Parameswaran and K. Sivaprasath, “Arduino-based smart drip irrigation system using internet of things,” International Journal of Engineering Science, vol. 6, p. 5518, 2016.
  • Saab, M. .erese, I. Jomaa, S. Skaf, S. Fahed, and M. Todorovic, “Assessment of a smartphone application for real-time irrigation scheduling in Mediterranean environments,” Water, vol. 11, p. 252, 2019.
  • Ouedraogo, Issa, Ndèye Seynabou Diouf, Gnalenba Ablouka, Robert B. Zougmoré, and Anthony Whitbread. 2021. "Utility and Triggers in Uptake of Agricultural Weather and Climate Information Services in Senegal, West Africa" Atmosphere 12, no. 11: 1515. https://doi.org/10.3390/atmos12111515.
  • Ramachandran, Veerachamy, Ramar Ramalakshmi, Balasubramanian Prabhu Kavin, Irshad Hussain, Abdulrazak H. Almaliki, Abdulrhman A. Almaliki, Ashraf Y. Elnaggar, and Enas E. Hussein. 2022. "Exploiting IoT and Its Enabled Technologies for Irrigation Needs in Agriculture," Water 14, no. 5: 719. https://doi.org/10.3390/w14050719.
  • Ishwar Prakash Sharma, Chandra Kanta, and Yogendra Singh Gusain, “Crop residues utilization: Wheat, paddy, cotton, sugarcane and groundnut,” International Journal of Botany Studies, Vol. 3; Issue 3, pp. 11-15, May 2018. DOI: https://www.researchgate.net/publication/325119691_Crop_residues_utilization_Wheat_paddy_cotton_sugarcane_and_groundnut [Accessed April 22, 2023].
  • Cardenas-Lailhacar, M. D. Dukes, and G. L. Miller, “Sensor-based automation of irrigation on Bermuda grass, during dry weather conditions,” Journal of Irrigation and Drainage Engineering, vol. 134, pp. 184–193, 2008.
  • Stubbs, Irrigation in US Agriculture: On-Farm Technologies and Best Management Practices, Congressional Research Service, Washington, DC, USA, 2016.
  • Cardenas-Lailhacar, M. D. Dukes, and G. L. Miller, “Sensor-based automation of irrigation on Bermuda grass, during dry weather conditions,” Journal of Irrigation and Drainage Engineering, vol. 134, pp. 184–193, 2008.
  • Safdar Munir, Imran Sarwar Bajwa, Amna Ashraf, Waheed Anwar, Rubina Rashid, "Intelligent and Smart Irrigation System Using Edge Computing and IoT", Complexity, vol. 2021, Article ID 6691571, 16 pages, 2021. https://doi.org/10.1155/2021/6691571.
  • Abioye, Emmanuel Abiodun, Oliver Hensel, Travis J. Esau, Olakunle Elijah, Mohamad Shukri Zainal Abidin, Ajibade Sylvester Ayobami, Omosun Yerima, and Abozar Nasirahmadi. 2022. "Precision Irrigation Management Using Machine Learning and Digital Farming Solutions" AgriEngineering4, no. 1: 70-103. https://doi.org/10.3390/agriengineering4010006.
  • Bwambale, E.; Abagale, F.K.; Anornu, G.K. Smart irrigation monitoring and control strategies for improving water use efficiency in precision agriculture: A review. Agric. Water Manag. 2022, 260, 107324.
  • El Mezouari, A.; El Fazziki, A.; Sadgal, M. Toward smart farming through Machine learning based automatic irrigation planning. In Smart Sensor Networks; Studies in Big Data 2022, 92; Singh, U., Abraham, A., Kaklauskas, A., Hong, T.P., Eds.; Springer: Cham, Switzerland, 2022.
  • Gaznayee, Heman Abdulkhaleq A., Sara H. Zaki, Ayad M. Fadhil Al-Quraishi, Payman Hussein Aliehsan, Kawa K. Hakzi, Hawar Abdulrzaq S. Razvanchy, Michel Riksen, and Karrar Mahdi. 2023. "Integrating Remote Sensing Techniques and Meteorological Data to Assess the Ideal Irrigation System Performance Scenarios for Improving Crop Productivity" Water 15, no. 8: 1605. https://doi.org/10.3390/w15081605.
  • Vallejo-Gómez, David, Marisol Osorio, and Carlos A. Hincapié. 2023. "Smart Irrigation Systems in Agriculture: A Systematic Review" Agronomy 13, no. 2: 342. https://doi.org/10.3390/agronomy13020342.
  • Youness Tace, Mohamed Tabaa, Sanaa Elfilali, Cherkaoui Leghris, Hassna Bensag, Eric Renault, Smart irrigation system based on IoT and machine learning, Energy Reports, Volume 8, Supplement 9, 2022, Pages 1025-1036, https://doi.org/10.1016/j.egyr.2022.07.088.
  • Rodrigo Togneri, Diego Felipe dos Santos, Glauber Camponogara, Hitoshi Nagano, Gilliard Custódio, Ronaldo Prati, Stênio Fernandes, Carlos Kamienski, “Soil moisture forecast for smart irrigation: The primetime for machine learning, Expert Systems with Applications,” Vol. 207, 2022. 2022,https://doi.org/ 10.1016/j.eswa.2022.117653.
  • H. Blasi, M. A. Abbadi, and R. Al-Huweimel, “Machine Learning Approach for an Automatic Irrigation System in Southern Jordan Valley”, Eng. Technol. Appl. Sci. Res., vol. 11, no. 1, pp. 6609–6613, Feb. 2021. https://doi.org/10.48084/etasr.3944.