Design of Farmer Assistance System Through IoT/ML

. Agriculture is a crucial profitable motorist. It is the main basis for the entire human life. Life cannot be imagined without agriculture. It is a source of livelihood. Everyone should pay attention to agriculture in the society. Agriculture plays an important role in improving the economy. With the rise in worldwide population farmers are facing problems in increasing the production of crops by choosing unsuitable crop for there field without knowing the field status. For increasing growth of crops IoT-smart agriculture improves the entire farming husbandry system by covering the field characteristics and weather conditions like soil moisture, temperature, humidity,electric conductivity etc. For getting more accurate results we need to train the dataset by taking the IoT results as an input and stored in the thing speak. But for analyzing the cloud data ML algorithms are required for tested data can help in choosing of a better crop. Based on these three algorithms such as random forest, Decision tree, KNN the better accuracy algorithm is choosen from percentage comparision of algorithms then the prediction of field status is acquired and makes the farmers to estimate their harvests, plan logistics and make decisions based on it. These proposed system can estimate the field characteristics to the farmers whether it is good or bad.


Introduction
Agriculture makes a important role in the frugality of India.An overall reliance of homes is 70 percent.[1] Farming is an important sector of the Indian frugality as it contributes about 17% to the total Gross Domestic Product and gives the employment to over 60% of the population.The agriculture of India has registered emotional growth over the last many decades.still, planter self-murders in India are fussing.[2] The expressed reasons in order to signify planter self-murders were debt, terrain, low yield costs, less irrigation, more cost of civilization, chemical diseases, and crop failure.
[3] A planter's decision is about which crop to grow generally clouded by his suspicion and the factors like making instant gains, lack of mindfulness about requesting demand, overvaluing a soil's eventuality to support the crop.The need for these is to design a system that could give prophetic perceptivity to Indian growers, thereby help them makes an informative decision about which crop has to suitable in the field.[4] Which used for a smart farming, which need the support of the IoT.Detector data analytic drives translucency into agrarian processes, as growers get precious perceptivity into the performance of the fields, glasshouses, etc. Farming power by machine literacy with is high-perfection models is a new conception arising moment.Aim to provide more volume and more quality of crops, this slice-edge movement can make a sustainable productivity growth for everyone working in agriculture.With the consideration, [5] we propose a system for the smart operation of crop civilization using IoT and Machine Literacy-A smart system that helps the growers in crop operation by considering tasted parameters (temperature, moisture) and other parameters (soil type, position of ranch, downfall) that predicts a most suitable crop to grow in that particular terrain.[1] The indian population mostly depends on the agriculture for continuing the their life.But crucial reason for the less productivity of crop is that weather changes.[2] Machine literacy is effectively involved in crop growing vaticination as a taking decision making method for selecting which crop to grow in a required area and how to increase the production of crops and which crop to select as per the seasons.A number of deep literacy ways, neural of network infrastructures, and vaticination models have been employed to help crop yield vaticination exploration.[3] The seed data of the crops are collected then, with the applicable parameters like temperature, moisture, and humidity content, which helps the crops to achieve successful growth.In addition to the software, a mobile operation for Android is being developed.The druggies are encouraged to enter parameters like temperature and their position will be taken automatically in this operation in order to start the vaticination process.[4] Monitoring the environmental changes like moisture, temperature ,humidity.That affected the growthing of the crop as well as helpful to the growers for deciding with the idle crop that will be suitable for farmers based on the data collected and weather change.This model can veritably effective than the traditional styles as the threat of crop failure, lower yield, inordinate water force or inordinate use of diseases and fungicides,etc.can be decrease a great level.The data received by the detector bumps stationed each over the area is transferred to pall and that data is anatomized , imaged for simple way to the planters.By taking the help of the imaged information the planter can able to take an best decisions that more affecting their crops.[5] A smart ranch model using a Bluetooth and a communication models like low power wide area networks (LPWAN) containing with wired communication network used to construct ranch.In extent, the system also provides an controlling functions and monitoring by usin an IoT communication system protocol MQ Telemetry Transport (MQTT), which leads to enhancement and development of IoT.[6] Data analytic are shown through expansive study to portray the fineness and racy of smart IoT systems.Data analytics are employed in farming land to decide the opinions and recommends respectable crop for product.The comprehensive overview introduces different styles and models followed in smart farming.It also provides a detailed designs and suggests suitable answers for smart agriculture problems.[7] The Smart Irrigation System which predicts the water demand for a crop, uses a machine learning algorithm.Humidity, Temperature, and moisture are the three essential parameters to determine the volume of water required in any agriculture field.System comprises of temperature, moisture, and humidity detectors, stationed in an agrarian field, sends data through a microprocessor, developing an IoT device with pall.The decision tree algorithm is an effective machine learning algorithm being applied to the data tasted from the field to prognosticate results efficiently.The results attained through the decision tree algorithm are transferred through a correspondence alert to the growers, which helps in decision-making regarding water force in advance.[8] Thermal imaging shows the eventuality in aiding numerous aspects of smart irrigation operation which examines a crucial specialized, legal issues and conditions supporting the use of the pall of effects for managing water source-related data previous to agitating implicit results.The major aim of this project is to help the farmers while choosing the crop for cultivating in their field.To rise the productivity of the crop with the live data, main data for climatic conditions like temperature and moisture from the website of government is also collected and stored.This proposed system analyzes climatic conditions like temperature, moisture, and also field characteristics as live data.Here the DHT-22 detector is used to collect the live data and main data taken from the website of the Government or Google Rainfall API, which soil is used by the farmer and even main downfall data.It could be done by the modern machine learning algorithms like supervised or unsupervised ML algorithms.By learning these logical learning networks the data set has been trained.The betterment attained by different machine literacy ways is used to obtain the most accurate results which will help most to the stoner.According to this data the usefully crops will suggested to planter and this system suggests toxins for the crop.

