Professional Documents
Culture Documents
IoT Based Soil PH Detection and Crop Recommendation System
IoT Based Soil PH Detection and Crop Recommendation System
Bhuvaneswari M 3 Prithisha V 4
Department of Information Technology Department of Information Technology
Sri Sai Ram Institute of Technology Sri Sai Ram Institute of Technology
Chennai Tamil Nadu, India Chennai Tamil Nadu, India
Roshini K 5
Department of Information Technology
Sri Sai Ram Institute of Technology
Chennai Tamil Nadu, India
Abstract:- Agricultural productivity hinges on soil crops accordingly. The problem of crop selection is
fertility, influenced by key factors like nitrogen, particularly pronounced in rural areas, where the adoption of
phosphorus, potassium, pH level, and soil moisture. Yet, IoT technologies can offer viable solutions. Utilizing an IoT-
achieving optimal crop growth is challenging due to based approach, an array of sensors including those for
limited farmer knowledge and difficulties in determining Nitrogen (N), Phosphorus (P), Potassium (K), pH,
precise fertilizer quantities. Conventional soil analysis temperature, moisture, and humidity are deployed to ascertain
methods involve manual sampling and costly lab tests, soil nutrient levels. These sensors continuously collect data
which are subjective. To address this, a proposed solution from the agricultural field and transmit it to a cloud-based
integrates IoT-enabled soil nutrient monitoring with platform via wireless communication protocols. A significant
machine learning algorithms for croprecommendations. advantage of utilizing a cloud-based database is its
Sensors collect data on crucial parameters like nitrogen, accessibility from anywhere and at any time, enabling
phosphorus, and soil temperature, transmitting it to a seamless integration with various smart devices. Data stored
cloud-based database. Machine learning analyzes this in the cloud encompasses crucial factors such as soil
data to suggest ideal crops, minimizing fertilizer use, moisture, temperature, rainfall, pH levels, and nutrient
reducing labor, and enhancing overall productivity. This concentrations (N, P, K), facilitating informed decision-
innovative approach streamlines crop selection, making. To recommend suitable crops, machine learning
minimizing unnecessary inputs while maximizing yields. algorithms such as Linear Regression (LR), K Nearest
By harnessing IoT and machine learning, farmers gain Neighbor (K-NN), Decision Tree (DT), Random Forest
valuable insights into soil health, enabling precise Regression (RFR), Neural Network (NN), Support Vector
fertilization and crop selection. This not only boosts Machine (SVM), and XGBoost are leveraged. The
agricultural productivity but also contributes to economic overarching objective of this system is to alleviate farmers'
growth by fostering sustainable practices and increased workload, enhance profitability, and facilitate data-driven
yields. decision- making. Real-time data pertaining to nitrogen,
phosphorus, potassium, pH, temperature, moisture, and
Keywords:- Agriculture Yields, Crop Recommendation, humidity sourced from the cloud database serves as inputs for
Machine Learning, Soil Behavior Analysis. the machine learning algorithms, enabling dynamic and
context-aware crop recommendations.
I. INTRODUCTION
II. LITERATURE SURVEY
In agricultural settings, farmers often grapple with
economic challenges stemming from suboptimal crop The classification algorithm used to predict the crop
selection, resulting in financial losses and crop disorders. Soil suitablefor the soil based on the nutrients level present on that
fertility plays a pivotal role in addressing this issue, aslow- is described in most of the existing literature for precision and
nutrient soils can lead to various plant disorders and smart agriculture. This section includes several articles that
diminished yields. To enhance profitability, farmers must are predicted to illustrate the benefits of adopting precision
accurately assess the nutritional status of their soil and select and smart agriculture as well as the areas that require
Model Training: A decision tree classifier is trained using C. k-Nearest Neighbors (k-NN):
the training dataset. The classifier employs soil
parameters as features and crop types as labels to learn the Input:
underlying relationships between soil characteristics and The k-Nearest Neighbors (k-NN) algorithm utilizes soil
suitable crops. parameters such as nitrogen, potassium, phosphorus, and pH
Model Evaluation: The trained decision tree model's levels as input features.
performance is assessed using the testing dataset through
metrics such as accuracy, precision, recall, and F1-score, Output:
among others. It offers a recommended crop based on the input soil
Prediction: Upon successful training and evaluation, the parameters.
trained decision tree model is employed to predict the
recommended crop based on the input soil parameters Steps:
provided by the user. The model utilizes its learned Data Preprocessing and Splitting: The soil data undergoes
decision-makingprocess to classify the input data into the preprocessing to address missing values and outliers.
most appropriate crop category. Subsequently, it is partitioned into training and testing
sets to facilitate model training and evaluation.
B. Support Vector Machines (SVM): Feature Standardization or Normalization: To ensure
uniformity in feature scales, the features are standardized
Input: or normalized. This step is crucial for accurate distance
The Support Vector Machines (SVM) algorithm accepts computation in the k-NN algorithm.
soil parameters such as nitrogen, potassium, phosphorus, and Model Training: Using the training dataset, the k-NN
pH levels as input features. classifier is trained. The parameter 'k' denotes the number
of nearest neighbors considered during classification.
Output: Parameter Selection: The optimal value of 'k' is selected
It offers a recommended crop based on the input soil utilizing techniques such as cross-validation to enhance
parameters. the model's performance.
Model Evaluation: The trained k-NN model is evaluated
Steps: using the testing dataset to assess its performance metrics.
Data Preprocessing and Splitting: Initially, the soil data These metrics include accuracy, precision, recall, and F1-
undergoes preprocessing to address missing values and score, providing insights intothe classifier's effectiveness.
outliers. Subsequently, the dataset is partitioned into Prediction: Upon successful training and evaluation, the
training and testing subsets. This division facilitates trained k-NN model is employed to predict the
model training and subsequent evaluation. recommended crop based on the input soil parameters
Feature Scaling: To ensure uniformity and comparability provided by the user. The model identifies the 'k'nearest
among features, they undergo scaling to bring them within neighbors in the feature space and determines the majority
a similar range. This step enhances the convergence speed class among them as the predicted crop category, thereby
and effectiveness of the SVM classifier. facilitating informed agricultural decisions.
Model Training: Using the training dataset, an SVM
classifier is trained. This classifier leverages soil
parameters as features and crop types as labelsto discern
the optimal decision boundary that segregates various
crop categories effectively.
Parameter Tuning: Fine-tuning of SVM parameters,
including the kernel type and regularization parameter
(C), is executed. Techniques such as grid search or
randomized search, coupled with cross-validation, are
employed to optimize the model's performance.
Model Evaluation: The trained SVM model undergoes
evaluation using the testing dataset to gauge its
performance metrics. These metrics encompass accuracy,
precision, recall, F1-score, among others, providing
insights into the classifier's efficacy.
Prediction: Upon successful training and evaluation, the
trained SVM model is deployed to predict the
recommended crop based on the input soil parameters Fig 3 Algorithm analysis
furnished by the user. By applyingthe acquired decision
boundary, the model classifies the input data into the most
suitable crop category, facilitating informed agricultural
decisions.
V. CONCLUSION
REFERENCES