0% found this document useful (0 votes)
30 views5 pages

Final Paper PDF

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views5 pages

Final Paper PDF

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Crop Recommendation using ML and IOT

G. Sanajana B. Shirisha
Electronics and Communication Engineering Electronics and Communication Engineering
Institute of Aeronautical Engineering (JNTUH) Institute of Aeronautical Engineering (JNTUH)
Hyderabad, India Hyderabad, India
[email protected] [email protected]

K.Nikitha Dr. V Kishen Ajay Kumar, Associate Professor


Electronics and Communication Engineering Electronics and Communication Engineering
Institute of Aeronautical Engineering (JNTUH) Institute of Aeronautical Engineering (JNTUH)
Hyderabad, India Hyderabad, India
[email protected] [email protected]

Abstract —The agricultural sector is increasingly adopting conditions, the system enhances resilience in the agricultural
technology to enhance crop yields. This project proposes a crop sector.
recommendation system utilizing sensors for moisture, rainfall,
temperature, water levels, and humidity all integrated with an The adoption of IoT for real-time data acquisition and ML for
ESP8266 microcontroller. The gathered sensor data will train a predictive analytics marks a major advancement in the agricultural
logistic regression model to predict the ideal crop from options such sector. It provides farmers with an intelligent, scalable, and cost-
as cotton, strawberry, rice, sugarcane, tomato, and millets. This
effective solution to enhance crop productivity while minimizing
implementation aims to assist farmers in making informed
decisions, improving productivity while reducing resource waste.
environmental degradation. This project not only improves
By combining IoT and machine learning, the system provides a farming practices but also aligns with the larger global objective
modern solution for sustainable farming. Furthermore, it of achieving food security amidst population growth and climate
empowers small-scale farmers to make data-driven decisions, change. Furthermore, it has the potential to empower smallholder
ensuring more efficient use of their resources and boosting overall farmers, enabling them to compete in the market and secure better
agricultural output. livelihoods.
In developing countries, agricultural monitoring can prevent
famine and aid humanitarian efforts. A major challenge is yield Agriculture, the root of human civilization, remains the backbone
estimation, predicting crop yields before harvest. We propose a of India's economy. Crop selection is crucial in agricultural
scalable, accurate, and cost-effective method for crop yield planning and depends on factors such as market prices, production
prediction using publicly accessible remote sensing data. If
rates, and government policies. Significant changes in the
implemented at government soil health centers, this solution could
help farmers minimize fertilizer use, protect soil health, and agricultural sector are necessary to bolster India's economy. By
maximize revenue from their land. This approach not only applying machine learning techniques to farming, these challenges
contributes to environmental conservation but also promotes long- can be mitigated. In addition to technological advances, timely and
term agricultural sustainability by maintaining soil integrity for reliable information plays a crucial role in enhancing farming
future generations. outcomes. This project introduces a crop selection framework that
Keywords — Precision Agriculture, Machine learning, Crop addresses key issues faced by farmers, contributing to increased
prediction, Sensor Technology, Soil Monitoring, Real-Time Data yields and strengthening the agricultural economy.
I. INTRODUCTION The system employs predictive analytics to recommend the top
three crops based on soil nutrient composition, temperature, and
Agriculture, the cornerstone of many economies, is expected revenue. There are two methods for farmers to use this
increasingly challenged by erratic weather patterns, shrinking system. First, it can automatically suggest suitable crops based on
natural resources, and the escalating demand for food historical soil data from nearby locations. Alternatively, farmers
production driven by population growth. Traditional farming, can manually input soil parameters to receive customized
based on experience and historical trends, is often insufficient recommendations. While traditional crop selection methods rely
to tackle these issues, leading to suboptimal resource use, on experience and observation, they are increasingly inadequate
frequent crop failures, and lower productivity. To address these due to changing climatic conditions and resource limitations. This
challenges, technologies like the Internet of Things (IoT) and project leverages IoT and machine learning to modernize farming
Machine Learning (ML) are revolutionizing agriculture by practices.
incorporating data-driven, precision-based crop management
techniques. By monitoring real-time environmental factors through sensors
and analyzing this data using machine learning models, the system
This project introduces a Crop Recommendation System that predicts the best crop suited to the given conditions. The system
integrates IoT sensors and machine learning algorithms to offer utilizes logistic regression, a classification technique, to interpret
real-time, accurate crop suggestions. The system collects data sensor data and deliver precise crop recommendations. This
on critical environmental parameters such as soil moisture, approach enhances agricultural decision-making, leading to better
temperature, humidity, and rainfall, which is then analyzed by resource management, improved yields, and a more sustainable
ML models to predict the crops most likely to thrive. This farming future. Ultimately, the integration of technology in
allows farmers to make data-informed decisions, improving agriculture not only fosters economic growth but also promotes
yields and optimizing resources like water and fertilizers, environmental stewardship, ensuring that future generations
ultimately promoting sustainable and efficient farming inherit a viable and productive agricultural landscape.
practices. By enabling farmers to adapt quickly to changing
II. EXISTING APPROACH
of an event occurring versus not occurring. The coefficients in LR
Existing crop suggestion systems are often based on historical indicate how changes in the independent variables influence the log-
data and do not account for real-time environmental conditions. odds of the target outcome.
These systems can be inaccurate due to the dynamic nature of
weather and soil conditions. Performance metrics for LR include accuracy, precision, recall, F1-
Remote sensing data has been extensively utilized for crop yield score, ROC-AUC, and the confusion matrix, providing insight into
prediction within the remote sensing community (Bolton and true positives, false positives, true negatives, and false negatives.
Friedl 2013; Johnson 2014). However, most known approaches Though effective for simple classification problems, LR may not
depend on manually engineered features, based on the perform well with complex, non-linear relationships unless feature
assumption that these features can capture the majority of engineering or transformation is applied.
vegetation growth information present in high-dimensional
images. Some commonly employed features include the
Normalized Difference Vegetation Index (NDVI) (Quarmby et
al. 1993; Johnson 2014), two-band Enhanced Vegetation Index
(EVI2) (Bolton and Friedl 2013), and Normalized Difference
Water Index (NDWI) (Satir and Berberoglu 2016).

