Soil Moisture Predictive Analysis using IoT and Machine Learning

. The Internet of Things has been immensely popular these days, and so is the functionality and efficiency it provides. It is especially useful in areas where Human intervention and monitoring is not necessary or even absent. With that said, it can be understood that Farming without Human interference can be a hectic task, and thus needs strict and thorough planning and implementation before any system or product is actually in use. The thesis aims to examine and contribute to the efficient usage of several IoT Sensors for the betterment of Farming & Agriculture. The proposed IoT System utilizes Soil Moisture detection sensor, to find the moisture levels in soil, and hence applying various other use cases to the system. The project aims to use ESP-32 Dev Module and other soil moisture detection features to investigate and find an effective solution towards the future of Farming.


Introduction
IoT, abbreviated to "Internet of Things" (IoT), can be defined as the communication among different objects in a real-world scenario, which can be used for the implementation of Automated software. IoT is extremely useful in developing software that uses machine learning, Data mining, and other Computer science engineering techniques to implement the project for creating a product that adds some value to the existing world.

History
The idea of IoT was first formulated in the year 1960. It was ideated by a few programmers studying at Carnegie Mellon University. They wanted to develop software based on the problem they are facing and eventually wanted to find an innovative solution for the described problem, A Coca-Cola machine that uses the network communication among other peripheral devices that monitors features of the machine and therefore, they developed an Automated Coca-Cola vending machine that monitored the temperature of the cans, and tracked the number of cans available

Working principle
The system made use of IoT to decrease the temperature when the system identified an increase in temperature. IoT refers to a system of connected items -and deals with developing software that deals with performing automated tasks "which do not require human intervention." Few applications are as represented in the following section; 1) Healthcare 2) Smart City & Smart Homes 3) Pollution Control 4) Sales & Retail 5) Traffic Control 6) Waste management & Water Harvesting Its advantages are as follows; 1) Use of IOT saves time and resources 2) Efficient usage of the resources

Challenges and pitfalls
Developing an IOT system is a complicated project. This includes the risks of Virus attacks and system failures. In case of a system failure, and if the system is completely automated, it may well lead to problems like inability to use the system until the fault/error is recovered. The major drawback of IOT is that, in the near future, increase in IOT systems will lead to decrease in the need of HUMAN manpower, and decrease in need of human intelligence, means the problem of Unemployment [2].

Overview
Soil Moisture Measurement Field measurement of volumetric moisture content of soil necessitates the use of a quick, precise technology that permits ongoing readings. Currently, point measurements and remote sensing are the two methods used to measure the geographical distribution and temporal fluctuation of soil moisture content. The sections that follow examine these techniques.

Thermo-graphical method and scattering neutrons method
Currently, point measurements and remote sensing are the two methods used to measure the geographical distribution and temporal fluctuation of soil moisture content. The reader is now reminded that this section is a survey of the existing monitoring systems and related inference for soil water content, and not all of these approaches will be applied in the following chapters. An indirect method for figuring out the moisture content of soil is neutron scattering. With this technique, high energy neutrons are released into the soil by a radioactive source and are slowed down by elastic collisions with atom nuclei. In comparison to collisions with heavier atoms, the energy loss for neutrons with low atomic weight atoms (mainly hydrogen in soils) is significantly greater. The advantages of this method are its low cost and straightforward estimation of soil moisture. Due to its superior ability to slow fast neutrons compared to any other element in soil, hydrogen exhibits a link with soil moisture. A calibration graph of counts against volumetric moisture content was previously established, and the number of slow neutrons coming to the sensor per unit time is counted.

Method of soil electrical conductivity and the dielectric method
There are numerous methods that have been suggested for assessing soil electrical conductivity. The relative dielectric constant, abbreviated r, is a characteristic of materials that is often measured in relation to that of empty space. Soil's relative dielectric constant is a combination of its constituent parts. The moist soil's dielectric constant, like that of other mixes including water, is not just a weighted sum of its constituent parts. There are numerous affecting factors and the blending model is complicated.
The electrical conductivity probe's main benefits for determining soil moisture are its simplicity, ease of use, low equipment cost, and relatively big amount of soil sampled. The drawbacks include the inability to determine results beyond the 0 to 800 cm moisture tension range, the fact that they can only be breakable during installation, and the fact that they offer precise observations of soil water pressure but only oblique soil moisture content.
Tensiometers use a porous cup filled with liquid that is connected to a manometer by a continuous liquid column to detect the capillary tension (the force that holds water in the soil). This system's merits include its inexpensive cost and ability to measure both soil moisture tension and water table elevation. Due to the significant disparity between the relative dielectric properties of liquid water (about 80) and dry soil (2 to 5), measurements of the soil dielectric constant can be used to detect the amount of moisture in the soil. As a result, the dielectric material constant can rise to 20 or more as soil moisture content rises.