Hardware Description
In this hardware, a DHT22 detector is used for detecting the live temperature and moisture.DHT22 detector cover the live data of the climatic conditions like Temperature and moisture.This DHT22 detector is proven to be most accurate.It contain a thermistors and a capacities moisture to measure the griding air and a digital signal on the data pin to Arduino-Uno board.DHT22 detector is with the range of 0-100 RH for moisture and -40 degree Celsius -80 degree Celsius for the Temperature.
Electric conductivity sensor is used to check the ability of electric current in the particular substant which is having electric charges .The amount of electric charges can be detected with the conductivity sensor.) is as follows in the website, firstly the planter need to logins with their details, enter the type of land and position of the field for cultivation as a input data, both the data input are reused further.For collecting the major data of a particular position the position i.e. field is used as a input.The literal data is taken from the government websites or any third-party sources like APIs for climatic conditions like rainfall and temperature, and the quantum of downfall in the area.In this process the live data is collected by keeping the IoT device on the field.This IoT device consists of DHT 22 detector connected to the Arduino UNO for detecting the temperature and moisture along with wi-fi module i.e.ESP8266.Per every hour the live data is collected and the 74 storedon the pall platform of Thing Speak.The Vector auto regression (VAR) model is applied to this live collected data to read the downfall and moisture-temperature for a period of time when a farmer is start to cultivate the crop.Now, this collected moisture, temperature and downfall along soil characteristics given by the planter are supplied three different machine learning algorithms, they are Decision tree, K-NN and random forest algorithms where in the combination of the below results and the predefined data set i.e. climatic conditions of the crops present in the crop data stored is compared.With the help of ML algorithms the crops are shortlisted by comparing with live data and the stored data.Eventually, by comparing the delicacy attained by different machine learning algorithm ways, the most effective and suitable crop is suggested to the farmer.On the website, the farmer gets affair on the most suitable crop for there field.Along with this information the farmer success in choosing the better crop and the stylish suitable toxin.

ML Algorithms:
K-Nearest Neighbor classifier: K nearest neighbor is a popular machine learning algorithm that falls under the category of supervised learning.It is a simple algorithm that works on the principle of finding the similarity between available data and new data.KNN is commonly used for classification problems, where we have labelled data with inputs and outputs.To illustrate how KNN works, suppose we have an image that looks similar to both a square and circle, but we want to know which one is it.In this case, we can use the KNN algorithm to find the similarity between the new image and the square and circle images in the dataset.Based on the highest similarity score, the algorithm can classify the new image as either a square or circle.Similarly, KNN can be used to help a planter choose the correct crop by comparing actual data with previous data.If any parameters in the actual data match with the stored dataset, the planter can choose the corresponding crop.KNN can be used for both regression and classification problems, but it is mostly used for classification.The algorithm is known as a lazy learner because it does not immediately learn from the training set; instead, it stores the dataset and performs the classification action when new data is presented.