III. PROPOSED APPROACH

The System Design outlines the system requirements, operating


environment, architecture of the system and its subsystems, file
and database structure, input formats, output designs, human-
Figure 1: Logistic Regression
machine interaction, detailed design specifications, processing
logic, and external interfaces.
2. Decision Tree (DT):
A. Data Collection: Decision Tree (DT) is a supervised algorithm used for
classification and regression. It splits data into branches based
Data is collected for various sensors and stored in excel sheet and on feature values, with nodes representing decisions and leaves
relate research is done to find best cops and used as labels, showing outcomes. DTs aim to maximize information gain or
Temperature, humidity, water level , rainfall, are used as features reduce impurity. While easy to interpret, they can overfit
and crop type a label. without pruning.

B. Pre-Processing:

Live data is collected from sensors, converted into the required


format, and processed via the ESP8266, which is connected to
the system through a serial port. The data is then formatted into
a CSV file and stored as a dataset. The initial dataset undergoes
pre-processing to eliminate outliers and redundant information.
Missing values are addressed through normalization and Figure 2: Decision Tree
transformation techniques.
IV. BLOCK DIAGRAM
C. Train-Test Split and Model Fitting:
The block diagram depicts an IoT-based environmental monitoring
The pre-processed data is applied to various machine learning system centered around the ESP8266 WiFi module. Acting as the
algorithms for model development. These models are built using system's CPU, the ESP8266 gathers data from various sensors and
techniques such as classification, clustering, pattern recognition, transmits it to software for analysis or automation. It is powered by
and association rules. an external source, ensuring consistent operation of the WiFi
module and connected sensors.
Algorithms
Three primary sensors are integrated: a DHT11 sensor, a rainfall
1. Logistic Regression (LR): sensor, and a soil moisture sensor. The DHT11 measures two key
Logistic Regression (LR) is a supervised machine learning environmental factors: temperature and humidity, commonly used
algorithm used for binary classification problems, where the in smart farming and weather applications for real-time climate
outcome variable is categorical. Unlike linear regression, which monitoring. The rainfall sensor tracks precipitation levels, detecting
predicts continuous values, LR predicts the probability of a class rain and measuring its intensity, valuable for irrigation management
or event. The model uses a logistic function to map the predicted and weather forecasting.
values between 0 and 1, which represents probabilities. The
decision boundary is typically set at 0.5, classifying outputs as 0 The soil moisture sensor measures soil moisture content, crucial for
or 1 based on this threshold. agricultural systems and gardens where water management is
essential. By monitoring moisture levels, it enables the automation
LR estimates the relationship between one or more independent of irrigation systems, preventing water wastage while ensuring
variables and the categorical dependent variable using maximum optimal plant hydration.
likelihood estimation. It calculates the log-odds of the probability
The ESP8266 consolidates data from these sensors and transmits such as controlling irrigation systems.
it via WiFi to a software interface. This software, either local or
cloud-based, processes the data, delivering insights to the user. It
can display real-time data, analyze trends, or trigger automated
actions, like turning on sprinklers or sending alerts during
specific conditions.