Soil moisture sensor
A soil moisture sensor is typically a low-cost electronic device that is used to detect moisture in a given soil sample. This sensor measures the volume of water present in the soil. The Soil Moisture sensor mainly consists of the following parts 1) Sensor Module: The Sensing probe ensures that the current passes through the soil and finds the resistance parameters corresponding to the soil moisture value. 2) Sensing probes: The Sensor module detects data from the sensor probes & processes the data to eventually convert the data into the required output form (e.g., Digital or Analogue).

OLED sensor
The screen of the Arduino Sensor Kit is made using the Organic Light-Emitting Diode, or just OLED. For light emission, the OLED makes use of an organic carbon-based substance. This substance emits light when it is exposed to electricity. The OLED emitter consists of several layers that are placed between an anode and a cathode layer, and it uses no backlight, which many other displays do. This means that each individual pixel needs to be turned on.

Firebase
A software called FirebaseArduino makes it easier for Arduino clients to connect to the Firebase database. It is a complete abstraction of Firebase's REST API that is made accessible using wiring-friendly C++ functions. The library handles all JSON parsing, so it can be worked with C/Arduino types. The main task at hand is currently setting up the Google Firebase Console server. Once everything is set up, Arduino ESP32 can be used to start sending sensor information to Google Firebase. The hardware is now set up, as well as Google Firebase. Consequently, let's get to the programming section. Upload the code to the Arduino ESP32 Board after copying it. The Arduino is connected to the Wi-Fi Network after uploading the code. Now that the serial monitor is open, soil moisture readings will be displayed [9].

Objective
To create a cost-effective model to track and manage a soil sample's moisture level to serve various weather conditions and to design an automated Smart Farming system, that uses a concept of Machine learning called predictive analysis to forecast weather for the future.

Implementation of modules
The IoT system mainly focuses on 4 different stages of implementation. The 4 modules are, namely 1) Sensor data collection: Data is collected from the Soil sample. 2) Data Processing: Collected data is processed to generate predictions and statistics.
3) Data Storage: Results obtained after processing the soil data are stored in Firebase. 4) Actuation: Water outflow is released based on Machine Learning predictions and summarized stats generated using soil data.

Connectivity diagram
Following Diagram depicts all the stages in a sequential Flow-Diagram.

Sensor data collection module
There are various levels at which soil data is gathered, including point data, map unit data, Pedon descriptions, interpretative data and spatial data. To develop soil maps and map unit descriptions, this data is compiled and structured. Land managers and environmentalists will be able to use a relevant and regular soil survey produced by the accumulation of relevant and accurate soils data to preserve our lands.

Types of data (a) Point data
The optimal location for collecting point information or Pedon descriptions is a soil pit. Typically, soil pits are five by six feet (1.5 to 2 m) in size, between sixty and eighty inches deep, and big enough for one or two individuals to safely describe the soil profile. Without a place, information is meaningless. Three kinds of the point data can be made, which are physical, chemical, and environment.

(b) Map unit data
Each demarcation on a soil survey is described in a map unit. It will outline the unit's placement within the landscape, the types of soils indicated by the mapping unit, their characteristics, and other resource details including ecological areas and land potential. In this manner, the documentation gathered will be written on the back of every field sheet, and each document will be associated with a particular field sheet.

(c)Spatial data
The information displayed on maps, such as data layers and unique features, is referred to as spatial data. Soil maps should, at the very least, show the soil differentiations and sufficient background features to enable the user to locate the regions of interest quickly. The survey sheets can be digitalized both during and following a soil survey.

(d) Interpretative Data
People who look after the land can provide interpretive data. Crop yield data and range production are two examples. Other interpretive statistics, such as water supply content or erosion factors, are estimations based on point data. This dataset, which is presented in tables, covers the development of building sites, sanitary facilities, building supplies, water management, soil features, and water features.

