Smart Agriculture Monitoring System using Clean Energy

—Internet of Things (IoT) technology makes all areas of human life more comfortable. The development of farms through the use of IoT positively influences agricultural production not only by strengthening it, but also by making it more profitable and reducing the cost of production. The goal of this paper is to offer a new IoT-based smart agriculture system that helps farmers get real-time data such as (temperature, humidity, soil moisture) for effective environmental monitoring that will allow them to increase overall yield and product quality. The farm monitoring system proposed in this paper is based on the ESP32 microcontroller with a set of sensors. This new model produces a real-time data feed that can be viewed online via a mobile app. The proposed new system uses solar energy with battery as an energy source.


I. INTRODUCTION
Agriculture has always played a very important role for the human being and for the economies of countries, indeed countries that have experienced significant economic growth have experienced a significant increase in the agricultural sector, agriculture is not only an important factor of economic growth but also a heritage, a way of life, a cultural identity of a country. The use of the Internet of Things in agriculture makes it possible to put technology at the service of the development of agriculture and also to help the farmer to:  Make very important decisions at the right times.
 Save energy and time.
 Deal with the lack of information.
 Increase agricultural production.
 Allow the farmer to develop and develop his agricultural production.
 Increase the participation of agriculture in job creation.
 Ensure our country's needs for agricultural products.
The organization of the article is as follows, in Section II (Literature Survey): we collected the work carried out in the field of smart agriculture, Section III (discussions and results): we treated and analyzed the work done and proposed improvements in this area, Section IV (the new model): we proposed our new intelligent farm system, and Section V (Conclusion and outlook).

II. LITERATURE SURVEY
To study the use of IOT in the agricultural field, it is essential to make a literary study on the current state, projects and studies that have been carried out in this field, this step is important to be able to have visibility on the current state and on the difficulties encountered, it will allow us to make proposals for improvement in this area.

A. Data Collection
To carry out our literary study we focused our research work on three databases ACM Library, Science Direct and IEEE. The Pattern used is IOT and agriculture during the last four years (2018-2022) this has allowed us to have 29 publications on the different methods and procedures of use of the IOT in the agricultural field as well as the advantages, disadvantages, and prospects for improvement in this field, Table I below summarizes the research approach.

B. Data Processing
The processing and analysis of the work carried out in this area will allow us to compare the following attributes: data collected, technologies used, challenges of the current approach. Table II shows this comparison. During our analysis, we excluded the number of sensors, the amount of data collected, the underlying technologies, the topology of the sensors and other intermediate gateways were not included as this does not add value to our research work.

A. Data Analysis
The analysis of the data gave us the opportunity to have quantitative and qualitative data on the use of IOT in the agricultural field, our analysis focuses on the agricultural field and the types of data collected, the technologies used and the areas of application. The objective of this analysis is to increase productivity and efficiency while saving natural and human resources in the agricultural sector.

B. Agricultural Domains
We have grouped the articles and classified them by agricultural field, as shown in Table III below. This ranking gave us four agricultural sub-domains, following the results obtained we deduced that smart irrigation is the most treated agricultural field with a percentage of 40%.

C. Data Collected
Data collection is part of the objectives of the IOT, so it is necessary to collect a large amount of data to give accurate results, to follow up on our analysis it was deduced that many articles are focused on temperature (31%) and soil moisture (28%), and humidity (25%). Other data were also collected but with a small percentage. Table IV shows the results.

D. Technologies used
The grouping of technologies used in the articles covered tells us that cloud technology is identified as the most used technology (23%), followed by Arduino and Mobile technologies (16%). Followed by WIFI (15%), followed by Nodmcu (12%) and followed by Raspeberry (11%) other technologies were also used but with a small percentage.

