Agricultural Crop Recommendation System Using IoT and M.L.

: Agriculture is the backbone for a developing economy like India and there is an enormous need to maintain the agricultural sustainability. Hence it is a significant contribution towards the economic and agricultural welfare of the countries across the world. Effective utilization of agricultural land is crucial for ensuring food safety and security of a country. The aim of this paper is to propose an IoT and ML based Agriculture system that can assist farmers or agriculturist in crop prediction based on Metrological Agriculture theory by getting live Metrological data from the crop field using IoT technology and M.L for prediction which will enable smart farming and increase their overall yield and quality of products.


I. INTRODUCTION
The development of Intelligent Smart Farming devices based on Internet of things and Artificial Intelligence is day by day turning the face of agriculture production by not only enhancing it but also making it cost-effective and reducing wastage. Agriculture and the food system had undergone a structural transformation in recent years, manifested by price hikes and driven by income and population growth, migration and urbanization, as well as speculation. There is no doubt that the world needs to invest in agriculture. As the world is trending into new technologies and implementations it is a necessary goal to trend up in agriculture also. The World Bank says we'll need to produce 50% more food by 2050 if the global population continues to rise at its current pace [1] . But the effects of climate change could see crop yields falling by more than a quarter. The implementation of smart technology in agriculture practices needs to be focused on for better land productivity. Such studies are conducted in natural outdoor environmental conditions and locations where crops are growing, by varying metrological and physical conditions. Internet of Things (IoT) and A.I technologies combinedly can lower the cost and increase the scale of such studies via the collection of related time series data from sensor networks and labs observations recorded by testing them chemically. The Agriculture system proposed in this paper is an integration of the concepts of Machine learning and IOT using IoT boards and various sensors, through which live data feed can be obtained and processed.

Agricultural Meteorology
Agricultural Meteorology [2] is a branch of applied meteorology which investigates the physical conditions of the environment of growing plant organisms and deals with the relationship between weather/climatic conditions and agricultural production. A science concerned with the application of meteorology to the measurement and analysis of the physical environment in agricultural systems. The word 'Agro Meteorology' is the abbreviated form of agricultural meteorology which is a study of interaction between meteorological and hydrological factors on the one hand and agriculture in the widest sense.

Meteorological Factors affecting Crop Production
Meteorological factors play a vital role in Crop Production. Nearly 50 % of yield is attributed to the influence of climatic/Meteorological factors. The following are the major atmospheric weather variables which influences the crop production.

Precipitation
Precipitation includes all water which falls from atmosphere such as rainfall, snow, dew etc. Rainfall one of the most important factor influences the vegetation of a place. Total precipitation in amount and distribution greatly affects the choice of a cultivated species in a place. In heavy and evenly distributed rainfall areas, crops like rice in plains and tea, coffee and rubber in Western Ghats are grown. Low and uneven distribution of rainfall is common in dry land farming where drought resistance crops like pearl millet, sorghum and minor millets are grown. In desert areas grasses and shrubs are common where hot desert climate exists Though the rainfall has major influence on yield of crops, yields are not always directly proportional to the amount of Precipitation as excess above optimum reduces the yields Distribution of rainfall is more important than total rainfall to have longer growing period especially in dry lands. Many Farmers in the developing countries like India depend on the annual rainfall for Irrigation Purpose.

Temperature
Temperature is a measure of intensity of heat energy. The range of temperature for maximum growth of most of the agricultural plants is between 15 and 40ºC. The temperature of a place is largely determined by its distance from the equator (latitude) and altitude. It influences distribution of crop plants and vegetation. Germination, growth and development of crops are highly influenced by temperature. Affects leaf production, expansion and flowering. Physical and chemical processes within the plants are governed by air temperature. Diffusion rates of gases and liquids changes with temperature. Solubility of different substances in plant is dependent on temperature. The minimum, maximum (above which crop growth ceases) and optimum temperature of individual's plant is called as cardinal temperature. Some of the sample data is shown in Table-

Relative Humidity
Water is present in the atmosphere in the form of invisible water vapour, normally known as humidity. Relative humidity is ratio between the amount of moisture present in the air to the saturation capacity of the air at a particular temperature. If relative humidity is 100% it means that the entire space is filled with water and there is no soil evaporation and plant transpiration. Relative humidity influences the water requirement of crops. Relative humidity of 40-60% is suitable for most of the crop plants. Very few crops can perform well when relative humidity is 80% and above. When relative humidity is high there is chance for the outbreak of pest and disease.

Solar Light Intensity
From germination to harvest and even post-harvest crops are affected by solar radiation. Biomass production by photosynthetic processes requires light. All physical process taking place in the soil, plant and environment are dependent on light. Solar radiation controls distribution of temperature and there by distribution of crops in a region. Visible radiation is very important in photosynthetic mechanism of plants. Photosynthetically Active Radiation (PAR -0.4 -0.7μ) is essential for production of carbohydrates and ultimately biomass. Some of the Edaphic factors considered for the proposal are: 1. Soil moisture 2. Soil mineral matter 3. Soil organic matter 4. Soil pH Water is a principal constituent of growing plant which it extracts from soil. Water is essential for photosynthesis. The moisture range between field capacity and permanent wilting point is available to plants. Available moisture will be more in clay soil than sandy soil. Soil water helps in chemical and biological activities of soil including mineralization. It influences the soil environment e.g. it moderates the soil temperature from extremes. Nutrient availability and mobility increase with increase in soil moisture content.