Figure 4: Hardware Implementation

B. Software implementation

Figure 3: Block Diagram ESP8266 collects data from sensors (e.g., DHT11, soil moisture, and
rainfall) and sends it to the computer via WiFi or through the serial
V. IMPLEMENTATION port.
Flask (hosted on the computer or server) receives the data, processes
A. Hardware implementation it, and updates a web dashboard. The user can access this dashboard
to view real-time environmental conditions and make decisions
ESP8266 WiFi Module (Mounted on a PCB): The central (e.g., activating irrigation).
component in this setup is the ESP8266, which is mounted on a
custom-made printed circuit board (PCB). The ESP8266 Anaconda is used in the background for:
connects to various sensors and acts as the communication Managing Python environments and dependencies.
module to send data wirelessly. The white USB cable connected Data analysis (e.g., using pandas to structure and clean the data).
to the board provides power and facilitates data transmission to a Data visualization (e.g., using matplotlib or Plotly to create real-time
computer or server. graphs).
Optional machine learning tasks (e.g., predicting future sensor
Rainfall Sensor: In the upper left of the image, there is a readings based on historical data).
rectangular sensor module with metal strips, which is a rainfall
sensor. This sensor detects rain based on the conductivity of Serial port communication serves as an alternative or debugging
water on its surface, sending signals to the ESP8266 to record tool, ensuring that data is still transmitted between the ESP8266 and
precipitation data. the computer even if WiFi is unavailable. It also allows for two-way
communication, enabling users to send commands
DHT11 Sensor: On the right side of the setup, a small sensor back to the ESP8266
module with a blue casing can be seen, which is likely the DHT11
sensor. This sensor measures temperature and humidity and is
connected to the ESP8266 via wires.

Soil Moisture Sensor: Located in the lower right section, the two-
pronged sensor, connected by wires, is the soil moisture sensor.
It measures the soil's moisture level by detecting the resistance
between the prongs and transmits this data to the ESP8266 for
further processing.

Wiring and Power Connections: The setup is connected using


various jumper wires, which connect the sensors to the ESP8266
module. The power to the sensors is likely provided through the
ESP8266, and the entire system seems to be powered by the USB
connection.
Figure 5: Crop data from sensors
This prototype setup is likely part of a smart agricultural or
environmental monitoring system, where data from the rainfall,
soil moisture, and DHT11 sensors is collected by the ESP8266
and transmitted wirelessly for analysis or automated responses,
VI. RESULT AND DISCUSSION VII. CHALLENGES AND FUTURE SCOPE

The IoT-based environmental monitoring system effectively Data Reliability: Sensor malfunctions and frequent calibration needs
collected real-time data using the ESP8266 WiFi module, which can affect data accuracy.
interfaced with sensors such as the DHT11 (for temperature and Connectivity: Poor internet access in rural areas and high initial
humidity), a rainfall sensor, and a soil moisture sensor. The costs pose challenges to system adoption.
system sent the data to a Flask-based web dashboard, enabling Data Overload: Managing and processing large data volumes in real-
live monitoring, where users could observe real-time sensor time requires significant resources.
readings, like soil moisture and temperature, or initiate actions Integration Issues: Ensuring compatibility with existing farming
such as controlling irrigation systems. systems and standardizing IoT protocols can be difficult.
Farmer Adoption: Lack of technical knowledge and resistance to
Sensor Performance: DHT11, soil moisture, and rainfall sensors new technologies could slow adoption.
effectively gathered environmental data, though minor
limitations in accuracy were observed. Advanced IoT Sensors: Future sensors with better sensitivity, multi-
Flask Web Dashboard: The dashboard displayed real-time data parameter functionalities, and solar-powered options can enhance
and provided user-friendly controls for irrigation and monitoring. data accuracy and sustainability.
Data visualization helped track environmental trends. Edge Computing: Real-time, local data processing will reduce
Serial Port Backup: In cases of WiFi failure, data was reliably latency and improve decision-making in areas with poor internet
transmitted via the serial port for logging and analysis. connectivity.
Anaconda and Data Analysis: Data was processed and visualized Advanced Machine Learning Models: Deep learning and transfer
using Python libraries in Anaconda, enabling real-time analysis learning can improve crop classification, pest detection, and
and future predictive insights. scalability for different regions.
Cloud Integration: Scalable cloud solutions will enable advanced
data analytics and AI-based insights, empowering farmers to make
more accurate and timely decisions.
Mobile and Web Platforms: Expanding to user-friendly mobile apps
with voice assistance can increase accessibility for farmers in remote
areas.