E. Results
In this paper, we were able to study the use of IOT in the agricultural field, this allowed us to identify important attributes to analyze it, for this we gathered and analyzed recent scientific data, this survey was a way to have the list of the most studied sub-areas: Smart irrigation, Agriculture Monitoring, Smart farming, Greenhouse Agriculture.
Smart irrigation is the most studied agricultural sub-field in recent years, as most countries focus mainly on the use of water resources due to its lack. Smart irrigation has become an essential means that positively influence the agricultural field and its production, current efforts focus on the management of water resources this has given great value to irrigation management to increase the quality and quantity of agricultural products.
The second sub-area is forecast agriculture because the demand for products is constantly increasing so it is essential to opt for a forward-looking management of agricultural production. This makes it possible to review any risk that can block the objectives of farmers and makes it possible to ensure a quality and increase in agricultural production and also saves resources. Based on our analysis, it was found that ambient temperature followed by soil moisture and moisture are among the most commonly measured data. According to the results of our study, it was found that the use of the Internet of Things in agriculture can be used effectively to increase agricultural production to meet the growing needs of the population.
The majority of research focuses on water management by monitoring environmental parameters such as temperature, humidity and soil moisture. Many results have emphasized the importance of the proper management of water resources, saving human and material resources.
Innovation in the IT field makes it possible to cover all agricultural areas to allow an important development. IoT has solved many problems related to agriculture and farming, but several limitations are to be taken into consideration such as the lack of interoperability and compatibility of devices, the problems of network flexibility when several devices connect, and the lifetime of the sensor are some of the limitations to be solved in future research.
Food production is a great challenge for all economies around the world due to the rapid and constant evolution of the world's population, especially with climate change and labour shortages. Currently, current research focuses on robotics to solve these problems. Many researchers and companies have focused on robotics and artificial intelligence (AI) to reduce the amount of herbicide used by farmers.
Following the analysis of the data collected, it was found that the IOT is in great demand to develop the agricultural field, several researches have been carried out in relation to this subject, the articles that we studied in this report have not taken into consideration the sources of energy to power the IOT equipment and the security of agricultural fields against intrusions, thus the majority of articles use Arduino technology for the interconnection of IOT equipment, which is why we will propose a new model that will take into account the energy source, uses an interconnection technology with low energy consumption and secures agricultural fields against intrusions.

A. Solution
After the in-depth study of the work done in this area, we found that agriculture is one of the main areas that use IoT. Several IoT components have already been put in place to serve the agricultural field to monitor soil conditions such as temperature, moisture, soil moisture and soil ph.
We also found that most authors propose solutions provided by wires or batteries such as power sources, the things that make powering objects a real challenge for several reasons, the most important of which are:  The area of agricultural land is large, which increases the cost of installing electrical cables. The installed cables remain subject to damage that can be caused by agricultural vehicles, insects, and water, as the cables are underground.
 The difficulties of maintenance and repair in case of failure because the cables are underground it is necessary at each failure to remove them to repair them.
 Battery life remains limited and varies from a few hours to several years.
 The power of objects by alkaline batteries has major disadvantages. These batteries have a limited amount of energy.
 The cost of purchasing and replacing the batteries of the objects.
We offer a solution that offers an improvement of existing solutions. Our model is highly customizable and provides a data analysis solution that enables large-scale data processing on real-time observation streams. Our new model uses solar energy with battery as a power source, the ESP32 microcontroller as a low-energy interconnection technology [30] and a motion detector to protect our agricultural field from intrusions.

1) Ph: Sensor:
The PH sensor is a sensor that allows determining the acidity of the soil between 0 and 14 at a temperature between 0 and 60 ° C, this acidity varies depending on the availability of nutrients in water / soil. The detection of PH is therefore essential to understand how to fertilize it properly in order to prepare a good environment for agricultural production. Fig. 1 shows the ph sensor.
2) Temperature and humidity sensor: The DHT11 sensor is a low-cost basic digital temperature and humidity sensor. Capable of measuring temperatures from 0 to 50°C with an accuracy of 2°C and relative humidity levels from 20 to 80% with an accuracy of 5%. A measurement can be made every second. Fig. 2 shows the DHT11 sensor. www.ijacsa.thesai.org

3) PIR Sensor:
The passive infrared sensor is used for intrusion detection in agricultural fields and helps farmers detect movements (of animals and humans) in their agricultural fields. Fig. 3 shows the PIR sensor.

