Ijraset Journal For Research in Applied Science and Engineering Technology
Authors: Bhoomika Ramesh Naik, Bhuvan R, Kammachi Puttaswamy Vindhya, Karegowdra Divya, Abhijith N
DOI Link: https://doi.org/10.22214/ijraset.2023.52569
Certificate: View Certificate
It is difficult for farmer to choose the right crops based on the soil nutrients like Nitrogen, Phosphorus, Potassium, and other contents in the soil. The process of manually testing the soil takes several weeks to arrive back from the lab and even after the soil sampling, the right crop is not predicted only the nutrients present in them are reported which is a time-consuming process. To overcome this problem, we propose this system of crop prediction using machine learning which contains sensors that can predict the Nitrogen(N), Phosphorus(P), Potassium(K), pH, temperature, Humidity and other contents in the soil and transmit time - stamped live data to the python and use machine learning algorithms to analyse the data and predict the fertilizers and crops suitable for the area to increase the quality and yield of the crop.
I. INTRODUCTION
Agriculture plays an important role in food industry which accounts 18% of India’s GDP and it is the backbone of our country. Production of food grains in India is estimated to be 292 million tons, as per Indian Council for Agricultural Research (ICAR) estimations the demand would increase to 346 million tons by the end of this decade. Increase in population should not lead to food crisis. India having wide range of weather conditions and different types of soil which is used for growing various types of crops the average productivity of many crops are low. Low yield in agriculture sector is one of the biggest problems in India. Poor infrastructure, wrong use of farm techniques decreases the fertility of the soil due to the use of pesticides and fertilizers. Soil analysis is an important process to determine the available nutrients for the plants in the soil, plants absorb these major nutrients of the soil for their growth. The process of manually testing the soil takes several weeks to arrive back from lab and even after the soil sampling, the right crop is not predicted. It is difficult for farmer to choose the correct crops based on the soil nutrients like Nitrogen, Phosphorus, Potassium and other contents in the soil. Our aim is to create a prediction engine for most suitable crops for a particular soil and also suggest the fertilizer which consists the minerals required for a specific crop.
II. THEORETICAL BACKGROUND
A. Decision Tree Algorithm
Decision Tree is a Supervised learning technique that can be used for both classification and Regression problems, but mostly it is preferred for solving Classification problems. It is a treestructured classifier, where internal nodes represent the features of a dataset, branches represent the decision rules and each leaf node represents the outcome. In a Decision tree, there are two nodes, which are the Decision Node and Leaf Node. Decision nodes are used to make any decision and have multiple branches, whereas Leaf nodes are the output of those decisions and do not contain any further branches. The decisions or the test are performed on the basis of features of the given dataset. It is a graphical representation for getting all the possible solutions to a problem/decision based on given conditions. It is called a decision tree because, similar to a tree, it starts with the root node, which expands on further branches and constructs a tree-like structure. In order to build a tree, we use the CART algorithm, which stands for Classification and Regression Tree algorithm. A decision tree simply asks a question, and based on the answer (Yes/No), it further split the tree into subtrees. Below diagram explains the general structure of a decision tree: There are various algorithms in Machine learning, so Decision Tree choosing the best algorithm for the given dataset and problem is the main point to remember while creating a machine learning model.
Below are the two reasons for using the Decision tree:
B. Working of Decision tree Algorithm
In a decision tree, for predicting the class of the given dataset, the algorithm starts from the root node of the tree. This algorithm compares the values of root attribute with the record (real dataset) attribute and, based on the comparison, follows the branch and jumps to the next node.For the next node, the algorithm again compares the attribute value with the other subnodes and move further. It continues the process until it reaches the leaf node of the tree.
C. Crop Prediction
Soil parameters and environmental conditions are given as input and the predicted crop as output.
III. DESIGNANDIMPLEMENTATION
A. Circuit Implementation
Soil analysis is an important process to predict a crop which is best suitable for cultivation to analyze the soil quality and nutrients in the soil this proposed system uses PH ,Moisture and NPK sensor to predict moisture, temperature ,PH, nitrogen, phosphorous, potassium and other nutrient values present in the soil using an ESP -32 the time -stamped live data sensed by the sensor is sent to the ESP-32 microcontroller which helps in the serial transmission of the data it is further sent to python IDLE used for predicting the crop. The decision algorithm is used to predict the crop which is best suitable for cultivation. The output is displayed using webpage.The system design consists of three sensors named as pH,moisture and temperature sensor and also consists of ESP32 microcontroller.The ESP32 module consists of wifi module which helps us to connect with the real time database and it has more number of analog pins to connect with the three sensors.
B. Circuit Description
The sensors are successfully made to detect the amount of temperature, moisture, humidity,ph of the soil.Hence, the sensors are very beneficial for the farmers as they can select the appropriate crop to improve the amount of components that are not up to the mark in the soil and the sensors also reduce the excess use of fertilizers. By using some algorithms we can also detect the best crop to be cultivated according to the soil analysis. all these live data stored in the cloud where we had used firebase to store the live data and also the autentication of the firebase has been recorded. Testing data had been collected in firebase .The trained data is stored in spreadsheet.
C. Flowchart
The input is taken fron the realtime data base and loads to the data set. The data from the spread sheet called trained data.That Trained data will be compared with the Tested data collected from the real time data base . After comparing using decision tree machine learning algorithm the output will be given as the best crop that will be suitable for the cultuvation to that soil will be displayed. Soil analysis is an important process to predict a crop which is best suitable for cultivation to analyze the soil quality and nutrients in the soil this proposed system uses PH ,Moisture and NPK sensor to predict moisture, temperature ,PH, nitrogen, phosphorous, potassium and other nutrient values present in the soil using an ESP -32 the time -stamped live data sensed by the sensor is sent to the ESP-32 microcontroller which helps in the serial transmission of the data.The live tested data stored in the firebase and trained data stored in the spreedsheet it is a convenient and effcient way to manage and access data .It is further sent to python IDLE used for predicting the crop. The decision algorithm is used to predict the crop which is best suitable for cultivation.compare the two data that is trained data and test
data using decision tree algorithm .Farmers can use this algorithms to predict crop yields based on various factors such as weather patterns, soil quality, and irrigation practices. After using decision tree machine algorithm the output will be given as the best crop that will be suitable for the caltuvation to that soil .This information can help farmers make informed decisions about planting and harvesting. The use of decision tree algorithm for crop yield prediction has the potential to revolutionize in the agriculture field and improving food security. The output is displayed using webpage.
IV. RESULTS AND DISCUSSION
A. Spreadsheet
A spreadsheet is a computer application for computation, organization, analysis and storage of data in tabular form. Spreadsheets were developed as computerized analogs of paper accounting worksheets. The program operates on data entered in cells of a table. Each cell may contain either numeric or the results of formulas that automatically calculate and display a value based on the contents of other cells. Spreadsheet users can adjust any stored value and observe the effects on calculated values. This makes the spreadsheet useful for "what-if" analysis since many cases can be rapidly investigated without manual recalculation. Modern spreadsheet software can have multiple interacting sheets and can display data either as text and numerals.
B. Tested Data
Sensor-based testing is a popular method for collecting data on various environmental factors that can affect crop growth and productivity. The most common types of sensors used in agriculture are those that measure NPK, pH, moisture, temperature, and humidity values. NPK sensors measure the levels of nitrogen, phosphorus, and potassium in the soil. These nutrients are essential for plant growth and development, and their levels can impact crop yield and quality. By measuring NPK levels, farmers can adjust their fertilizer application rates to ensure that their crops receive the nutrients they need to grow. pH: pH sensors measure the acidity or alkalinity of the soil. Different crops thrive in different pH ranges, so it’s important to know the pH level of your soil to select the right crops and adjust the pH if necessary. Soil pH can also affect nutrient availability, so measuring pH can help farmers optimize their fertilizer use. Moisture: Moisture sensors measure the amount of water in the soil. Water is essential for plant growth, but too much or too little water can be harmful. By measuring soil moisture levels, farmers can adjust their irrigation schedules to ensure that their crops receive the right amount of water. Temperature sensors measure the air and soil temperature. Humidity sensors measure the amount of moisture in the air.
C. Crop Prediction
Crop yield prediction is an important aspect of agriculture that helps farmers make informed decisions about their crops. It involves estimating the number of crops that will be produced in a given area based on various factors such as soil type, weather conditions, and crop management practices. In recent years, machine learning (ML) has emerged as a powerful tool for predicting crop yields.Crop dataset is given as input, and the set of data imported. The feature selection technique is applied on the preprocessed data to select the most important attributes from the dataset to create a reduced dataset. First, 70% of the samples from the reduced dataset are taken as training samples. The classification algorithm is trained with the entire training dataset to predict a suitable crop. 30% of the samples from the reduced dataset as testing samples.The trained classifier is applied to the testing samples to predict the most suitable crop for cultivation in a particular piece of land.Finally, a suitable crop for cultivation is recommended by the results.The predicted crop is showed in the webpage.It written in the html code which shows the predicted output in webpage.
In this project, we have proposed a smart idea for agriculture using sensors and machine learning. The proposed system helps in finding the nutrients present in the tested soil using different sensors. The collected information is then used for analysis of the soil and predicting the crop. The Temperature, Moisture, pH sensors are inserted into the soil to be tested. The outputs of these sensors are stored in the firebase. Using the amount of Nitrogen(N), Phosphorus(P), Potassium(K), pH, temperature, Humidity and other contents present in the soil and historical data in the database of spreadsheet, crop is predicted using machine learning algorithms. This system makes the farmer’s work easier and will increase the yield and quality of yield grown by them.
[1] S. M. Pande, P. K. Ramesh, A. ANMOL, B. Aishwarya, K. ROHILLA, and K. SHAURYA, “Crop recommender system using machine learning approach,” in 2021 5th International Conference on Computing Methodologies and Communication (ICCMC). IEEE, 2021, pp. 1066–1071. [2] “Crop Prediction using Machine Learning” M.Kalimuthu , P.Vaishnavi , M.Kishore ,2020 3rd international conference on smart system and innovative technology. [3] “Detection of Nitrogen, Phosphorus, and Potassium (NPK) nutrients of soil using Optical Transducer” Marianah Masrie , Mohamad Syamim Aizuddin Rosman, Rosidah Sam and Zuriati Janin. Proc. of the 4th IEEE International Conference on Smart Instrumentation, Measurement and Applications (ICSIMA) 28-30 November 2017, Putrajaya, Malaysia. [4] “Crop Yield Prediction using Machine Learning Algorithm” D.Jayanarayana Reddy, Dr M. Rudra Kumar Proceedings of the 5th International Conference on Intelligent Computing and Control Systems (ICICCS 2021) IEEE Xplore. [5] “ An Ensemble Algorithm for Crop Yield Prediction” Mummaleti Keerthana, K J M Meghana ,Siginamsetty Pravallika, Dr. Modepalli Kavitha, Proceedings of the 3rd International Conference on Intelligent Communication Technologies and Virtual Mobile Networks (ICICV 2021). IEEE Xplore.
Copyright © 2023 Bhoomika Ramesh Naik, Bhuvan R, Kammachi Puttaswamy Vindhya, Karegowdra Divya, Abhijith N. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
Paper Id : IJRASET52569
Publish Date : 2023-05-19
ISSN : 2321-9653
Publisher Name : IJRASET
DOI Link : Click Here