VIII. CONCLUSION

This IoT-based environmental monitoring system, using ESP8266,


Flask, and Anaconda, demonstrated effective real-time data
collection and user interaction capabilities. The integration of
sensors like DHT11, soil moisture, and rainfall sensors allowed for
comprehensive environmental tracking, with real-time data being
displayed on an intuitive Flask-based web dashboard. Despite minor
Figure 6: Crop datasheet challenges with WiFi connectivity and sensor precision, the project
successfully achieved its objectives, offering a scalable solution for
smart agriculture and environmental monitoring applications.

REFERENCES

[1] Pradeepa Bandara, Thilini Weerasooriya, Ruchirawya T.H.,


“Crop Recommendation System”, International Journal of
Computer Applications (0975 – 8887) Volume 175– No.22,
October (2020),pp.22-25.

[2] Jain, Sonal, and Dharavath Ramesh. "Machine Learning


convergence for weather-based crop selection." In 2020 IEEE
International Students'Conference on Electrical, Electronics and
Computer Science (SCEECS), IEEE, 2020, pp. 1-6.

Figure 7: Result [3] A. Dahane, R. Benameur, B. Kechar and A. Benyamina,


"”An IoT Based Smart Farming System Using Machine
Reliability: The system performed reliably, with stable WiFi Learning”," 2020 International Symposium on Networks,
transmission, though minor connectivity issues were noted. Computers and Communications (ISNCC), Montreal, QC, Canada,
Sensor Limitations: The DHT11 sensor had limited precision, 2020, pp. 1-6.
and the soil moisture sensor faced minor inaccuracies due to
[4] G. Abraham, R. R. and M. Nithya, & quot; “Smart Agriculture
inconsistent soil conditions. Based on IoT and Machine Learning”, & quot; 2021 5th
Scalability: The system is scalable, with room for additional International Conference on Computing Methodologies and
sensors and features like automated irrigation and Communication (ICCMC), Erode, India, 2021, pp. 414-419.
mobile optimization.
[5] P. A, S. Chakraborty, A. Kumar, and O. R. Pooniwala, “Intelligent
crop recommendation system using machine learning,” in 2021 5th
International Conference on Computing Methodologies and
Communication (ICCMC), 2021, pp. 843–848.
[6] Punith Kumar, H Varun Prabhu, H N Champa, "Crop
Recommendation using Ensemble Stacking Machine Learning
approach", 2023 IEEE 3rd Mysore Sub Section International
Conference (MysuruCon), 2023, pp.1-6.

[7] .Rohit Kumar Rajak, Ankit Pawar, Mitalee Pendke, Pooja


Shinde, Suresh Rathod, Avinash Devare, “Crop
Recommendation System to Maximize Crop Yield using
Machine Learning Technique”, International Research Journal
of Engineering and Technology (IRJET) Volume: 04 ,Issue: 12
| Dec-2017, pp. 950-953.

[8] H. Youness, G. Ahmed and B. E. Haddadi, " “Machine


Learning-based Smart Irrigation Monitoring System for
Agriculture Applications Using Free and Low-Cost IoT
Platform”, & quot; 2022 International Conference on
Microelectronics (ICM), Casablanca, Morocco, 2022, pp. 189-
192.

[9] Dhruvi Gosai, Chintal Raval, Rikin Nayak, Hardik


Jayswal, Axal Patel, “Crop Recommendation System
using Machine Learning”, International Journal of
Scientific Research in Computer Science, Engineering
and Information Technology, May-June-2021, Volume7,
Issue 3, pp. 554-557.

[10] S. Pudumalar, E. Ramanujam, R. H. Rajashree, C. Kavya,


T. Kiruthika, and J. Nisha, “Crop recommendation
system for precision agriculture,” in 2016 Eighth
International Conference on Advanced Computing
(ICoAC), 2017, pp. 32–36.

You might also like