4) Soil Moisture Sensor:
This sensor, as shown in Fig. 4, measures soil moisture due to changes in the electrical conductivity of the earth (soil resistance increases with drought). A digital output with an adjustable threshold is used to trigger an alarm or sprinkler pump. A second analog output accurately tracks fluctuations in soil moisture. When the sensor fork is planted vertically in the ground (agricultural fields, garden, etc.). The electrical resistance between the two electrodes is measured.   Fig. 6, are the devices used to absorb the sun's rays and convert them into electricity. In our case we will use solar panels to power our IoT devices.

7) Lithium Batteries:
In our case we will use the lithium battery illustrated in Fig. 7, to have the possibility of setting up an autonomous network equipped with a battery capable of storing energy during the day and provides electricity during the night.

C. System Description
To achieve a high-quality yield, we will build a new smart farm monitoring system powered by solar energy. The proposed solution consists of two parts, a hardware part and a logicielle.la hardware part consists of a transmitter node that contains the pH, soil moisture, temperature, humidity, and motion sensor connected to ESP32 and a solar panel and battery to supply our system with electrical energy. The software part consists of a mobile application that allows farmers to monitor their agricultural environment as long as it www.ijacsa.thesai.org is connected to the internet. The method of data acquisition is illustrated in Fig. 9. The pH, soil moisture, temperature, humidity, and motion sensors send digital data to the ESP32. This data will be transmitted to the cloud server via WIFI communication. When there is incoming data on the cloud server, farmers can monitor their farming environment via a mobile app.

D. Tools and Libraries used
In this paper we used several software and libraries to implement our new farm monitoring system: 1) Arduino: The Arduino integrated development environment is a cross-platform application for Windows, Macos, and Linux that is written in C and C++ functions. It is used to write and download programs to Arduino-compatible boards. The EDI source code is released under the GNU General Public License, version 2. The IDE environment contains mainly two basic parts: the editor and the compiler where the old one is used to write the required code and later is used to compile and download the code in the given Arduino module.
2) Libraries: The Arduino IDE can be extended using libraries, just like most programming platforms. Libraries offer additional features, such as working with hardware or manipulating data. The standard libraries used are described below.
a) DHT.h: To read the data from the DHT sensor, we will use Adafruit's DHT.h library. To use this library, we must also install the Adafruit Unified Sensor library. b) WiFi.h: This library allows our esp32 card to connect to the Wi-Fi network to start sending and receiving data.

3) Algorithms and flowchart:
This section presents the algorithms and flowchart of the overall process of our new Smart Farm System: a) Algorithms: Generic process algorithm for temperature, humidity, soil moisture and pH sensors. STEP 1: start the process; STEP 2: connected to wifi; STEP 3: read temperature, humidity, soil and ph; STEP 4: get temperature, humidity, soil and ph values from analog pins; STEP 5: send data to cloud; STEP 6: delay to 10 seconds;

E. Mobile Application
In creating our app, we used the blynk platform that supports Android. It works with several types of microcontrollers such as Arduino, Raspberry and ESP32. It consists of three main components:  The blynk app that allows you to control a device and view data.
 The blynk server, which is a cloud service responsible for all communications between objects and the smartphone.
 Blynk libraries, which include various widgets such as control buttons, display formats, and notifications.
When creating our application, as shown in Fig. 11, we tried to make it very simple, with a single interface that shows the main information collected by our ESP32. This application immediately requests real-time information from the cloud to display it. www.ijacsa.thesai.org

F. System Test
We tested the consumption of the solar power of our new model for seven days. Using the display screen of our new model shown in Fig. 12, we noticed that with the equipment used for four days, the consumption of our battery does not exceed 26%.

V. CONCLUSION AND PERSPECTIVES
In this article, a new smart farm monitoring model was realized. To propose this model, we started by studying the work already done in the field of smart agriculture, the analysis of the data allowed us to raise three major questions: The energy sources to power the equipment, the technologies used to interconnect these objects and the security of agricultural fields against intrusions. The tests we carried out for our new agricultural field monitoring system were positive, using new devices and sensors for example (PIR sensor).
The prospects of our project are to test our new model in a large agricultural field to study the autonomy of the batteries connected to the solar panels and propose improvements to our new system.