Decision Tree classifier
The decision tree algorithm is a type of supervised learning that is commonly used for solving classification and regression problems.The purpose of the tree is to facilitate decision-making by creating a tree like structure where each path represents a set of leading decisions that ultimately result in a class label or regression value.The decision tree creates a tree structure to solve a problem.The tree has three types of nodes: the root node, the internal node, and the leaf node.The root node is the topmost node, and it contains an attribute,which is used for making decisions.Each internal node represents a test on an attribute, and the nodes in between the root and the leaf nodes are called internal nodes.The leaf nodes represent the output, which is the class label or the regression value.The root and internal nodes are represented by rectangles, and the leaf nodes are represented by ovals.The decision tree algorithm works by asking a sequence of questions about an instance from the training set.The root node and internal nodes contain decision attributes.The split and jump to the next mode.This splitting generates subtrees until it reaches a leaf node, which determines the class label or the regression value for that instance.The tree splits recursively, which is known as recursive partitioning.The tree like structure of decision trees is also easy to understand by human thinking level, as it represents a flow chart style diagram.

Random Forest classifier:
The Random Forest algorithm is a supervised learning technique that is used to enhance the performance of decision tree classifiers.It is a type of ensemble learning method that combines multiple decision trees to determine the final output.Random Forest is a bagging technique, not a boosting technique.The trees in this algorithm are built independently and run in parallel, without any interaction between them.The algorithm builds multiple decision trees and averages their predictions to get a more accurate and stable prediction.One of the main advantages of random forest is that it can handle the overfitting issue commonly associated with decision trees.By using multiple trees, Random Forest reduces the risk overfitting and provides more accurate and reliable predictions.Moreover,it can be further enhanced by increasing the number of trees.This machine learning approach is popular due to its ability to handle high dimensional data with high accuracy.It is widely used in various fields, such as image classification, sentiment analysis and fraud detection among others.

RESULTS
The training dataset used contains the climatic conditions and soil characteristics like temperature,humidity,rainfall parameters, and the crop pH corresponding to these parameters.

Conclusion
This paper introduces the innovative approach for "Smart Crop Prediction" in agriculture domain using two new technologies they are internet of things (IoT) and machine learning.With the use of both previous data and live data helps to increase the accuracy of the result.Also comparing multiple Machine learning algorithms improves the accuracy of the system.Thus, the system is used to reduce the failures of farmers while choosing suitable crop and helps to increasing the productivity of crop and quality of work done at home.These proposed system gives prediction of the field status whether it is good or bad for the cultivation with the water content by the field characteristics

Field 1 :
The graph is showing the temperature variation over time based on the provided data in the thing speak.The plot set the x-axis as the timestamps as a date and the y-axis as the temperature values.

Fig. 6 .Field 2 :
Fig. 6.Temperature Field 2 : The displayed graph showing the variation in humidity over time based on the provided data.As it is mentioning the humidy values in y-axis and timestamps in x-axis.

Fig. 7 .Field 3 :Fig. 8 .Field 4 :
Fig. 7. Humidity Field 3 : The below field of a graph showing the soil moisture sensing with varying in the timestamps on the provided data.The data collected of a soil moisture level from 3 days are showing in the plot at x and y axis where x-axis is a timestamps and y-axis is values of soil moisture.

Fig. 9 .
Fig. 9. ConductivityHere three three different types of ML algorithms are applied they are Decision tree,KNN, and Support Vector Machine(SVM),and these three are compared with respect to their accuracy.Finally,Decision tree has the highest accuracy of all.So finally it is used to predict the crop.

Table 1
Smart farming IoT-based comparison

Table 2 .
Training Set of Field Characteristics The below graph sheets describe the temperature, humidity, soil moisture, and conductivity.
The data collected from the sensors such as temperature, humidity, soil moisture, and conductivity can be given to the Thingspeak cloud based on embedded c programming in the NodeMCU.The dataset can be collected from the thing speak for prediction with Ml algorithms.The thing speak can store historical and live data monitored and the data set in the thing speak go for prediction with the accuracy find with machine learning