Soil Mineral and Organic Matter
The mineral content of soil is derived from the weathering of rocks and minerals as particles of different sizes. These are the sources of plant nutrients E.g.: Ca, Mg, S, Mn, Fe, K etc It supplies all the major, minor and micro nutrients to crops. It improves the texture of the soil. It increases the water holding capacity of the soil, it is a source of food for most microorganisms. Organic acids released during decomposition of organic matter enables mineralisation process thus releasing unavailable plant nutrients. The chemical analysis of soils and is well recognized as a scientific means for quick characterization of the fertility status of soils and predicting the nutrient requirement of crops. Although plants absorb a large number of elements, all of them are not essential for the growth of crops. The elements are absorbed became they happen to be in the soil solution and those taking active part in the growth and developmental processes are called the essential ones. Some of these are required in large amounts and some in traces.

Soil pH Concentration (/Soil Reaction)
Soil reaction is the pH (hydrogen ion concentration) of the soil. Soil pH affects crop growth and neutral soils with pH 7.0 are best for growth of most of the crops. Soils may be acidic (<7.0), neutral (=7.0), saline and alkaline (>7.0). Soils with low pH is injurious to plants due high toxicity of Fe and Al. Low pH also interferes with availability of other plant nutrients. Soils formed under low rainfall conditions tend to be basic with soil pH readings around 7.0.
Intensive farming over a number of years with nitrogen fertilizers or manures can result in soil acidification. For example, which have soil pH of 5.0 and below, aluminum toxicity in wheat and good response to liming have been documented in recent years. [3] and Machine Learning. Principles of Agronomy and Agricultural Meteorology are the key concepts which are implemented for the prediction of the favourable crop. Currently for this proposal the Meteorological data of Bidar, Karnataka is taken into consideration. Many Sensors are involved for collecting various Meteorological and Edaphic Factors data. The following are the Hardware and Software requirements involved for the execution of the concept. Climate changes and rainfall has been erratic over the past decade. Due to this in recent era, climate-smart methods called as smart agriculture is adopted by many Indian farmers. Smart agriculture is an automated and directed information technology implemented with the IOT (Internet of Things). IOT is developing rapidly and widely applied in all wireless environments [3] .

III. SYSTEM DESIGN
The System is designed with various smart technologies. IoT for Sensors Sensing, M.L for Prediction Purpose, Web Technologies for Front End U.I design and Database Design are involved for this conceptual design. This system collects the sensor data for over a period of an Agri-Season (Min. 6 Months)

Flow of Events
The flow can be divided into multiple major sections as shown in the Figure 1  Objective: Training the model for prediction [5]  Model to be trained using the dataset of past results based on metrological parameters  Optimizing the Model for more accurate results  Synchronizing with the inputs received from the Front end.  Python along with SciKit Learn, Pandas libraries are used.
3.3 Machine Learning Algorithm and Dataset 3.3.1 Algorithm: Decision Tree Algorithm Decision tree Algorithm plays a vital role in prediction by making decisions at every level in the binary tree. Decision tree can be used to visually and explicitly represent decisions and decision making. It uses a tree-like model of decisions. Though a commonly used tool in data mining for deriving a strategy to reach a particular goal, it's also widely used in machine learning. The Basic Decision tree learning algorithm: Currently the model is trained for three major crops widely grown in the regions of Bidar District. i.e. Toor Dal, Sugarcane, Soya bean. The Dataset was extracted from the Farmers Soil Health card [4] which was issued during a season period Metrological Data for over a period of time is used from the worldweatheronline.com portal for training purpose.

UML Diagram
In Diagram-1, we can see the flow of data between different technological modules. Figure 2 Shows the proposed flow of execution of events starting from info gathering to the  Firstly, the Arduino UNO R3 connected with various Analogue sensors sends the sensor data to the ESP8266(NodeMCU) Module.  ESP8266 along with other digitals parameters data and the data received from the Arduino board sends an HTTP POST Request to the Apache server to store the sensor data on to the MySQL Database [6]  This Process of data insertion on to the database is done repeatedly for over a period of time/Seasons.  Then this data from the database along with the other lab tested parameters is sent to the M.L Model for the Prediction  The Predicted output is displayed on the Web portal which can be accessed from the Internet. The ESP8266, Apache Server, Flask Framework WSGI Server and MySQL Server are configured with I.P address and Ports. All these devices are brought under a common platform. i.e. Local LAN Network. For every 30 seconds time interval a POST/GET request is sent from the ESP8266 to the Apache Server where the PHP code written for the database insertion of this sensor data is executed.

IV. SYSTEM IMPLEMENTATION
www.ijarsct.co.in    Figure 5, The Optimized sensor collected data from the database is displayed. Along with these, the Lab-Tested data is entered manually at the Front end.