Final - Report Final
Final - Report Final
A PROJECT REPORT
Submitted by
MOHAN J 513121106303
NARESH P 513121106304
GOKUL R 513121106701
of
BACHELOR OF ENGINEERING
in
ELECTRONICS AND COMMUNICATION ENGINEERING
MAY 2025
ANNA UNIVERSITY: CHENNAI 600 025
BONAFIDE CERTIFICATE
GOKUL R (513121106701) who carried out the project work under our
supervision.
Thanthai Periyar Govt.Institute Thanthai Periyar Govt .Institute Thanthai Periyar Govt .Institute
i
ACKNOWLEDGEMENT
would be incomplete without the mention of the people who made it possible,
their constant guidance and encouragement crowned our effects with success.
Also, we express our sincere thanks to all the teaching and non-teaching
staff members of Electronics and Communication Department for their
encouragement in bringing our project successful.
ii
ABSTRACT
soil conditions, and plan future crops effectively. The system integrates real-
(NPK, moisture, and pH) installed on farmland collect real-time field data,
crop advisory system analyzes soil nutrients, humidity, pH levels, and crop
historical market trends, helps farmers estimate potential profits and losses
application.
iii
TABLE OF CONTENTS
CHAPTER TITLE PAGE
NO NO
ABSTRACT iii
LIST OF TABLE ix
LIST OF ABBREVIATION x
1 INTRODUCTION 1
1.3 OBJECTIVES 2
1.4 SCOPES 2
2 LITERATURE REVIEW 5
2.1 INTRODUCTION 5
2.3 CONCLUSION 7
3 PROPOSEDSYSTEM 8
iv
CHAPTER TITLE PAGE
NO NO
3.3 CONCLUSION 10
4 HARDWARE COMPONENTS 11
4.1 ESP32 11
4.4 PH MODULE 13
4.9 CONCLUSION 16
5 SOFTWARE IMPLEMENTATION 17
v
CHAPTER TITLE PAGE
NO NO
5.2.2ASSEMBLY PROCESS 19
5.5 CONCLUSION 26
vi
CHAPTER TITLE PAGE
NO NO
6.8 DISCUSSION 35
6.9 CONCLUSION 36
7.1 CONCLUSION 37
REFERANCE 40
APPENDIX 41
vii
LIST OF FIGURES
FIGURENO TITLE PAGENO
4.4 PH module 15
4.5 DHT11 16
4.6 OLED 16
4.7 Relay 16
viii
LIST OF TABLES
NO NO
ix
LIST OF ABBREVIATIONS
ABBREVIATION EXPANSION
AI Artificial Intelligence
AIML Artificial Intelligence and Machine Learning
BLE Bluetooth Low Energy
CSV Comma-Separated Values
DHT Digital Humidity and Temperature Sensor
ESP32 Espressif Systems 32-bit Microcontroller
HTML HyperText Markup Language
IDE Integrated Development Environment
IoT Internet of Things
ML Machine Learning
NPK Nitrogen, Phosphorus, and Potassium
OLED Organic Light Emitting Diode
PCB Printed Circuit Board
pH Potential of Hydrogen
RNN Recurrent Neural Network
SMOTE Synthetic Minority Over-sampling Technique
UI User Interface
UART Universal Asynchronous Receiver Transmitter
Wi-Fi Wireless Fidelity
XGBoost eXtreme Gradient Boosting
API Application Programming Interface
x
CHAPTER 1
INTRODUCTION
1
1.3 OBJECTIVES
1.4 SCOPE
2
1.5.1 Challenges in Existing System
The proposed system is a smart and adaptive solution that combines IoT-
based sensing, AI-powered decision-making, and cloud connectivity to address
challenges in modern agriculture. It incorporates multiple sensors such as soil
moisture, temperature, humidity, pH, and NPK sensors to collect real-time data
on soil and environmental conditions. An ESP32 microcontroller is used to
process this data and upload it to Firebase, enabling cloud-based storage and
synchronization with a mobile application. The Android app provides an
intuitive interface for farmers to monitor sensor readings, receive crop
recommendations, and control irrigation systems either manually or
automatically.
3
algorithm analyses soil fertility, seasonal patterns, and weather data to
recommend the most suitable crops for cultivation. Additionally, the system
includes market price prediction functionality to guide farmers in selecting
crops that offer higher profitabe. This integration of real-time sensing,
automation, and ML ensures precise, data-driven farm management while
reducing water wastage, labour, and input costs.
Chapter 4: describes the hardware components used for sensing, control, and
field deployment.
Chapter 7: concludes the project and suggests directions for future and
improvements and enhancements.
4
CHAPTER 2
LITERATURE SURVEY
2.1 INTRODUCTION
[2] Patel, M., & Singh, A. "Towards a Multimodal System for Precision
Agriculture using IoT and Machine Learning." arXiv preprint
arXiv:2107.04895, 2021.
5
Patel and Singh [2] introduced a multimodal system for precision agriculture
that utilizes IoT for real-time data collection and ML for crop damage and
disease prediction. Their study highlights the significance of data integration in
improving crop yield quality. In contrast, our system extends beyond damage
prediction by incorporating an ML-based crop advisory system that suggests
optimal crops based on soil conditions, weather parameters, and seasonal trends.
Kumar and Verma [3] developed an AI-driven irrigation system that employs
real-time soil and weather data, using a decision tree algorithm for automated
irrigation scheduling based on predefined rules. While their work provides a
rule-based approach to irrigation control, our system enhances user flexibility
by integrating both automated and manual irrigation control through a mobile
application, allowing farmers to make informed decisions based on real-time
conditions.
[4] Sharma, P., & Khan, M. "Smart Farming - Precision Agriculture Using
ML." 2023.
Sharma and Khan [4] explored the application of IoT and ML in smart farming,
particularly in yield prediction using soil nutrient levels, pH, and weather data.
Their study focuses on optimizing crop selection and monitoring, whereas our
approach further integrates sensor-based field monitoring to display real-time
soil moisture, pH, and NPK measurements on a mobile platform for immediate
actionable insights.
6
Shaukat and Ahmed [5] proposed an ML-based predictive system to determine
the most suitable crop for a given season by analyzing historical and real-time
field data. While their work is centered on seasonal crop selection, our project
introduces an additional market-driven price prediction module to estimate
profitability, enabling farmers to make economically informed decisions.
2.2CONCLUSION
7
CHAPTER 3
PROPOSED SYSTEM
8
3.1.3. Crop Recommendation Using ML
The system uses Firebase to store and sync sensor data in real time. This
cloud platform enables multi-user access, data backup, and scalability. Farmers
can access environmental data from any location, allowing for long-term
analysis and planning. This also ensures that data is not lost even if the local
system fails.
9
3.2 BLOCK DIAGRAM:
3.3 CONCLUSION
10
CHAPTER 4
HARDWARE COMPONENTS
4.1 ESP32
Soil moisture sensors measure the amount of water present in the soil,
typically by detecting changes in electrical properties or measuring water
tension. Figure 4.3 illustrates the soil moisture sensor used to detect the water
content in soil, crucial for regulating irrigation automatically.
12
Figure 4.3SoilMoistureSensor
4.4PH MODULE
13
4.5 DHT11 SENSOR
14
Figure 4.6 OLED
15
4.8 WATER PUMP
4.9 CONCLUSION
16
CHAPTER 5
SOFTWAREIMPLEMENTATION
The system setup begins with the initialization and programming of the
ESP32 microcontroller. The microcontroller serves as the core processing unit,
coordinating sensor readings, decision-making algorithms, cloud database
communication, and output control actions. Firmware is developed using the
Arduino IDE, which includes embedded C/C++ code to interface with various
sensors and modules.
• All sensors are mounted securely and connected to the ESP32's GPIO
pins.
• A 5V regulated power supply is used to energize the components.
• The microcontroller is flashed with firmware that handles data
acquisition, processing, and transmission.
17
• Firebase credentials are programmed for seamless wireless
communication.
• The mobile application is linked to Firebase, allowing real-time data
access and notifications.
18
• OLED Display: Wired to I2C pins of the ESP32. Displays sensor
readings and system status for real-time on-site feedback.
• Relay Module: Connected to a digital pin on the ESP32. It controls the
irrigation pump based on commands from the microcontroller.
• Power Supply Unit: A regulated power module (5V/3.3V) ensures stable
voltage levels for all components. Connected via USB or external battery
pack depending on deployment location.
• Firebase Integration: Wi-Fi credentials and Firebase API keys are
embedded in the ESP32’s firmware. Sensor data is pushed to Firebase,
and mobile users retrieve it through an app interface.
5.2.2Assembly Process
19
5.3 SOFTWARE DEVELOPMENT AND INTEGRATION
The firmware was developed in C++ using the Arduino IDE to interface
with environmental and soil sensors. It performs the following tasks:
• Reads data from DHT11, pH, NPK, and soil moisture sensors.
• Processes and packages this data into JSON format.
• Establishes a Wi-Fi connection and continuously uploads data to Firebase
Realtime Database.
• Triggers relay activation based on soil moisture thresholds for automated
irrigation.
The web application acts as the user interface for crop advisory:
• Built using Flask for backend API handling and HTML/CSS for frontend
layout.
• Accepts inputs such as NPK levels, pH, temperature, humidity, soil type,
and cultivation period.
• Displays top crop recommendations, revenue forecasts, and dynamic
charts.
• Scrapes live market data using custom Python modules and updates it in
real time.
21
• Displays soil temperature, humidity, moisture, and pH directly on the
app.
• Sends irrigation control signals based on conditions or manual trigger.
• Links to the web-based crop recommendation system (hosted on Render)
for one-click access from the mobile app.
22
Meanwhile, users can navigate to the advisory system on Render through a link
or embedded view within the app.
The integration of the mobile app with real-time Firebase readings and the
web-based crop advisor makes the solution highly usable for farmers, students,
and agriculture stakeholders.
23
5.4 TESTING AND VALIDATION
24
5.4.3 Performance Evaluation Metrics
The high accuracy and balanced performance across classes demonstrated the
effectiveness of combining SMOTE with XGBoost and feature engineering.
• NPK Ratio
• Temperature-Humidity Index
• Soil Moisture Index
• NPK-TH Index
The full pipeline from sensor data input to final crop recommendation
and price forecasting was tested in an integrated environment. The AI/ML
model was deployed using Flask, and the frontend interfaces (web and mobile)
were validated for data flow integrity with Firebase as the backend sync
platform. The complete system was hosted using Render, and all outputs
including predicted crops, price-based revenue estimates, and land allocation
pie charts were visually and functionally validated.
5.5 CONCLUSION
26
CHAPTER 6
27
Additionally, the deployed model successfully predicted (Figure 6.2)the top
3 crops based on current soil and environmental inputs:
• Lentils – 7.99%
• Price per kg
• Estimated revenue
28
For example, Lentils were projected with:
• Price: ₹73.92/kg
• Revenue:₹887.09
• 33.3% Lentils
29
Figure 6.4 Crop Distribution Pie Chart
30
.
The IoT setup was tested in a prototype field environment. The ESP32
microcontroller read sensor values for:
• Temperature
• Humidity
• Soil Moisture
• NPK Levels
The NPK sensor placed in the field (Figure 6.7). These readings were
displayed on an OLED screen and synced live to Firebase (Figure 6.6).
31
Figure 6.6 Hardware Setup
The Firebase console and terminal logs (Figure 6.8) confirmed correct data
logging and system response:
32
• Relay switched ON/OFF based on moisture threshold
• Login/Signup interface
• Sensor dashboard
33
Figure 6.9 Sign Up Page
• Revenue forecast
• Graphical outputs
34
Figure 6.10 Smart Crop Recommendation System
6.8 DISCUSSION
The results validate that the IICRS system is fully functional, integrated,
and field-ready. The fusion of AI and IoT has enabled data-driven farming,
helping farmers:
35
6.9 CONCLUSION
36
CHAPTER 7
7.1 CONCLUSION
The AI model was trained with real agricultural datasets, featured advanced
feature engineering, and achieved a strong overall performance. The system is
not only functional but also scalable, and has been deployed as a responsive
web application via Render, making it accessible to farmers, researchers, and
agricultural planners across devices.
Through this project, a complete end-to-end smart farming solution has been
realized—offering precision irrigation, profitable crop recommendations,
and real-time monitoring, thereby addressing critical challenges like water
conservation, yield optimization, and farmer income stability.
37
7.2 RECOMMENDATIONS FOR FUTURE WORK
To further enhance the impact and capabilities of the IICRS, the following
future enhancements are recommended:
6. Blockchain Integration
38
7. Model Retraining Dashboard
39
REFERANCES
[1]. Bhakta, I., Phadikar, S., & Majumder, K. (2019). Crop selection system
using machine learning: A review. Smart Agricultural Technology, 1, 100003.
[4]. Patel, M., & Singh, A. (2021). Towards a Multimodal System for Precision
Agriculture using IoT and Machine Learning. arXiv preprint arXiv:2107.04895.
[5]. Sharma, A., & Jain, P. (2023). IoT and AI-Based Smart Agriculture
System: An Efficient Crop Monitoring Model. Journal of Agricultural
Informatics, 14(1), 32–45..
[6]. Sharma, P., & Khan, M. (2023). Smart Farming - Precision Agriculture
Using ML. ResearchGate.
[7]. Sharma, S., & Gupta, R. (2021). Towards Precision Agriculture: IoT-
Enabled Intelligent Irrigation Systems Using Deep Learning Neural Network.
IEEE Sensors Alert.
[8]. Shaukat, F., & Ahmed, S. (2023). Machine Learning-Based Optimal Crop
Selection System in Agriculture. Scientific Reports, 13, 42356.
[9]. Sishodia, R. P., Ray, R. L., & Singh, S. K. (2020). Applications of remote
sensing in precision agriculture: A review. Remote Sensing, 12(19), 3136.
[10]. Zhang, C., & Kovacs, J. M. (2012). The application of small unmanned
aerial systems for precision agriculture: a review. Precision Agriculture, 13,
693–712.
40
APPEDIX
CONFERENCE CERTIFICATES
41
42
43
44