Data processing module
The progressive soil processing stage involves the streamlined procedures [10] listed below. 1) Gather all relevant information, such as topographical maps, geological maps, historical maps, data on precipitation and temperature, seasonal water, and, most importantly, high-quality aerial photography. 2) Get acquainted with the soil survey region, the Memorandum of Agreement and start mapping. 3) Construct map units, then add them to the developing legend. 4) Gather supporting evidence. a) Record finished transects, field observations, and Pedon description on fields sheets or geographic information and in a spreadsheet by the date and map unit number. b) Include documentation in the folder for the map unit; list the qualities in general. c) Establish a type of place. d) Full database entry forms. e) Uploading data. f) Create a detailed legend for the tables, soil maps, and developmental map units. g) Soil experts and other resource professionals test map units. 5) Prior to being included in the authorized legend, map units should be reviewed by production quality and assurance personnel. 6) Continue the process.

Sensor data storage module
In this project, ESP32 sensor is used to transmit real-time sensor information to Google Firebase. The DHT11 Sensor will be used to read the data before sending it to the Google Firebase Console Server. A software program called Google Firebase is used to create, manage, and alter data generated by any Android or iOS app, web services, Internet of Things sensors, and hardware. The data is transferred to Google Firebase when the soil moisture readings are presented simultaneously on Serial Monitor. Simply visit the Google Firebase console interface to view the data entering in real-time [10]. Figure 9 shows the Architecture of proposed Smart Farming System. In bare soil, the automatic watering system was put to the test at various soil moisture thresholds. For the purpose of system evaluation, two operational schedules were monitored. Three watering events were observed for each schedule when the field was barren. During each irrigation event, the gate was fully opened and closed when the threshold reached the pre-set value. The gate was appropriately opened and closed autonomously as soon as the pre-set amount of soil moisture was reached or exceeded throughout each irrigation event check.

Description about dataset
When soil water depletion approached or exceeded 40%, and 20% of field capacity, respectively, in the operation schedule, irrigation was initiated. In 30% and 20% of Field Capacity, respectively, the waterfront advancement time required to reach the moisture sensor was 4.9 and 5.6 minutes, and the cut-off time was 29 and 22 minutes. In 30 percent FC depletion, the maximum irrigation application efficiency, uniformity of distribution, and water consumption efficiency were noted at 93% and 99%, respectively. However, 30% soil moisture depletion in Schedule-1 was found to result in higher irrigation performance indicators, such as water application efficiency, distribution efficiency, and water requirement efficiency, than in Schedule-2. It suggests that surface irrigation performance was enhanced by the greater soil moisture deficit.

Evaluation of automatic check-gate
The durability, power, and cost-effectiveness of the automatic check gate, as well as how it opened and closed in response to a predetermined soil moisture state, were evaluated.

Power requirements
The equipment was quite energy-efficient because it needed minimal maintenance and had a reliable power source even on overcast days. The actuator, a DC water motor, required 2400 mA of power. The soil moisture sensor's voltage requirements ranged from 3.6 to 5.4 V. (5 mA). Different parts of the check gate switch needed at least 1 A and 5 V to work. Throughout the review time, there have been no power issues.
A home that can effectively connect its electronics and appliances through a connected wireless network is referred to as a "smart home." Monitoring the quantity of pollutants emitted into the environment from many sources, like automobiles, manufacturing industries, water pollution, etc., is yet another field where IoT can be extensively used. Another issue that has been more prevalent recently is increased traffic. Optimal Waste Disposal is currently another pollution restriction. Neutron scattering is an indirect technique for determining overall moisture content of soil. As a result, the sensor needs to be calibrated for each kind of soil if an accurate estimation of water content is desired. However, calibrating the neutron probe field is a very difficult task. The gamma ray absorption method is used to measure changes in wet density, and the density change is used to compute the soil moisture content. The advantages of this technology are its non-destructive nature and its ability to collect data across incredibly brief vertical distances. Its disadvantages include the cost and difficulty of usage, as well as the requirement for extra vigilance to ensure that the gamma radiation does not provide a health danger. Gamma radiation detectors are typically only used in laboratory settings due to the large equipment. This research concludes by saying that the Internet of Things is the connection between many items in a real-world setting that can be utilized to develop automated software. The creation of an IoT system is an extremely difficult undertaking. A rise in IoT systems will result in a decline in the demand for Human labour and human intelligence. Hence, IoT is a system that many other collaborating systems can use and will be regarded as one of the most innovative ideas ever put forth by science…