0% found this document useful (0 votes)
4 views104 pages

Final 2025 BCKBOOK

The project report titled 'Agro-Vision' outlines an innovative agricultural solution that integrates AI and IoT technologies to enhance traditional farming methods through real-time data monitoring and automation. It includes four key modules: smart irrigation, crop health management, animal detection, and automatic control of electric appliances, all aimed at improving productivity and resource management in agriculture. The project is submitted by a team of students from the Department of Computer Engineering at Gramin Technical and Management Campus as part of their diploma requirements.
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)
4 views104 pages

Final 2025 BCKBOOK

The project report titled 'Agro-Vision' outlines an innovative agricultural solution that integrates AI and IoT technologies to enhance traditional farming methods through real-time data monitoring and automation. It includes four key modules: smart irrigation, crop health management, animal detection, and automatic control of electric appliances, all aimed at improving productivity and resource management in agriculture. The project is submitted by a team of students from the Department of Computer Engineering at Gramin Technical and Management Campus as part of their diploma requirements.
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/ 104

A

PROJECT REPORT
ON
“Agro-Vision”

:: Submitted by ::
Mr. Bhaskar Premdas Jadhav
Mr. Aniket Abhijeet Deshmukh
Mr. Tukaram Ananda Kadam
Mr. Pratik Ganpatrao Gaikwad

:: Guided by ::
Mr. Phule J. S

:: Department of ::
COMPUTER ENGINEERING

GRAMIN TECHNICAL AND MANAGEMENT CAMPUS,


VISHNUPURI NANDED: - 431606
ACADEMIC YEAR
2024-25
A
PROJECT REPORT
ON
“Agro-Vision”
:: Submitted by ::
Mr. Bhaskar Premdas Jadhav
Mr. Aniket Abhijeet Deshmukh
Mr. Tukaram Ananda Kadam
Mr. Pratik Ganpatrao Gaikwad

:: Guided by ::
Mr. Phule J. S

In partial fulfillment for the award of the diploma in


COMPUTER ENGINEERING

GRAMIN TECHNICAL AND MANAGEMENT CAMPUS,


VISHNUPURI NANDED: - 431606
ACADEMIC YEAR
2024-25
CERTIFICATE
This is to certify that project entitled “Agro-Vision” being submitted by Mr.
Bhaskar Premdas Jadhav, Mr. Aniket Abhijeet Deshmukh, Mr. Tukaram
Ananda Kadam, Mr. Pratik Ganptrao Gaikwad, to “Maharashtra State Board
of Technical Education, Mumbai” as a partial fulfillment of award of Diploma in
Computer Engineering, is record of bonafied work carried out by them under my
supervision and guidance. The matter contain in this project work has not been
submitted to any other institute for award of any degree or diploma.

( ) (Mr. Phule J. S)
Head of Department Project Guide

( )

Principal
Department of Computer Engineering
VISION MISSION
The Department of Computer Department of Computer
Engineering will be one of the Engineering will be role model for
National leaders, catering Computer Engineers by:
dynamic IT knowledge to serve 1. Exposing the learners to latest
society and the globe at large. tools and technologies in the field
of Computer, hardware and
ि वB थTय ां न म ि हती व तांũy न software.

Ɨ ũ च क ळ नुVप y न दउन १. सांगणक ह डŊविर व सॉ4विर

सांगणक ििभय ांि ũकी ि वभ ग रʼŌ Ɨ ũ तील िB वत तांũy न व

ीय नतृȕ च एक भ ग िसल. स धन
ि वȯ थTय ां न ि शकवण.
2. Providing fruitful learning
environment, enhancing problem
solving skills amongst the
learners, to make them successful.
२. ि वB Ț ōच यश4 ीस ठी

फलद यी शैƗि णक व त वरण तय र

कVन w ां lj मधील Ůʲ

सोडवǻ च कौशʞ ि विकसत

करण..
3. Support society by
participating in and extending
technological services.
३. सम ज ल ल गण “य सांगणकीय

त ांि ũक सव पुरवून सम ज च

आध र बनण.
PROJECT APPROVAL SHEET
Following team has done the appropriate work related to the “Agro_Vision ”
in partial fulfillment for the award of diploma in Computer Engineering of
“MSBTE” and is being submitted to Gramin Technical And Management
Campus, Vishnupuri, Nanded.

Team:
Mr. Bhaskar Premdas Jadhav

Mr. Aniket Abhijeet Deshmukh

Mr. Tukaram Ananda Kadam

Mr. Pratik Ganpatrao Gaikwad


Guide:
Mrs. Phule J.S

Date: 24/04/2024
Place: Nanded.

( ) ( )

Internal Examiner External Examiner


ACKNOWLEDGEMENT
We would like to thank our scheme, faculties and mentors for giving us the opportunity to
work under their guidance and help us in our final project. I would like to thank our beloved
principal who is the force behind this project. My sincere thanks to Ms.
D as our internal project guide for giving us valuable inputs and ideas right from the selection
of topic for project till its successful completion.
I thank (HOD of Computer Department) for his ongoing support
and encouragement in every aspect Last but not the least entire staff of Department of
Computer Engineering for guiding their thoughts and vision.
The successful completion of our final project report would not have been possible without
the dedicated support from all our mentors, family and friends. Finally, yet importantly I would
like to express my heartfelt thanks to my beloved parents for their blessings, my friends, and
all those who supported me directly or indirectly for their help and wishes for successful
completion of this project.

1. Mr. Bhaskar Premdas Jadhav


2. Mr. Aniket Abhijeet Deshmukh
3. Mr. Tukaram Ananda Kadam
4. Mr. Pratik Ganptrao Gaikwad
ABSTRACT
Project Name: Agro-Vision

Agro-vision is innovative solution designed to revolutionize traditional farming methods. Using AI


automation and IOT technology to monitor real time data using mobile-application.
This Project Contain Four Different Modules:
• Smart irrigation
• Crop health management
• Animal detection
• Automatic control electric appliances

1. Smart Irrigation :
The water pump operations are automated using real-time data from pH, soil
moisture, temperature, humidity, & solar intensity sensors. This ensures crop/plants
get the right amount of water while saving resources. under different environmental
conditions.

2. Crop Health Management system :


By analysing sensor measurements of nutrients in the soils, the system uses an AI to
examine data & suggest the fertilizer recommended for crops for a healthy growth
& improvement.

3. Animal detection :
The system uses sensors to detect pest movements & trigger alarms, safeguarding
crops from damage caused by pests feeding on them.

4. Automatic Control Electric Appliances :


The system regulates farm electrical appliances. to optimize usage of energy.
Chapter
Name of the Title Page NO.
NO.
1 Introduction 1-5
1.1 Aim of Project 1
1.2 Project Analysis 1
1.3 Scope of Project 1
1.4 Objectives 2
1.5 Features 3
1.6 Module 4
1.7 Software Requirements 5
1.8 Hardware Requirements 5

2 Literature Survey 6-7


2.1 Introduction 6
2.2 Literature Survey 6
2.3 Attachment 7

3 System Requirements Specifications 8- 11


3.1 Hardware Requirement 8
3.2 Software Requirement 9

4 System Design 12 - 27
4.1 Design Document 12
4.2 ER-Diagram 13
4.3 Data Flow Diagram 14
4.4 Flow Chart Diagram 16
4.5 Activity Diagram 18
4.6 Use Case Diagram 20
4.7 Block Diagram & circuit Digram 23-27

5 System Implementation 28- 73


5.1 User Application Coding/Implementation -
5.2 Software Application -
5.3 Output -

6 Testing & Debugging Strategies & Test Cases 74 – 85


6.1 Testing 74
6.2 Testing Objectives 74
6.3 Levels of Testing 75
6.4 Types of Testing 76
6.5 Test Cases 77-85

7 Advantages 87-89
7.1 Advantages 87

8 Conclusion & Recommendations 90-91


8.1 Conclusion 90
8.2 Recommendation on Future Improvement 91

9 References 92
Agro_Vision 2024-25

CHAPTER 1
INTRODUCTION
1.1 AIM OF THE PROJECT

The main aim of this project improves productivity in agriculture by integrating sensors, Monitor
Real-time data through a user-friendly application.

In this project we have four modules:

• Crop health management


• Smart irrigation
• Animal detection
• Automatic control electric appliances

1.2 PROJECT ANALYSIS

In the project analysis phase, we scrutinize agricultural challenges and opportunities, gathering real-
time data through user friendly application. The system will utilize sensors to monitor soil moisture,
temperature, humidity, nutrients which is present in soil.

1.3 SCOPE OF THE PROJECT

The scope of the project is increasing productivity in agriculture industry by using AI & Iot technology
integrating sensors through monitor real time data in a user-friendly application i.e. Monitor
temperature of soil, humidity, moisture, nutrients which is present in soil.

1.4 OBJECTIVES
• It takes the analysis of sensor measurements of nutrients in the soils using an AI to
examine data & suggest the fertilizer recommended for crops for healthy growth &
improvement
• Save water by wearing an intelligent irrigation system adjusts to the soil and the weather
• Track On Motion Sensors to detect pests early which stops from eating crops. Empower
farmers with knowledge and tools.
• Provide an app to the farmers in which they can monitor their farm and take quick
decision
• To help farmers waste less and manage resources better so that we have sustainable
farming

GT&MC – Department of Computer Engineering. Page 1


Agro_Vision 2024-25

➢ The specific objectives include:


✓ Real-Time Data Monitoring – Continuously measure Temperature , pH, Humidity..
✓ Automated Alerts & Notifications – Provide instant mobile notifications and alarms
when water quality exceeds safe limits.
✓ User-Friendly & Scalable System – Ensure easy deployment, scalability for multiple
locations, and adaptability for future improvements.
✓ Cost-Effective Solution – Develop an affordable yet efficient system for areas
lacking resources and access to expensive water testing facilities.

GT&MC – Department of Computer Engineering. Page 2


Agro_Vision 2024-25

1.5 FEATURES
1. Real-Time d Monitoring
✓ Continuously monitor Temp, pH, Humidity, Soil Moisture , NPK.

2. Automated Alerts & Notifications


✓ Sends real-time alerts via mobile notifications and alarm systems when water
quality exceeds safe thresholds.
✓ Enables proactive intervention to prevent health hazards.
3. IoT-Based Remote Monitoring
✓ Integrates with IoT technology to allow users to remotely track water quality via a
mobile app.
✓ Displays live sensor data for real-time decision-making.
4. Graphical Analysis
✓ Provides graphical representation and trend analysis to understand water quality
variations over time.
5. Cost-Effective & Energy-Efficient Design
✓ Developed with affordable sensors and components, making it accessible for rural
and low-resource areas.
✓ Optimized for low power consumption for continuous operation.
6. Scalability & Customization
✓ Can be deployed in households, industries, government water tanks, aquariums,
and agriculture and Easily expandable for multi-location monitoring.

7. User-Friendly Mobile & Web Interface


✓ Offers an intuitive dashboard to view real-time data, trends, and alerts.
✓ Compatible with mobile and web applications for easy access anytime, anywhere.

GT&MC – Department of Computer Engineering. Page 3


Agro_Vision 2024-25

1.6 MODULE
➢ Hardware Modules:
1. Arduino Mega
2. Sensors
3. Relay Module
4. Water pump
5. Breadboard
6. Jumper wires

➢ Software Modules:
➢ Arduino IDE (used for microcontroller programming)
➢ Python (works on AI models and for data processing)
➢ Tools for Mobile Applications Development (like Flutter, React native)
➢ MySQL, Firebase (Database Management Systems)

GT&MC – Department of Computer Engineering. Page 4


Agro_Vision 2024-25

1.7 SOFTWARE REQUIREMENTS

One of the most difficult tasks is that, the selection of the software, once system requirement is
known is determining whether a particular software package fits the requirements. After initial
selection further security is needed to determine the desirability of particular software compared
with other candidates. This section first summarizes the application requirement question and
then suggests more detailed comparisons.

• Arduino IDE (used for microcontroller programming)


• Python (works on AI models and for data processing)
• Tools for Mobile Applications Development (like Flutter, React native)
• MySQL, Firebase (Database Management Systems)

1.8 HARDWARE REQUIREMENTS


The selection of hardware is very important in the existence and proper working of any software.
In the selection of hardware, the size and the capacity requirements are also important.

• Arduino Mega
• Soil moisture
• Relay Module
• Water module
• Breadboard
• Jumper Wire
• Aurdino uno
• Npk sensor
• Temptuare sensor
• Humidity Sensor
• LDR sensor
• Raindrop sensor
• Bulb
• Pir sensor
• Buzzer
• Waterpump

GT&MC – Department of Computer Engineering. Page 5


Agro_Vision 2024-25

CHAPTER 2

LITERATURE SURVEY

2.1 INTRODUCTION

This project aims to develop AgroVision, an affordable, intelligent, and automated smart
agriculture solution tailored to the needs of farmers in both rural and semi-urban regions. It
focuses on enhancing traditional farming practices by integrating sensors with IoT
technology to monitor vital environmental parameters such as soil moisture, temperature,
humidity, and animal movement. Through real-time data collection and mobile connectivity,
AgroVision automates irrigation, improves decision-making, and strengthens crop
protection. It is designed to be scalable, energy-efficient, and easy to use, making precision
farming accessible to small and marginal farmers. The ultimate goal is to increase crop yield,
conserve resources like water, and reduce manual effort—ushering in a more sustainable
and technology-driven agricultural ecosystem.

2.2 LITERATURE SURVEY

✓ IoT-Based Smart Agriculture Systems

Conventional farming relies heavily on human intuition and manual labor, making it inefficient
in terms of time, water use, and resource management. IoT-based smart agriculture systems
revolutionize this by using sensors, controllers, and cloud technologies to automate tasks such
as irrigation and monitoring. These systems provide real-time insights into soil and
environmental conditions, allowing timely interventions and optimized resource usage.

✓ Limitations of Existing Systems

Many existing smart farming systems only monitor basic parameters and often require constant
internet connectivity. They may be expensive, making them inaccessible to small farmers.
Furthermore, these solutions typically lack integrated security features like animal detection,
real-time mobile alerts, and offline control options, limiting their effectiveness and adaptability
in rural scenarios.

✓ Insights for AgroVision (Proposed System)

AgroVision solves these issues by offering a compact, modular system using affordable
hardware such as Arduino Mega, soil moisture sensors, DHT11, PIR sensors, and a 4-channel
relay for pump control. The system operates with or without internet and provides mobile-based
updates and alerts through Firebase. It also includes features like local alerting (buzzer) and
manual override through Serial Monitor—making it practical, reliable, and field-ready.

GT&MC – Department of Computer Engineering. Page 6


Agro_Vision 2024-25

2.3 Attachment

GT&MC – Department of Computer Engineering. Page 7


Agro_Vision 2024-25

CHAPTER 3
SYSTEM REQUIREMNT SPECIFICATIONS

The entire system is projected with a physical diagram which specifics the actual storage
parameters that are physically necessary for any database to be stored on to the disk. The overall
systems existential idea is derived from this diagram.
The relation upon the system is structure through a conceptual ER-Diagram, which not only
specifics the existential entities but also the standard relations through which the system exists
and the cardinalities that are necessary for the system state to continue.
meet the needs of its users and stakeholders.

3.1 HARDWARE REQUIREMENT


The selection of hardware is very important in the existence and proper working of any software.
In the selection of hardware, the size and the capacity requirements are also important.

• Arduino Mega
• Soil moisture
• Relay Module
• Water module
• Breadboard
• Jumper Wire

3.2 SOFTWARE REQUIREMENT


One of the most difficult tasks is that, the selection of the software, once system requirement is
known is determining whether a particular software package fits the requirements. After initial
selection further security is needed to determine the desirability of particular software compared
with other candidates. This section first summarizes the application requirement question and
then suggests more detailed comparisons.

• Arduino IDE (used for microcontroller programming)


• Python (works on AI models and for data processing)
• Tools for Mobile Applications Development (like Flutter, React native)
• MySQL, Firebase (Database Management Systems)

GT&MC – Department of Computer Engineering. Page 8


Agro_Vision 2024-25

➢ Programming Languages:
1. Dart:
• Description:
✓ Primary language for Flutter.
✓ Object-oriented, with robust async programming features.
• Role:
✓ Implements UI logic and Firebase integration in the app.
✓ Handles data fetching, state management, and visual updates.

2. Arduino Programming Language (C/C++ Based):


• Description:
✓ Simplified C/C++ environment tailored for embedded development.
• Role:
✓ Sensor control logic for reading and filtering data.
✓ Handles communication between sensors and WiFi module.
✓ Sends data to Firebase for mobile access.

➢ Development Frameworks and Libraries:


1. Flutter Framework:
• Description:
✓ Google’s open-source UI toolkit for building cross-platform apps.
✓ Single codebase for Android & iOS.
• Role:
✓ Builds the UI for mobile apps to display water quality parameters.
✓ Graphs, charts, and alerts are rendered for real-time and historical analysis.

2. Temperature Sensor Library (ex. OneWire, Dallas etc.):


• Description:
✓ OneWire and DallasTemperature libraries allow communication with DS18B20
temperature sensors using the OneWire protocol.
✓ They simplify reading temperature data from multiple sensors on a single data line.
• Role:
✓ Used to read and monitor water temperature accurately in the Sensor & Data
Acquisition Module.

GT&MC – Department of Computer Engineering. Page 9


Agro_Vision 2024-25

3. Firebase Library:
• Description:
✓ Library that allows Arduino devices to communicate with Google Firebase.
✓ Supports real-time database operations like read, write, and update.
• Role:
✓ Stores sensor readings like TDS, temperature, turbidity, and pH.
✓ Allows real-time monitoring of water quality through the mobile application.

GT&MC – Department of Computer Engineering. Page 10


Agro_Vision 2024-25

➢ Database Management System:


1. Firebase Cloud Storage:
• Description:
✓ Google’s cloud-based backend service for real-time data handling.
• Role:
✓ Stores sensor readings (TDS, pH, turbidity, temperature).
✓ Allows the mobile app to retrieve and visualize data anytime.
✓ Supports historical trend analysis and real-time alerts

➢ Integrated Development Environments:


1. Visual Studio Code:
• Description:
✓ A lightweight, open-source code editor developed by Microsoft.
✓ Offers extensions and debugging tools for various languages including C++ and Dart.
• Role:
✓ Used for writing and testing Arduino and Dart code.
✓ Central development environment for both hardware and mobile app modules.

2. Arduino IDE:
• Description:
✓ IDE for writing, compiling, and uploading code to Arduino boards.
• Role:
✓ Interface for developing and debugging microcontroller firmware.
✓ Uses serial monitor for real-time sensor output testing.

The selection of software components is aligned with the system's requirements,


emphasizing compatibility, security, and ease of use. These components work together to
enable the development, deployment, and operation of the Water quality Monitoring System,
ensuring its effectiveness and reliability in Water Quality settings.

GT&MC – Department of Computer Engineering. Page 11


Agro_Vision 2024-25

CHAPTER 4
SYSTEM DESIGN
1.1 DESIGN DOCUMENT
The entire system is projected with a physical diagram which specifics the actual storage
parameters that are physically necessary for any database to be stored on to the disk. The overall
systems existential idea is derived from this diagram.
The relation upon the system is structure through a conceptual ER-Diagram, which not only
specifics the existential entities but also the standard relations through which the system exists
and the cardinalities that are necessary for the system state to continue.
1.2 ER-DIAGRAM
The entity Relationship Diagram (ERD) depicts the relationship between the data objects.
The ERD is the notation that is used to conduct the date modeling activity the attributes of each
data object noted is the ERD can be described resign a data object descriptions.
➢ Components of ER Diagrams:
✓ Entities: Entities are objects or concepts in the real world that are represented in the
database. They can be tangible objects like a person or car, or abstract concepts like a
company or course.
✓ Attributes: Attributes are properties or characteristics of entities. They describe the
features or details of an entity.
✓ Relationships: Relationships define how entities are connected to each other. They
describe the associations or interactions between entities. Relationships can be one-to-
one, one-to-many, or many-to-many.
✓ Diamonds: Diamonds represent relationships between entities in an ER diagram. They
illustrate how entities are connected or associated with each other. The diamond shape
typically contains a label describing the nature of the relationship
✓ Lines: Lines connecting entities to the diamond represent the relationship between
them. The direction of the lines indicates the direction of the relationship, and
cardinality notations near the lines specify how many instances of one entity are related
to how many instances of another entity.
✓ Rectangles: Rectangles represent entities in an ER diagram. Each entity is depicted as
a rectangle, and its name is usually written inside the rectangle.
✓ Ellipses: Ellipses represent attributes in an ER diagram. Attributes describe the

GT&MC – Department of Computer Engineering. Page 12


Agro_Vision 2024-25

Fig. No. 4.1. ER Diagram

GT&MC – Department of Computer Engineering. Page 13


Agro_Vision 2024-25

1.3 DATA FLOW DIAGRAM (DFD)


The DFD is also called as bubble chart. It is a simple graphical formalism that can be used
to represent a system in terms of input data to the system, various processing carried out on this
data, and the output data is generated by this system.
The data flow diagram (DFD) is one of the most important modeling tools. It is used to
model the system components. These components are the system process, the data used by the
process, an external entity that interacts with the system and the information flows in the
system.
DFD shows how the information moves through the system and how it is modified by a
series of transformations. It is a graphical technique that depicts information flow and the
transformations that are applied as data moves from input to output.
DFD is also known as bubble chart. A DFD may be used to represent a system at any level
of abstraction. DFD may be partitioned into levels that represent increasing information flow
and functional detail.
➢ Purpose:
DFDs are used to model the system components and their interactions. They help in
understanding how data moves through the system, undergoes processing, and produces output.
DFDs provide a visual representation of the system's functionality, making it easier to analyze
and design systems.
➢ Components:
✓ Processes: Processes represent the functions or activities performed on the data within
the system. Each process receives input data, performs some processing, and produces
output data.
✓ Data Flows: Data flows represent the movement of data between processes, data stores,
and external entities. They show how data is transmitted from one component to another
within the system.
✓ Data Stores: Data stores represent repositories where data is stored within the system.
They can be databases, files, or any other storage mechanism.
✓ External Entities: External entities represent sources or destinations of data outside
the system. They interact with the system by providing input data or receiving output
data.
✓ Levels of Abstraction: DFDs can be used to represent a system at different levels of
abstraction. They can be divided into levels to depict increasing levels of detail and

GT&MC – Department of Computer Engineering. Page 14


Agro_Vision 2024-25

information flow. Higher level DFDs show a broader view of the system, while lower-
level DFDs provide more detailed insights into the system's processes and data flows.

Fig. No. 4.2(a). Level 0 DFD Diagram

GT&MC – Department of Computer Engineering. Page 15


Agro_Vision 2024-25

1.4 FLOW CHART DIAGRAM


Flowchart is a graphical representation of an algorithm. Programmers often use it as a
program planning tool to solve a problem. It makes use of symbols which are connected among
them to indicate the flow of information and processing. The process of drawing a flowchart
for an algorithm is known as “flowcharting”.
➢ Basic Symbols used in Flowchart Designs
✓ Terminal: The oval symbol indicates Start, Stop and Halt in a program’s logic flow. A
pause/halt is generally used in a program logic under some error conditions. Terminal is
the first and last symbols in the flowchart.
✓ Input/Output: A parallelogram denotes any function of input/output type. Program
instructions that take input from input devices and display output on output devices are
indicated with parallelogram in a flowchart.
✓ Processing: A box represents arithmetic instructions. All arithmetic processes such as
adding, subtracting, multiplication and division are indicated by action or process symbol.
Decision Diamond symbol represents a decision point. Decision based operations such as
yes/no question or true/false are indicated by diamond in flowchart.
✓ Connectors: Whenever flowchart becomes complex or it spreads over more than one page,
it is useful to use connectors to avoid any confusions. It is represented by a circle.
✓ Flow lines: flow lines are the directional arrows or lines that connect different symbols,
shapes, or process steps. They indicate the sequence of steps or the flow of control in a
process. Flow lines typically have arrowheads to show the direction of flow, indicating the
order in which tasks or actions are performed. These lines help users to understand the
logical progression of activities in a direction of flow of control and relationship among
different symbols of flowchart.

GT&MC – Department of Computer Engineering. Page 16


Agro_Vision 2024-25

Fig. No. 4.3. Flowchart Diagram

GT&MC – Department of Computer Engineering. Page 17


Agro_Vision 2024-25

1.5 ACTIVITY DIAGRAM


Activity Diagrams are used to illustrate the flow of control in a system and refer to the steps
involved in the execution of a use case. It is a type of behavioral diagram and we can depict
both sequential processing and concurrent processing of activities using an activity diagram ie
an activity diagram focuses on the condition of flow and the sequence in which it happens.
➢ Purpose:
Activity diagrams are primarily used to model the workflow or business processes within a
system. They can show the sequence of activities, decisions, and parallel activities involved in
a process.
➢ Components:
✓ Activities: Represent tasks or actions performed within the system. They are depicted
as rounded rectangles.
✓ Transitions: Show the flow of control or data between activities. These are represented
by arrows.
✓ Decisions: Represent points in the process where a decision is made, leading to
different paths. They are depicted as diamonds.
✓ Start and End Nodes: Indicate the beginning and end of the process flow. These are
typically shown as circles or ovals. Activity diagrams are a fundamental tool in system
modeling, particularly within the realm of software engineering. They offer a visual
representation of the flow of control within a system, illustrating the steps involved in
executing a specific use case or business process.

The primary purpose of activity diagrams is to model and analyze the workflow or business
processes within a system. They enable stakeholders to visualize the sequence of activities,
decisions, and parallel activities involved in accomplishing a particular task or achieving a
specific goal. By representing these processes graphically, activity diagrams

GT&MC – Department of Computer Engineering. Page 18


Agro_Vision 2024-25

Fig. No. 4.4. Activity Diagram

GT&MC – Department of Computer Engineering. Page 19


Agro_Vision 2024-25

1.6 USE CASE DIAGRAM


A use case diagram shows a set of use cases and actors and their relationships. Use case
diagrams address the static use case view of a system. These diagrams are especially important
in organizing and modeling the behaviors of a system. A use case diagram is a just a special
kind of diagram and shares the same common properties as do all other diagrams. A use case
diagram differs from all other kinds of diagrams in its particular content.
➢ Contents:
✓ Use case:

Use case is a description of set of sequence of actions that a system performs that yields an
observable result of value to a particular actor. A use case is used to structure the behavioral
things in a model. A use case is realized by collaboration. Graphically a use case is rendered
as an ellipse with solid lines, usually including only its name, as shown below.

Place order

Fig.4.5(a) Use Case

GT&MC – Department of Computer Engineering. Page 20


Agro_Vision 2024-25

✓ Relationships:

Dependency is a semantic relationship between two things in which a change to one thing
may affect the semantics of the other thing. Graphically, a dependency is rendered as a dashed
line, possibly directed, and occasionally including a label. As in below.

Dependency
Fig.4.5(b) Dependency

An association is a structural relationship that describes a set of links, a link being a


connection among objects. Aggregation is a special kind of association, representing a
structural relationship between a whole and its parts. Graphically, an association is rendered as
a solid line, possibly directed, occasionally including a label.

0….1 *
Association
Fig.4.5(c) Association

A generalization is a specialization / generalization relationship in which objects of the


specialized element (child) are substitutable for objects of the generalized element (parent).
Graphically, a generalization relationship is rendered as a solid line with a hollow arrow head
pointing to the parent.

Generalization
Fig.4.5(d) Generalization

GT&MC – Department of Computer Engineering. Page 21


Agro_Vision 2024-25

Actor

Fig. No. 4.5 (e). Use Case Diagram

GT&MC – Department of Computer Engineering. Page 22


Agro_Vision 2024-25

1.7 BLOCK DIAGRAM


A block diagram is a visual representation of a system, process, or concept using simple
geometric shapes such as rectangles, circles, ovals, or squares connected by lines or arrows to
show the relationships between components. It is a high-level diagram that provides an
overview of the system's structure or operation, focusing on the interactions and connections
between its major components or subsystems.
Block diagrams are widely used in various fields, including engineering, electronics,
software development, and business analysis, to illustrate the flow of information, signals, or
materials through a system. They help in understanding complex systems by breaking them
down into simpler components and showing how these components interact with each other.

GT&MC – Department of Computer Engineering. Page 23


Agro_Vision 2024-25

Circuit Digrams:

1.8 CROP HEALTH MANAGEMENT

Fig. 1.8 Crop Health Managemnt

By analysing sensor measurements of nutrients in the soils, the system uses an AI to examine data
suggest the fertilizer recommended for crops for a healthy growth & improvement.

his system utilizes sensor measurements to analyze the levels of essential soil nutrients (NPK –
Nitrogen, Phosphorus, Potassium). By leveraging Artificial Intelligence, it interprets the data to assess
soil fertility and diagnose nutrient deficiencies. Based on this analysis, it intelligently recommends the
appropriate type and amount of fertilizer needed for optimal crop growth. This approach not only
enhances crop yield and health but also promotes efficient use of resources, supporting sustainable
agriculture practices.

GT&MC – Department of Computer Engineering. Page 24


Agro_Vision 2024-25

1.9 SMART IRRIGATION SYSTEM

Fig. 1.9 Smart Irrigation System

The water pump operations are automated using real-time data from pH, soil moisture, temperature,
humidity, & solar intensity sensors. This ensures crop/plants get the right amount of water while saving
resources. under different environmental conditions.

The smart irrigation system automates water pump operations using real-time data from multiple
sensors, including pH, soil moisture, temperature, humidity, and solar intensity. By continuously
monitoring these environmental conditions, the system ensures that crops and plants receive the
optimal amount of water when needed. This intelligent approach conserves water, enhances plant
health, and adapts to changing weather and soil conditions for efficient and sustainable farming

GT&MC – Department of Computer Engineering. Page 25


Agro_Vision 2024-25

1.10 Animal Detection

Fig. 1.10 Animal Detection

The system employs motion sensors to detect the presence and movement of pests or animals near
the crops. When activity is detected, it automatically triggers an alarm or alert mechanism to deter
intrusions. This real-time response helps protect crops from damage caused by pests feeding on
them, ensuring better yield and reducing the need for manual monitoring.

GT&MC – Department of Computer Engineering. Page 26


Agro_Vision 2024-25

1.11 Automatic Control Electric Appliances

Fig. 1.11 Automatic control electric appliances

This system automates the operation of farm electrical appliances, helping optimize energy
usage and reduce power wastage. It intelligently controls devices like lights and motors based on
real-time conditions and schedules. Additionally, it sends notifications to the farmer indicating
whether appliances, such as lights, are turned on or off, ensuring better monitoring and control
from anywhere

GT&MC – Department of Computer Engineering. Page 27


Agro_Vision 2024-25

CHAPTER 5
SYSTEM IMPLEMENTATION
5.1 SOFTWARE CODE:

1.1 First page :

import 'package:flutter/material.dart';
import 'package:curved_navigation_bar/curved_navigation_bar.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_database/firebase_database.dart';
import 'firebase_options.dart';
// Screens
import 'package:vision/login/login.dart';
import 'package:vision/splashscreen.dart';
import 'package:vision/otp_verification.dart';
import 'package:vision/DashboardScreen.dart';
import 'package:vision/crophealth.dart';
import 'package:vision/smartirr.dart';
import 'package:vision/animaldetect.dart';
import 'package:vision/appliacontrol.dart';
import 'package:vision/chat_screen.dart';
import 'package:vision/schemes_page.dart'; // Government Schemes Page
FirebaseFirestore firestore = FirebaseFirestore.instance;
final databaseRef = FirebaseDatabase.instance.ref();
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
runApp(const AgroVisionApp());
}
class AgroVisionApp extends StatelessWidget {
const AgroVisionApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,

GT&MC – Department of Computer Engineering. Page 28


Agro_Vision 2024-25

theme: ThemeData(primarySwatch: Colors.green),

initialRoute: '/',
routes: {
'/': (context) => const SplashScreen(),
'/login': (context) => const LoginPage(),
'/otp': (context) => const OTPVerificationPage(),
'/home': (context) => const HomeScreen(),
'/chat': (context) => ChatScreen(),
'/schemes': (context) => SchemesPage(), // Govt Schemes route
},
);
}
}
class HomeScreen extends StatefulWidget {
const HomeScreen({super.key});
@override
State<HomeScreen> createState() => _HomeScreenState();
}
class _HomeScreenState extends State<HomeScreen> {
int _currentIndex = 0;
final PageController _pageController = PageController();
final List<Widget> _screens = [
const DashboardScreen(),
const CropHealthScreen(),
const SmartIrrigationScreen(),
const AnimalDetectionScreen(),
const ApplianceControlScreen(),
SchemesPage(), // Govt Schemes Page
];
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text("AgroVision"),
backgroundColor: Colors.green[800],
actions: [
IconButton(

GT&MC – Department of Computer Engineering. Page 29


Agro_Vision 2024-25
icon: const Icon(Icons.logout),
onPressed: () {
Navigator.pushReplacementNamed(context, '/login');
},
),
],
),
drawer: Drawer(
child: Container(
color: Colors.lightGreen[100],
child: ListView(
padding: EdgeInsets.zero,
children: [
UserAccountsDrawerHeader(
accountName: const Text("Farmer Name"),
accountEmail: const Text("[email protected]"),
currentAccountPicture: const CircleAvatar(
backgroundImage: NetworkImage ('https://i.postimg.cc/Hn4tJPpg/Whats-App-Image-
2025-04-05-at-13-42-34-2077099e.jpg'),
),
decoration: BoxDecoration(color: Colors.green[800]),
),
ListTile(
leading: const Icon(Icons.person),
title: const Text("Profile"),
onTap: () {
// Implement navigation or function
},
),
ListTile(
leading: const Icon(Icons.help),
title: const Text("Help & Support"),

onTap: () {
// Implement navigation or function
},
),
ListTile(
leading: const Icon(Icons.chat),

GT&MC – Department of Computer Engineering. Page 30


Agro_Vision 2024-25

title: const Text("Chat with Vision AI"),


onTap: () {
Navigator.pushNamed(context, '/chat');
},
),
ListTile(
leading: const Icon(Icons.policy),
title: const Text("Govt Schemes"),
onTap: () {
Navigator.pushNamed(context, '/schemes');
},
),
ListTile(
leading: const Icon(Icons.logout),
title: const Text("Logout"),
onTap: () {
Navigator.pushReplacementNamed(context, '/login');
},
),
],
),
),
),
body: PageView(
controller: _pageController,
physics: const BouncingScrollPhysics(),
onPageChanged: (index) {
setState(() {
_currentIndex = index;
});
},
children: _screens,
),
bottomNavigationBar: CurvedNavigationBar(
backgroundColor: Colors.white,
color: Colors.green.shade800,
buttonBackgroundColor: Colors.white,
height: 60,

GT&MC – Department of Computer Engineering. Page 31


Agro_Vision 2024-25

animationDuration: const Duration(milliseconds: 300),


index: _currentIndex,
items: const [
Icon(Icons.dashboard, size: 30, color: Colors.green),
Icon(Icons.agriculture, size: 30, color: Colors.green),
Icon(Icons.water, size: 30, color: Colors.green),
Icon(Icons.pets, size: 30, color: Colors.green),
Icon(Icons.electrical_services, size: 30, color: Colors.green),
Icon(Icons.account_balance_wallet, size: 30, color: Colors.green), // Govt Schemes
],
onTap: (index) {
_pageController.jumpToPage(index);
setState(() => _currentIndex = index);
},
),
);
}
}

GT&MC – Department of Computer Engineering. Page 32


Agro_Vision 2024-25

1.2 Splashscreen code:

Importz'package:animated_splash_screen/animated_splash_screen.dart';
import 'package:vision/frontpage.dart';
import 'package:flutter/material.dart';
class SplashScreen extends StatelessWidget {
const SplashScreen({super.key});
@override
Widget build(BuildContext context) {
return AnimatedSplashScreen(
duration: 4000,
backgroundColor: Colors.white,
splash: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
height: 200, // Adjust height as needed
child: Image.network(
"blob:https://manage.wix.com/f491cd97-456d-4d6c-a749-f373dba6f375",
fit: BoxFit.contain, ), ),
const SizedBox(height: 20), // Adds spacing
const Text(
'Empowering Farmers with Smart Solutions for a Sustainable Future.',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
color: Colors.green,
fontStyle: FontStyle.italic,
), ), ], ),
nextScreen: const FrontPage(), // Ensure this class exists
splashIconSize: 300,
); }}

GT&MC – Department of Computer Engineering. Page 33


Agro_Vision 2024-25

Output of Splash Screen

GT&MC – Department of Computer Engineering. Page 34


Agro_Vision 2024-25

1.3 Front Page code:

import 'package:flutter/material.dart';
import 'package:vision/login/login.dart';
import 'package:vision/login/registration.dart';
class FrontPage extends StatefulWidget {
const FrontPage({super.key});
@override
State<FrontPage> createState() => _FrontPageState();
}
class _FrontPageState extends State<FrontPage>
with SingleTickerProviderStateMixin {
late AnimationController _controller;
late Animation<Offset> _slideAnimation;
late Animation<double> _fadeAnimation;
@override
void initState() {
super.initState();
_controller = AnimationController(
vsync: this,
duration: const Duration(milliseconds: 800),
);
_slideAnimation = Tween<Offset>(
begin: const Offset(0, 1),
end: Offset.zero,
).animate(CurvedAnimation(parent: _controller, curve: Curves.easeOut));
_fadeAnimation = CurvedAnimation(parent: _controller, curve: Curves.easeIn);
_controller.forward();
}
@override
void dispose() {
_controller.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: SingleChildScrollView(

GT&MC – Department of Computer Engineering. Page 35


Agro_Vision 2024-25

child: Column(
children: [
FadeInImage(
placeholder: const AssetImage('assets/placeholder.jpg'),
image: const NetworkImage(
'https://static.vecteezy.com/system/resources/previews/046/305/742/non_2x/indian-
farmer-showing-smartphone-technology-concept-vector.jpg',
),
fadeInDuration: const Duration(seconds: 2),
fit: BoxFit.cover,
width: 390,
height: 500,
),
const SizedBox(height: 10),
FadeTransition(
opacity: _fadeAnimation,
child: const Text(
'YOU can easily operate',
style: TextStyle(fontSize: 22, fontWeight: FontWeight.bold),
),
),
FadeTransition(
opacity: _fadeAnimation,
child: const Text(
'From Smartphone',
style: TextStyle(fontSize: 22, fontWeight: FontWeight.bold),
),
),
const SizedBox(height: 10),
FadeTransition(
opacity: _fadeAnimation,
child: const Text(
'The No.1 App for the Farming Sector',
style: TextStyle(fontSize: 16, color: Colors.green),
),
),
const SizedBox(height: 10),
SlideTransition(

GT&MC – Department of Computer Engineering. Page 36


Agro_Vision 2024-25

position: _slideAnimation,
child: ElevatedButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const RegistrationPage(),
),
);
},
style: ElevatedButton.styleFrom(
backgroundColor: Colors.green,
padding:
const EdgeInsets.symmetric(horizontal: 30, vertical: 10),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15),
),
),
child: const Text(
'Register',
style: TextStyle(fontSize: 20, color: Colors.white),
),
),
),
const SizedBox(height: 10),
SlideTransition(
position: _slideAnimation,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text('Already have an account?'),
TextButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const LoginPage(),
),

GT&MC – Department of Computer Engineering. Page 37


Agro_Vision 2024-25

);
},
child: const Text(
'Log in',
style: TextStyle(
color: Colors.green,
fontWeight: FontWeight.bold,
),
),
),
FrontPage code output

),
),
],
),
),
);
}
}

GT&MC – Department of Computer Engineering. Page 38


Agro_Vision 2024-25

1.4 LoginPage code :

import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:vision/otp_verification.dart';
import 'registration.dart';
class LoginPage extends StatefulWidget {
const LoginPage({super.key});
@override
State<LoginPage> createState() => _LoginPageState();
}
class _LoginPageState extends State<LoginPage> {
final TextEditingController _usernameController = TextEditingController();
final TextEditingController _passwordController = TextEditingController();
bool _obscurePassword = true;
Future<void> _login() async {
String username = _usernameController.text;
String password = _passwordController.text;
if (username == '[email protected]' && password == 'Pass1234') {
SharedPreferences prefs = await SharedPreferences.getInstance();
await prefs.setBool('isLoggedIn', true);
Navigator.push(
context,
MaterialPageRoute(builder: (context) => OTPVerificationPage()),
);
} else {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('Invalid username or password')),
);
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Stack(
children: [
// Background Image
GT&MC – Department of Computer Engineering. Page 39
Agro_Vision 2024-25
Positioned.fill(
child: Image.network(
'https://th.bing.com/th/id/OIP.DjudtImYiLWN0axt_dgVuAHaE8?w=244&h=180&c=7&r=0
&o=5&dpr=1.3&pid=1.7', // Add an agriculture-themed image
fit: BoxFit.cover,
),
),
// Gradient Overlay
Positioned.fill(
child: Container(
color: Colors.black.withOpacity(0.3),
),
),
// Login Card
Center(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: Card(
elevation: 8,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
),
child: Padding(
padding: const EdgeInsets.all(25),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(
"LOGIN",
style: GoogleFonts.poppins(
fontSize: 26,
fontWeight: FontWeight.bold,
color: Colors.green.shade700,
),
),
const SizedBox(height: 20),
// Username Field
TextField(
controller: _usernameController,

GT&MC – Department of Computer Engineering. Page 40


Agro_Vision 2024-25

decoration: InputDecoration(
labelText: "User ID",
prefixIcon:
const Icon(Icons.person, color: Colors.green),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(15),
),
),
),
const SizedBox(height: 15),
// Password Field
TextField(
controller: _passwordController,
obscureText: _obscurePassword,
decoration: InputDecoration(
labelText: "Password",
prefixIcon:
const Icon(Icons.lock, color: Colors.green),
suffixIcon: IconButton(
icon: Icon(
_obscurePassword
? Icons.visibility_off
: Icons.visibility,
color: Colors.green,
),
onPressed: () {
setState(() {
_obscurePassword = !_obscurePassword;
});
},
),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(15),
),
),
),
const SizedBox(height: 15),
// Login Button

GT&MC – Department of Computer Engineering. Page 41


Agro_Vision 2024-25

ElevatedButton(
onPressed: _login,
style: ElevatedButton.styleFrom(
backgroundColor: Colors.green.shade700,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15),
),
padding: const EdgeInsets.symmetric(
vertical: 15, horizontal: 100),
),
child: const Text(
"Login",
style: TextStyle(fontSize: 18, color: Colors.white),
),
),
const SizedBox(height: 10),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
TextButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
const RegistrationPage()),
);
},
child: const Text("Register",
style: TextStyle(color: Colors.green)),
),
TextButton(
onPressed: () {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text("Forgot Password Clicked!")),
);

GT&MC – Department of Computer Engineering. Page 42


Agro_Vision 2024-25

},
child: const Text("Forgot Password?",
style: TextStyle(color: Colors.green)),

],

),
],
), LoginPage code output

),
),
),
),
],
),
);
}
}

GT&MC – Department of Computer Engineering. Page 43


Agro_Vision 2024-25

1.5 Dashboard code:

import 'package:flutter/material.dart';
class DashboardScreen extends StatefulWidget {
const DashboardScreen({super.key});
@override
_DashboardScreenState createState() => _DashboardScreenState();
}
class _DashboardScreenState extends State<DashboardScreen> {
double temperature = 35.0; // Example sensor value
double soilMoisture = 20.0;
bool isAnimalDetected = false;
bool isPowerAvailable = false;
Map<String, bool> alerts = {};
@override
void initState() {
super.initState();
checkAlerts();
}
void checkAlerts() {
alerts.clear();
if (temperature > 30) {
alerts["High Temperature: $temperature°C! Take precautions."] = true;
}
if (soilMoisture < 30) {
alerts["Low Soil Moisture: $soilMoisture%! Consider irrigation."] = true;
}
if (isAnimalDetected) {
alerts["Animal Detected! Check farm security."] = true;
}
if (!isPowerAvailable) {
alerts["Farm Power Issue: Light might be OFF."] = true;
}
setState(() {});
}
void dismissAlert(String alert) {
setState(() {

GT&MC – Department of Computer Engineering. Page 44


Agro_Vision 2024-25

alerts.remove(alert);
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.green[50],
appBar: AppBar(
title: const Text("Smart Agriculture Dashboard"),
backgroundColor: Colors.green,
),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
"Important Alerts & Warnings",
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: Colors.redAccent),
),
const SizedBox(height: 10),
alerts.isEmpty
? const Center(
child: Text(
" No alerts. Everything is fine!",
style: TextStyle(fontSize: 16, color: Colors.green),
),
)
: Expanded(
child: ListView.builder(
itemCount: alerts.length,
itemBuilder: (context, index) {
String alert = alerts.keys.elementAt(index);
return Dismissible(
key: Key(alert),

GT&MC – Department of Computer Engineering. Page 45


Agro_Vision 2024-25

direction: DismissDirection.endToStart,
onDismissed: (direction) => dismissAlert(alert),
background: Container(
color: Colors.green,
alignment: Alignment.centerRight,
padding: const EdgeInsets.only(right: 20.0),
child: const Icon(Icons.check, color: Colors.white),
),
child: Card(
color: Colors.white,
margin: const EdgeInsets.symmetric(vertical: 5),
child: ListTile(
leading:
const Icon(Icons.warning, color: Colors.red),
title: Text(
alert,
style: const TextStyle(
fontSize: 16, fontWeight: FontWeight.w500),
),
trailing: IconButton(icon:
const Icon(Icons.done, color: Colors.green),
onPressed: () => dismissAlert(alert),
),
),
),
);
},
),
),
],
),
),
);
}
}

GT&MC – Department of Computer Engineering. Page 46


Agro_Vision 2024-25

Dashboard code output

GT&MC – Department of Computer Engineering. Page 47


Agro_Vision 2024-25

1.6 CropHealth Page code :

import 'package:flutter/material.dart';
class CropHealthScreen extends StatefulWidget {
const CropHealthScreen({super.key});
@override
_CropHealthScreenState createState() => _CropHealthScreenState();
}
class _CropHealthScreenState extends State<CropHealthScreen> {
// NPK values (example data)
int nitrogen = 20; // Example N value
int phosphorus = 30; // Example P value
int potassium = 40; // Example K value
// Soil sensor data (example data)
int soilMoisture = 60; // Example soil moisture value
double phLevel = 6.5; // Example pH value
double temperature = 25.0; // Example temperature in Celsius
double humidity = 55.0; // Example humidity value
int _selectedIndex = 0; // Track selected tab (0 for NPK, 1 for Soil Sensors)
String getFertilizerSuggestion() {
if (nitrogen < 50) {
return "Low Nitrogen: Use organic compost or manure.";
} else if (phosphorus < 40) {
return "Low Phosphorus: Use bone meal or rock phosphate.";
} else if (potassium < 50) {
return "Low Potassium: Use wood ash or potassium sulfate.";
} else {
return "Nutrients are balanced. No fertilizer needed.";
}
}
// Method to handle soil sensor display
Widget _buildSoilSensorCard(String name, String value, Color color) {
return Card(
child: ListTile(
leading: Icon(Icons.grass, color: color, size: 30),
title: Text(name, style: const TextStyle(fontWeight: FontWeight.bold)),
subtitle: Text("Value: $value"),

GT&MC – Department of Computer Engineering. Page 48


Agro_Vision 2024-25

),
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text("Crop Health"),
),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Toggle between NPK and Soil Sensor modules
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
ElevatedButton(
onPressed: () {
setState(() {
_selectedIndex = 0; // NPK module
});
},
child: Text("NPK"),
),
SizedBox(width: 10),
ElevatedButton(
onPressed: () {
setState(() {
_selectedIndex = 1; // Soil Sensors module
});
},
child: Text("Soil Sensors"),
),
],
),
const SizedBox(height: 20),

GT&MC – Department of Computer Engineering. Page 49


Agro_Vision 2024-25

// Display content based on the selected module


_selectedIndex == 0
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text("Soil Nutrient Levels",
style: TextStyle(
fontSize: 22, fontWeight: FontWeight.bold)),
const SizedBox(height: 10),
_buildNutrientCard(
"Nitrogen (N)", nitrogen, 50, Colors.green),
_buildNutrientCard(
"Phosphorus (P)", phosphorus, 40, Colors.blue),
_buildNutrientCard(
"Potassium (K)", potassium, 50, Colors.orange),
const SizedBox(height: 20),
Container(
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color: Colors.yellow.shade100,
borderRadius: BorderRadius.circular(10),
),
child: Row(
children: [
const Icon(Icons.info, color: Colors.orange),
const SizedBox(width: 10),
Expanded(
child: Text(
getFertilizerSuggestion(),
style: const TextStyle(
fontSize: 16, fontWeight: FontWeight.w600),
),
),
],
),
),
],
)

GT&MC – Department of Computer Engineering. Page 50


Agro_Vision 2024-25

: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text("Soil Sensor Readings",
style: TextStyle(
fontSize: 22, fontWeight: FontWeight.bold)),
const SizedBox(height: 10),
_buildSoilSensorCard(
"Soil Moisture", "$soilMoisture%", Colors.green),
_buildSoilSensorCard("pH Level", "$phLevel", Colors.blue),
_buildSoilSensorCard(
"Temperature", "$temperature°C", Colors.orange),
_buildSoilSensorCard(
"Humidity", "$humidity%", Colors.purple),
],
),
],
),
),
);
}
Widget _buildNutrientCard(String name, int value, int minValue, Color color) {
return Card(

child: ListTile(
leading: Icon(Icons.grass, color: color, size: 30),
title: Text(name, style: const TextStyle(fontWeight: FontWeight.bold)),
subtitle: Text("Value: $value"),
trailing: Text(
value < minValue ? "Low" : "Normal",
style: TextStyle(
color: value < minValue ? Colors.red : Colors.green,
fontWeight: FontWeight.bold,
),
),
),
);
}

GT&MC – Department of Computer Engineering. Page 51


Agro_Vision 2024-25

CropHealth page output

GT&MC – Department of Computer Engineering. Page 52


Agro_Vision 2024-25

1.7 Smart Irrigation code :

import 'package:flutter/material.dart';
class SmartIrrigationScreen extends StatefulWidget {
const SmartIrrigationScreen({super.key});
@override
_SmartIrrigationScreenState createState() => _SmartIrrigationScreenState();
}
class _SmartIrrigationScreenState extends State<SmartIrrigationScreen> {
// Sample sensor data
double soilMoisture = 75.0;
double temperature = 30.0;
double humidity = 60.0;
String lightIntensity = "High";
double raindropSensor = 0.0;
bool isWaterOn = false;
// Toggle the irrigation status
void toggleIrrigation() {
setState(() {
isWaterOn = !isWaterOn;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text("Smart Irrigation Dashboard")),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
"Smart Agriculture Dashboard",
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: Colors.green),

GT&MC – Department of Computer Engineering. Page 53


Agro_Vision 2024-25

),
const SizedBox(height: 16),
Expanded(
child: GridView.count(
crossAxisCount: 2,
crossAxisSpacing: 10,
mainAxisSpacing: 10,
children: [
_buildSensorCard("Soil Moisture", "$soilMoisture%",
Icons.water, Colors.blue),
_buildSensorCard("Temperature", "$temperature°C",
Icons.thermostat, Colors.red),
_buildSensorCard(
"Humidity", "$humidity%", Icons.cloud, Colors.teal),
_buildSensorCard("Light Intensity", lightIntensity,
Icons.wb_sunny, Colors.orange),
_buildSensorCard(
"Raindrop Sensor",
raindropSensor == 0.0 ? "No Rain" : "Rain Detected",
raindropSensor == 0.0 ? Icons.grain : Icons.beach_access,
raindropSensor == 0.0 ? Colors.blueGrey : Colors.blue),
],
),
),
const SizedBox(height: 20),
Center(
child: ElevatedButton.icon(
onPressed: toggleIrrigation,
style: ElevatedButton.styleFrom(
backgroundColor: isWaterOn
? Colors.green
: Color.fromARGB(255, 164, 32, 140), // Change color ),
icon: Icon(Icons.water_drop, color: Colors.white, size: 24),
label: Text(
isWaterOn ? "Turn Off Irrigation" : "Turn On Irrigation",
style: const TextStyle(
fontSize: 18,

GT&MC – Department of Computer Engineering. Page 54


Agro_Vision 2024-25

fontWeight: FontWeight.bold,
color: Colors.white),
),),),],),),);}
Widget _buildSensorCard(
String title, String value, IconData icon, Color iconColor) {
return Card(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
elevation: 4,
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(icon, size: 40, color: iconColor),
const SizedBox(height: 8),
Text(title, style: const TextStyle(fontWeight: FontWeight.bold)),
const SizedBox(height: 4),
Text(value,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: iconColor)),
],
),
),
);
}
}

GT&MC – Department of Computer Engineering. Page 55


Agro_Vision 2024-25

Smart irrigation page output

GT&MC – Department of Computer Engineering. Page 56


Agro_Vision 2024-25

1.8 Animal detection code :

import 'package:flutter/material.dart';
class AnimalDetectionScreen extends StatefulWidget {
const AnimalDetectionScreen({super.key});
@override
_AnimalDetectionScreenState createState() => _AnimalDetectionScreenState();
}
class _AnimalDetectionScreenState extends State<AnimalDetectionScreen> {
bool isAnimalDetected = false; // PIR sensor state
bool isBuzzerOn = false; // Buzzer state
@override
void initState() {
super.initState();
_simulateAnimalDetection(); // Simulate PIR sensor behavior
}
// Function to simulate PIR sensor detecting movement
void _simulateAnimalDetection() {
Future.delayed(const Duration(seconds: 3), () {
setState(() {
isAnimalDetected = true;
isBuzzerOn = true; // Buzzer turns ON when an animal is detected
});
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text(" Animal Detected! Buzzer is ON."),
duration: Duration(seconds: 3),
backgroundColor: Colors.red,
),
);
// Reset detection after 5 seconds
Future.delayed(const Duration(seconds: 5), () {
setState(() {
isAnimalDetected = false;
isBuzzerOn = false;
});
});

GT&MC – Department of Computer Engineering. Page 57


Agro_Vision 2024-25

});
}

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text("Animal Detection"),
backgroundColor: Colors.brown.shade700,
),
body: Center(
child: Card(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)),
elevation: 5,
color: isAnimalDetected ? Colors.red[200] : Colors.white,
child: Padding(
padding: const EdgeInsets.all(20.0),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Icon(
isAnimalDetected ? Icons.warning : Icons.check_circle,
size: 80,
color: isAnimalDetected ? Colors.red : Colors.green,
),
const SizedBox(height: 10),
const Text(
"Animal Detection Status",
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),

),
const SizedBox(height: 10),
Text(
isAnimalDetected ? " Animal Detected!" : " No Animals Nearby",
style: TextStyle(
fontSize: 22,
fontWeight: FontWeight.bold,

GT&MC – Department of Computer Engineering. Page 58


Agro_Vision 2024-25

color: isAnimalDetected ? Colors.red[800] : Colors.green[800]),


),
const SizedBox(height: 10),
Text(
"Buzzer Status: ${isBuzzerOn ? "ON " : "OFF "}",
style: TextStyle(fontSize: 16, color: Colors.grey[700]),
),
const SizedBox(height: 20),
ElevatedButton(
onPressed: () {
setState(() {
isBuzzerOn = !isBuzzerOn; // Toggle buzzer manually
}); },
style: ElevatedButton.styleFrom(
backgroundColor: isBuzzerOn ? Colors.red : Colors.green,
),
child: Text(isBuzzerOn ? "Turn Buzzer OFF" : "Turn Buzzer ON"),
),], ),
),
),
),
); }}

GT&MC – Department of Computer Engineering. Page 59


Agro_Vision 2024-25

Animal Detection code output

GT&MC – Department of Computer Engineering. Page 60


Agro_Vision 2024-25

1.9 Electric appliances code:

import 'package:flutter/material.dart';
class ApplianceControlScreen extends StatefulWidget {
const ApplianceControlScreen({super.key});
@override
_ApplianceControlScreenState createState() => _ApplianceControlScreenState();
}
class _ApplianceControlScreenState extends State<ApplianceControlScreen> {
double ldrValue = 450; // Simulated LDR sensor value
bool isLightOn = false;
@override
void initState() {
super.initState();
_checkLdrSensor();
}
// Function to check LDR sensor value and determine if light is ON or OFF
void _checkLdrSensor() {
setState(() {
isLightOn = ldrValue > 500; // Assume light is ON if LDR value > 500
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text("Appliance Control"),
backgroundColor: Colors.green.shade700,
),
body: Center(
child: Card(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)),
elevation: 5,
color: isLightOn ? Colors.green[200] : Colors.white,
child: Padding(
padding: const EdgeInsets.all(20.0),
child: Column(

GT&MC – Department of Computer Engineering. Page 61


Agro_Vision 2024-25

mainAxisSize: MainAxisSize.min,
children: [
Icon(
Icons.lightbulb,
size: 80,
color: isLightOn ? Colors.green : Colors.grey,
),
const SizedBox(height: 10),
const Text(
"Farm Light Status",
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
),
const SizedBox(height: 10),
Text(
isLightOn ? "ON" : "OFF",
style: TextStyle(
fontSize: 22,
fontWeight: FontWeight.bold,
color: isLightOn ? Colors.green[800] : Colors.red),
),
const SizedBox(height: 10),
Text(
"LDR Sensor Value: $ldrValue",
style: TextStyle(fontSize: 16, color: Colors.grey[700]),
),
const SizedBox(height: 20),
ElevatedButton(
onPressed: () {
setState(() {
ldrValue = ldrValue > 500 ? 400 : 600; // Toggle LDR value
_checkLdrSensor();
});
},
child: const Text("Simulate Light Change"),
),
],
),
),

GT&MC – Department of Computer Engineering. Page 62


Agro_Vision 2024-25

),

),
);
}
}

Electric appliances page output

GT&MC – Department of Computer Engineering. Page 63


Agro_Vision 2024-25

1.10 Gov Scheme code

import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
enum Language { english, hindi, marathi }
Language currentLanguage = Language.english;
class SchemesPage extends StatelessWidget {
final List<Map<String, dynamic>> schemes = [
{
'title': {
'english': 'PM-KISAN (Pradhan Mantri Kisan Samman Nidhi)',
'hindi': 'प्रध नमांत्री िकस न सम्म न िनिध योजन ',
'marathi': 'पांतप्रध न िकस न सन्म न िनधी योजन '
},
'description': {
'english': '₹6000/year for eligible farmers in 3 installments.',
'hindi': 'प त्र िकस नोां को ₹6000 प्रित वर्ष तीन िकश्ोां में।',
'marathi': 'प त्र शतकऱय ांन ₹6000 दरवर्ी तीन हप्त् ांत िदल ज त.'
},
'steps': {
'english': [
'Go to https://pmkisan.gov.in',
'Click on “Farmer Corner” → “New Farmer Registration”',
'Enter Aadhaar, choose state, fill form',
'Upload documents & submit'
],
'hindi': [
'https://pmkisan.gov.in पर ज एां ',
'“Farmer Corner” → “New Farmer Registration” क्लिक करें ',
'आध र दजष करें , र ज्य चुनें, फॉमष भरें ',
'दस्त वज िपलोड करें और सबिमट करें '
],
'marathi': ['https://pmkisan.gov.in ल भट द्य ',
'“Farmer Corner” → “New Farmer Registration” क्लिक कर ',
'आध र ट क , र ज्य िनवड , फॉमष भर ',

GT&MC – Department of Computer Engineering. Page 64


Agro_Vision 2024-25

'क गदपत्र िपलोड कर आिण सबिमट कर '


]
},
'documents': {
'english': ['Aadhaar Card', 'Bank Passbook', 'Land Ownership Proof'],
'hindi': ['आध र क डष ', 'बैंक प सबुक', 'भूिम क स्व िमत्व क प्रम ण'],
'marathi': ['आध र क डष ', 'बँक प सबुक', 'जिमनीच म लकी हक्क च पुर व ']
},
'url': 'https://pmkisan.gov.in/'
},
{
'title': {
'english': 'Shiv Bhojan Thali Scheme',
'hindi': 'िशव भोजन थ ली योजन ',
'marathi': 'िशवभोजन थ ळी योजन '
},
'description': {
'english': 'Nutritious meal at ₹5 for poor citizens.',
'hindi': 'गरीब न गररकोां को ₹5 में पोर्क आह र।',
'marathi': 'गररब न गररक ांस ठी ₹5 मध्य पौििक जवण.'
},
'steps': {
'english': [
'Visit nearest Shiv Bhojan canteen',
'Pay ₹5 and collect meal coupon',
'Enjoy nutritious meal on-site'
],
'hindi': [
'नज़दीकी िशव भोजन कैंटीन ज एां ',
'₹5 क कूपन लें',
'स्थल पर भोजन करें '
],
'marathi': [
'जवळच्य िशवभोजन कॅंटीनमध्य ज ',
'₹5 कूपन घ्य ',
'स्थळी जवण कर '

GT&MC – Department of Computer Engineering. Page 65


Agro_Vision 2024-25

]
},
'documents': {
'english': ['No document required'],
'hindi': ['कोई दस्त वज़ आवश्यक नहीां'],
'marathi': ['कोणतही क गदपत्र आवश्यक न हीत']
},
'url': 'https://mahafood.gov.in'
},
{
'title': {
'english': 'Mahatma Jyotiba Phule Shetkari Karjmukti Yojana',
'hindi': 'मह त्म ज्योितब फुल िकस न कजषम फी योजन ',
'marathi': 'मह त्म फुल शतकरी कजषमुक्ती योजन '
},
'description': {
'english': 'Loan waiver up to ₹2 lakh for small/marginal farmers.',
'hindi': 'सीम ांत िकस नोां क िलए ₹2 ल ख तक की कजष म फी।',
'marathi': 'सीम ांत शतकऱय ांस ठी ₹2 ल ख पयंत कजषम फी.'
},
'steps': {
'english': [
'Go to nearest agriculture office',
'Submit loan documents and Aadhaar',
'Wait for verification and approval'
],
'hindi': [
'नजदीकी कृिर् क य षलय ज एां ',
'कजष और आध र दस्त वज़ जम करें ',
'सत्य पन और मांज़ूरी की प्रतीक्ष करें '
],
'marathi': [
'जवळच्य कृर्ी क य षलय त ज ',
'कज षच व आध र क गदपत्र द्य ',
'सत्य पन आिण मांजुरीची व ट पह '
]

GT&MC – Department of Computer Engineering. Page 66


Agro_Vision 2024-25

},
'documents': {
'english': ['Loan Document', 'Aadhaar Card', 'Bank Passbook'],
'hindi': ['कजष दस्त वज़', 'आध र क डष ', 'बैंक प सबुक'],
'marathi': ['कजष क गदपत्र', 'आध र क डष ', 'बँक प सबुक']
},
'url': 'https://krishi.maharashtra.gov.in'
},
{
'title': {
'english': 'Baliraja Chetna Abhiyan',
'hindi': 'बलीर ज चतन ििभय न',
'marathi': 'बळीर ज चतन ििभय न'
},
'description': {
'english': 'Support program for farmers in distress.',
'hindi': 'सांकटग्रस्त िकस नोां क िलए सह यत क यषक्रम।',
'marathi': 'िडचणीत िसलल्य शतकऱय ांस ठी मदत क यषक्रम.'
},
'steps': {
'english': [
'Approach village officer or talathi',
'Submit farmer distress details',
'Get counselling and support'
],
'hindi': [
'ग ांव ििधक री य तल ठी स सांपकष करें ',
'िकस न सांकट िववरण जम करें ',
'सल ह और सह यत प्र प्त करें '
],
'marathi': [
'ग व ििधक री िकांव तल ठी य ांच्य कड ज ',
'शतकरी िडचणीची म िहती द्य ',
'समुपदशन व मदत िमळव '
]

GT&MC – Department of Computer Engineering. Page 67


Agro_Vision 2024-25

},
'documents': {
'english': ['Farmer ID', 'Aadhaar Card', 'Application Form'],
'hindi': ['िकस न आईडी', 'आध र क डष ', 'आवदन पत्र'],
'marathi': ['शतकरी ओळखपत्र', 'आध र क डष ', 'िजष फॉमष']
},
'url': 'https://aaplesarkar.mahaonline.gov.in'
}
];

String getText(Map<String, String> map) {


switch (currentLanguage) {
case Language.hindi:
return map['hindi']!;
case Language.marathi:
return map['marathi']!;
default:
return map['english']!;
}
}

List<String> getSteps(Map<String, List<String>> map) {


switch (currentLanguage) {
case Language.hindi:
return map['hindi']!;
case Language.marathi:
return map['marathi']!;
default:
return map['english']!;
}
}

List<String> getDocs(Map<String, List<String>> map) {


switch (currentLanguage) {
case Language.hindi:
return map['hindi']!;
case Language.marathi:

GT&MC – Department of Computer Engineering. Page 68


Agro_Vision 2024-25

return map['marathi']!;
default:
return map['english']!;
}
}

void _launchURL(String url) async {


if (await canLaunchUrl(Uri.parse(url))) {
await launchUrl(Uri.parse(url), mode: LaunchMode.externalApplication);
} else {
throw 'Could not launch $url';
}
}

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(
currentLanguage == Language.hindi
? 'सरक री योजन एां '
: currentLanguage == Language.marathi
? 'श सकीय योजन '
: 'Government Schemes',
),
actions: [
PopupMenuButton<Language>(
onSelected: (Language lang) {
currentLanguage = lang;
(context as Element).reassemble();
},
itemBuilder: (context) => [
PopupMenuItem(value: Language.english, child: Text('English')),
PopupMenuItem(value: Language.hindi, child: Text('िहांदी')),
PopupMenuItem(value: Language.marathi, child: Text('मर ठी')),
],
),

GT&MC – Department of Computer Engineering. Page 69


Agro_Vision 2024-25

],
),
body: ListView.builder(
itemCount: schemes.length,
itemBuilder: (context, index) {
final scheme = schemes[index];
return Card(
margin: EdgeInsets.all(10),
elevation: 4,
child: ExpansionTile(
title: Text(getText(scheme['title'])),
subtitle: Text(getText(scheme['description'])),
children: [
Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
currentLanguage == Language.hindi
? 'आवदन कैस करें :'
: currentLanguage == Language.marathi
? 'िजष कस कर व :'
: 'How to Apply:',
style: TextStyle(fontWeight: FontWeight.bold),
),
SizedBox(height: 8),
...getSteps(scheme['steps']).map((step) => Padding(
padding: const EdgeInsets.symmetric(vertical: 2),
child: Text("• $step"),
)),
SizedBox(height: 12),
Text(
currentLanguage == Language.hindi
? 'आवश्यक दस्त वज़:'
: currentLanguage == Language.marathi
? 'आवश्यक क गदपत्र:'

GT&MC – Department of Computer Engineering. Page 70


Agro_Vision 2024-25

: 'Required Documents:',
style: TextStyle(fontWeight: FontWeight.bold),
),
...getDocs(scheme['documents']).map((doc) => Padding(
padding: const EdgeInsets.symmetric(vertical: 2),
child: Text("• $doc"),
)),
SizedBox(height: 10),
Align(
alignment: Alignment.centerRight,
child: ElevatedButton.icon(
icon: Icon(Icons.open_in_browser),
label: Text(
currentLanguage == Language.hindi
? 'आवदन करें '
: currentLanguage == Language.marathi
? 'िजष कर '
: 'Apply',
),
onPressed: () => _launchURL(scheme['url']),
),
)
],
),
)
],
),
);
},
),
);
}
}

GT&MC – Department of Computer Engineering. Page 71


Agro_Vision 2024-25

Output of Gov scheme page

GT&MC – Department of Computer Engineering. Page 72


HydroSense 2024-25

GT&MC – Department of Computer Engineering. Page 73


Agro_Vision 2024-25

CHAPTER 6
TESTING & DEBUGGING STRATEGIES & TEST CASES
6.1 TESTING

Testing is the process of detecting errors. Testing performs a very critical


role for quality assurance and for ensuring the reliability of software. The
results of testing are used later on during maintenance also.

Psychology of Testing

The aim of testing is often to demonstrate that a program works by


showing that it has no errors. The basic purpose of testing phase is to detect the
errors that may be present in the program. Hence one should not start testing
with the intent of showing that a program works, but the intent should be to show
that a program doesn’t work. Testing is theprocess of executing a program with
the intent of finding errors.

6.2 TESTING OBJECTIVES


The main objective of testing is to uncover a host of errors, systematically
and with minimum effort and time. Stating formally, we can say:
• Testing is a process of executing a program with the intent of finding
an error.
• A successful test is one that uncovers an as yet undiscovered error.
• A good test case is one that has a high probability of finding error, if it
exists.
• The tests are inadequate to detect possibly present errors.
• The software more or less confirms to the quality and reliable
standards.

6.3 LEVELS OF TESTING


In order to uncover the errors, present in different phases we have the concept of
levels testing. The basic levels of testing are as shown below…

• System Testing

The philosophy behind testing is to find errors. Test cases are devised with
this in mind. A strategy employed for system testing is code testing.

GT&MC – Department of Computer Engineering. Page 74


Agro_Vision 2024-25
• Code Testing:

This strategy examines the logic of the program. To follow this method, we
developed some test data that resulted in executing every instruction in the
program and module i.e. every path is tested. Systems are not designed as entire
nor are they tested as single systems. To ensure that the coding is perfect two types
of testing is performed or for that matter is performed or that matter is performed
or for that matter is performed on all systems.

6.4 TYPES OF TESTING


• Unit Testing
• Link Testing

6.4.1 Unit Testing

Unit testing focuses verification effort on the smallest unit of software i.e. the
module. Using the detailed design and the process specifications testing is done
to uncover errors within the boundary of the module. All modules must be
successful in the unit test before the start of the integration testing begins.
In this project each service can be thought of a module. There are so many
modules like Login, HWAdmin, MasterAdmin, Normal User, and PManager.
Giving different sets of inputs has tested each module. When developing the
module as well as finishing the development so that each module works without
any error. The inputs are validated when accepting from the user.
In this application developer tests the programs up as system. Software units in a
system are the modules and routines that are assembled and integrated to form a
specific function. Unit testing is first done on modules, independent of one another
to locate errors. This enables to detect errors. Through this errors resulting from
interaction between modules initially avoided.
6.4.2 Link Testing
Link testing does not test software but rather the integration of each module in
system. The primary concern is the compatibility of each module. The
Programmer tests where modules are designed with different parameters, length,
type etc.

6.4.3 Integration Testing


After the unit testing we have to perform integration testing. The goal here is to
see if modules can be integrated properly, the emphasis being on testing interfaces
between modules. This testing activity can be considered as testing the design and
hence the emphasis on testing module interactions.
In this project integrating all the modules forms the main system. When
integrating all the modules I have checked whether the integration effects

working of any of the services by giving different combinations of inputs with


which the two services run perfectly before Integration.

GT&MC – Department of Computer Engineering. Page 75


Agro_Vision 2024-25

6.4.4 System Testing

Here the entire software system is tested. The reference document for this process is
the requirements document, and the goal os to see if software meets its
requirements.
Here entire ‘ATM’ has been tested against requirements of project and it is
checked whether all requirements of project have been satisfied or not.

6.4.5 Acceptance Testing


Acceptance Test is performed with realistic data of the client to demonstrate that
the software is working satisfactorily. Testing here is focused on external
behavior of the system; the internal logic of program is not emphasized.
In this project ‘Network Management Of Database System’ I have collected
some data and tested whether project is working correctly or not.
Test cases should be selected so that the largest number of attributes of an
equivalence class is exercised at once. The testing phase is an important part of
software development. It is the process of finding errors and missing operations
and also a complete verification to determine whether the objectives are met and
the user requirements are satisfied.

6.5 WHITE BOX TESTING


This is a unit testing method where a unit will be taken at a time and tested
thoroughly at a statement level to find the maximum possible errors. I tested step
wise every piece of code, taking care that every statement in the code is executed
at least once. The white box testing is also called Glass Box Testing.
I have generated a list of test cases, sample data. which is used to check all
possible combinations of execution paths through the code at every module
level.

6.6 BLACK BOX TESTING


This testing method considers a module as a single unit and checks the unit at
interface and communication with other modules rather getting into details at
statement level. Here the module will be treated as a block box that will take some
input and generate output. Output for a given set of input combinations are
forwarded to other modules.

GT&MC – Department of Computer Engineering. Page 76


Agro_Vision 2024-25

6.3. TEST CASES

6.6.1 Module1: Smart irrigation

Test Case ID Test Parameters Expected Actual Result Status


Description Result
TC_SID_001 Verify the None The top-left corner Pass Pass
application title. displays
"AgroVision".
TC_SID_002 Verify the Icon: A hamburger Pass Pass
navigation Hamburger menu icon is
menu icon. menu (three visible in the
horizontal lines) top-left corner.
TC_SID_003 Verify the Text: "Smart The main heading Pass Pass
dashboard title. Irrigation displays "Smart
Dashboard" Irrigation
Dashboard".

TC_SID_004 Verify the "Soil Title: "Soil A section with the Pass Pass
Moisture" Moisture", title "Soil Moisture"
display section. Icon: Water and a water wave
waves icon is visible.

TC_SID_005 Verify the Value: "75", "75%" is Pass Pass


displayed Soil Unit: "%" displayed under the
Moisture value "Soil Moisture"
and unit. label.
TC_SID_006 Verify the Title: A section with the Pass Pass
"Temperature" "Temperature", title "Temperature"
display section. Icon: and a thermometer
Thermometer icon is visible.

TC_SID_007 Verify the Value: "30", "30°C" is Pass Pass


displayed Unit: "°C" displayed under the
Temperature "Temperature"
value and unit. label.

TC_SID_008 Verify the Label: "Turn On A button labeled Pass Pass


"Turn On Irrigation", "Turn On
Irrigation" Icon: Water Irrigation" with a
button. droplet with water droplet icon is
waves visible.

GT&MC – Department of Computer Engineering. Page 77


Agro_Vision 2024-25

6.6.2 Module2: CropHealth Management

Test Case ID Test Parameters Expected Actual Status


Description Result Result
TC_CH_001 Verify the application title. None The top-left corner displays Pass Pass
"AgroVision".
TC_CH_002 Verify the navigation Icon: A hamburger menu icon is Pass Pass
menu icon. Hamburger visible in the
menu (three top-left corner.
horizontal lines)
Text: "Crop The main heading displays Pass Pass
Health" "Crop
Health".
TC_CH_003 Verify the screen title. Tab Label: "NPK", A tab labeled "NPK" is Pass Pass
State: visible and visually indicated
Selected/Active as the currently
selected tab.

TC_CH_005 Verify the "Soil Sensors" Tab Label: "Soil A tab labeled "Soil Sensors" Pass Pass
tab is present and not Sensors", State: is visible and not visually
selected. Not Selected/Inacti indicated as the currently
ve selected tab.

TC_CH_006 Verify the "Soil Nutrient Text: "Soil The Pass Pass
Levels" sub-heading is Nutrient Levels" sub-heading "Soil Nutrient
present. Levels" is visible below
the tabs.

TC_CH_007 Verify the Nitrogen (N) Nutrient: "Nitrogen (N)" with a leaf Pass Pass
level display. "Nitrogen (N)", icon, "Value : 20", and
Value Label: "Low" indicator are
"Value :", displayed.
Value: "20",
Status: "Low"
TC_CH_008 Verify the Phosphorus (P) Nutrient: "Phosphorus (P)" with a Pass Pass
level display. "Phosphorus (P)", droplet icon, "Value : 30",
Value Label: and "Low" indicator are
"Value displayed.
:", Value: "30",
Status: "Low"

GT&MC – Department of Computer Engineering. Page 78


Agro_Vision 2024-25

Test Case ID Test Parameters Expected Actual Result Status


Description Result
TC_CH_009 Verify the Nutrient: "Potassium (K)" Pass Pass
Potassium (K) "Potassium (K)", with a corn/grain
level display. Value Label: icon, "Value :
"Value 40", and "Low"
:", Value: "40", indicator are
Status: "Low" displayed.
TC_CH_010 Verify the "Low Alert Type: A yellow Pass Pass
Nitrogen" Warning, warning bar with
recommendatio n Message: "Low the message
message. Nitrogen: Use "Low Nitrogen:
organic compost Use organic
or manure." compost or
manure." and a
warning icon is
visible.
TC_CH_011 Verify the back Location: A left-pointing Pass Pass
arrow icon. Top-Left, arrow icon is
Direction: visible next to
Left-pointing the "Crop
Health" title.
TC_CH_012 Verify the Presence: A bar with Pass Pass
bottom Bottom of the multiple distinct
navigation bar screen, Contains icons is visible at
is present. multiple distinct the bottom of the
icons screen.
TC_CH_013 Verify the Icon: The Pass Pass
second icon in Tractor/Vehicle, tractor/vehicle
the bottom State: icon in the
navigation bar is Highlighted/Acti bottom
highlighted/acti ve navigation bar
ve. is visually
highlighted as
the active
screen.
TC_CH_014 Verify the first Appearance: The first icon Pass Pass
icon in the Resembles a visually
bottom dashboard or represents a
navigation bar. home dashboard or
home.
TC_CH_015 Verify the third Appearance: The third icon Pass Pass
icon in the Resembles visually
bottom water waves represents

GT&MC – Department of Computer Engineering. Page 79


Agro_Vision 2024-25

6.6.3 Module3: Animal Detection

Test Case Test Parameters Expected Actual Status


ID Description Result Result
TC_AD_001 Verify the Text: "Animal The main heading Pass Pass
screen title. Detection" displays "Animal
Detection".

TC_AD_002 Verify the sub- Text: "PIR The Pass Pass


heading "PIR Sensor sub-heading "PIR
Sensor Monitoring" Sensor Monitoring"
Monitoring" is is visible below the
present. main title.

TC_AD_003 Verify the Alert Message: A card with the Pass Pass
"Animal "! Animal message "!
Detected! Detected! Animal Detected!
Check farm Check farm Check farm
security." alert security.", Icon: security." and a
is displayed. Yellow yellow exclamation
Exclamation icon is visible.

TC_AD_004 Verify the Color: Light The background Pass Pass


background Red/Pink color of the alert
color of the card is light red or
"Check farm pink.
security" alert
card.

TC_AD_005 Verify the alert Icon: Red A red triangle icon Pass Pass
icon within the Triangle with with an exclamation
"Check farm Exclamation mark is present
security" alert Mark within the alert card.
card.

TC_AD_006 Verify the Notification A red banner with Pass Pass


"Animal Message: "! the message "!
Detected! Animal Animal Detected!
Alarm Detected! Alarm Triggered." is
Triggered." Alarm displayed at the
notification Triggered.", bottom.
banner is Color: Red
displayed.

TC_AD_007 Verify the alert Icon: Yellow A yellow Pass Pass


icon within the Exclamation exclamation

GT&MC – Department of Computer Engineering. Page 80


Agro_Vision 2024-25
Test Case Test Parameters Expected Actual Status
ID Description Result Result
"Alarm icon is present
Triggered" within the "Alarm
notification Triggered"
banner. notification banner.
TC_AD_008 Verify the Presence: A bar with multiple Pass Pass
bottom Bottom of the distinct icons is
navigation bar screen, visible at the bottom
is present. Contains of the screen.
multiple distinct
icons

TC_AD_009 Verify the Icon: Paw print, The paw print icon Pass Pass
"Animal State: in the bottom
Detect" icon in Highlighted/Acti navigation bar is
the bottom ve visually highlighted
navigation bar or indicated as the
is active screen.
highlighted/acti
ve.

TC_AD_010 Verify the first Appearance: The first icon Pass Pass
icon in the Resembles a visually represents
bottom dashboard or a dashboard or
navigation bar. home home.

TC_AD_011 Verify the Appearance: The second icon Pass Pass


second icon in Resembles a visually represents
the bottom vehicle or a vehicle or
navigation bar. tractor tractor.

TC_AD_012 Verify the third Appearance: The third icon Pass Pass
icon in the Resembles visually represents
bottom water waves water waves.
navigation bar.

TC_AD_013 Verify the fifth Appearance: The fifth icon Pass Pass
icon in the Resembles visually represents
bottom leaves or plant leaves or plant
navigation bar. growth growth.

TC_AD_014 Verify the sixth Appearance: The sixth icon Pass Pass
icon in the Resembles a visually represents
bottom speech bubble a speech bubble or
navigation bar. or chat icon chat icon.

TC_AD_015 Verify the Format: Time A timestamp in Pass Pass

Test Case Test Parameters Expected Actual Status


ID Description Result Result
timestamp (HH:MM the format HH:MM
displayed in AM/PM) AM/PM (e.g., "2:03
the top-left PM") is visible in the
corner.
GT&MC – Department of Computer Engineering. Page 81
Agro_Vision 2024-25
top-left
corner.

TC_AD_016 Verify the Icons: Standard status bar Pass Pass


status bar Wi-Fi/Mobile icons for
icons signal, Battery connectivity and
(connectivity, indicator battery are visible.
battery, etc.)
are present.
TC_AD_017 Verify the Context: The alerts displayed Pass Pass
absence of Animal are generic ("Animal
specific Indian detection for a Detected") and do
animal alerts (if farm in India, not specifically
not applicable). Specific mention animals
animals: None common only to
specified India (if no such
specific alerts are
intended).
TC_AD_018 Verify the color Colors: The colors used for Pass Pass
consistency of Red/Yellow for alerts and the
alerts and alerts, Red for critical notification
notifications. critical are consistent with
notification the design.
TC_AD_019 Verify the text Font size, The alert messages Pass Pass
formatting and color, are clearly
readability of emphasis (e.g., formatted and
alert bolding) easy to read.
messages.
TC_AD_020 Verify the Arrangement: The title, alerts, and Pass Pass
overall layout Title top, Alerts bottom navigation
and visual centered, are arranged in a
hierarchy of Navigation clear and logical
the elements. bottom visual hierarchy.

GT&MC – Department of Computer Engineering. Page 82


Agro_Vision 2024-25

6.6.4 Module4: Electric Appliances

Test Case ID Test Parameters Expected Actual Status


Description Result Result
TC_AD_001 Verify the screen Text: "Animal The main heading Pass Pass
title. Detection" displays "Animal
Detection".
TC_AD_002 Verify the sub- Text: "PIR The Pass Pass
heading "PIR Sensor sub-heading "PIR Sensor
Sensor Monitoring" Monitoring" Monitoring" is visible
is present. below the main title.
TC_AD_003 Verify the "Animal Alert A card with the message Pass Pass
Detected! Check Message: "! "!
farm security." alert Animal Animal Detected! Check
is displayed. Detected! farm security." and a
Check farm yellow exclamation
security.", icon is visible.
Icon: Yellow
Exclamation
TC_AD_004 Verify the Color: Light The background color of Pass Pass
background color of Red/Pink the alert card is light red
the "Check farm or
security" alert pink.
card.
TC_AD_005 Verify the alert icon Icon: Red A red triangle icon with an Pass Pass
within the "Check Triangle with exclamation mark is
farm security" alert Exclamation present within the alert
card. Mark card.

z
TC_AD_006 Verify the "Animal Notification A red banner with the Pass Pass
Detected! Alarm Message: "! message "! Animal
Triggered." Animal Detected!
notification banner Detected! Alarm Triggered." is
is displayed. Alarm displayed at the
Triggered.", bottom.
Color: Red

TC_AD_007 Verify the alert icon Icon: Yellow icon is present within the Pass Pass
within the "Alarm Exclamation "Alarm Triggered"
Triggered" notification banner.
notification banner.

Test Case ID Test Parameters Expected Actual Status


Description Result Result
TC_AD_008 Verify the bottom Presence: A bar with multiple distinct Pass Pass
navigation bar is Bottom of the icons is visible at the
present. screen, bottom of the screen.
Contains
GT&MC – Department of Computer Engineering. Page 83
Agro_Vision 2024-25
multiple
distinct icons

TC_AD_009 Verify the "Animal Icon: Paw The paw print icon in the Pass Pass
Detect" icon in the print, State: bottom navigation bar is
bottom navigation Highlighted/A visually highlighted or
bar is cti ve indicated as the
highlighted/acti active screen.
ve.
TC_AD_010 Verify the first icon Appearance: The first icon visually Pass Pass
in the bottom Resembles a represents a dashboard or
navigation bar. dashboard or home.
home
TC_AD_011 Verify the second Appearance: The second icon visually Pass Pass
icon in the bottom Resembles a represents a vehicle or
navigation bar. vehicle or tractor.
tractor
TC_AD_012 Verify the third icon Appearance: The third icon visually Pass Pass
in the bottom Resembles represents water waves.
navigation bar. water waves

TC_AD_013 Verify the fifth icon Appearance: The fifth icon visually Pass Pass
in the bottom Resembles represents leaves or plant
navigation bar. leaves or growth.
plant growth
TC_AD_014 Verify the sixth icon Appearance: The sixth icon visually Pass Pass
in the bottom Resembles a represents a speech
navigation bar. speech bubble or chat icon.
bubble or
chat icon
TC_AD_015 timestamp Format: Time A timestamp in the format Pass Pass
displayed in the (HH:MM HH:MM AM/PM (e.g.,
top-left corner. AM/PM) "2:03
PM") is visible in the top-
left
corner.
TC_AD_016 Verify the status Icons: Standard status bar icons Pass Pass
bar icons Wi-Fi/Mobile for connectivity and
(connectivity, signal, battery are visible.
battery, etc.) are Battery
present. indicator

Test Case ID Test Parameters Expected Actual Status


Description Result Result

TC_AD_017 Verify the absence Context: The alerts displayed are Pass Pass
of specific Indian Animal generic ("Animal
animal alerts (if not detection for Detected") and do not
applicable). a farm in specifically mention
India, animals common only to
Specific India (if no such specific
animals: alerts are intended).

GT&MC – Department of Computer Engineering. Page 84


Agro_Vision 2024-25
None
specified

TC_AD_018 Verify the color Colors: The colors used for alerts Pass Pass
consistency of Red/Yellow and the critical notification
alerts and for alerts, are consistent with the
notifications. Red for design.
critical
notification
TC_AD_019 Verify the text Font size, The alert messages are Pass Pass
formatting and color, clearly formatted and
readability of alert emphasis easy to read.
messages. (e.g., bolding)

TC_AD_020 Verify the overall Arrangement: The title, alerts, and Pass Pass
layout and visual Title top, bottom navigation are
hierarchy of the Alerts arranged in a clear and
elements. centered, logical visual hierarchy.
Navigation
bottom

GT&MC – Department of Computer Engineering. Page 85


Agro_Vision 2024-25

GT&MC – Department of Computer Engineering. Page 86


Agro_Vision 2024-25

CHAPTER 7

ADVANTAGES

➤AutomatedDataCollection
With built-in sensors, all farm data is collected automatically. This removes the need for manual
checks, saving time and reducing errors. It ensures accurate and continuous updates without depending
on human effort.

➤Cloud-BasedDataStorage
Sensor readings are sent directly to Firebase Cloud, where they are stored securely and can be accessed
anytime. This allows farmers to view past records, analyze trends, and plan better for future farming
activities.

➤MobileAppAccess
The user-friendly Android app lets farmers check real-time data, control pumps, and get alerts right on
their phones. Whether in the field or at home, they stay connected with their farm and can act quickly
if needed.

➤EarlyAlertsandCropProtection
AgroVision gives instant alerts through buzzers and app notifications for threats like animal movement
or unusual conditions. This early warning system helps protect crops from pests, water stress, or
environmental harm.

➤Low-CostandFarmer-Friendly
The system is built using affordable parts like Arduino boards and basic sensors. It’s budget-friendly,
making it suitable even for small farmers or rural areas with limited resources.

GT&MC – Department of Computer Engineering. Page 87


Agro_Vision 2024-25

➤EasytoUseInterface
The app is simple to understand and easy to navigate. It uses color codes, live graphs, and buttons that
even people with little tech experience can manage comfortably.

➤VisualDataInsights
AgroVision doesn’t just show numbers – it gives graphs and trend lines that help farmers understand
what’s happening over time. This helps in planning irrigation, fertilization, and managing soil health
effectively.

➤HelpsGovernment&AgricultureSchemes
The system can support public and private farming programs by offering transparent and trackable
monitoring. It reduces the need for manual field visits and promotes digital agriculture in rural areas.

➤CustomSettingsforDifferentCrops
Farmers can set their own thresholds for sensors based on crop type, soil condition, and climate. This
makes AgroVision flexible and useful for many different types of crops and farming practices.

➤PortableandExpandableDesign
AgroVision’s design is simple, light, and modular. It can be moved between fields and upgraded easily
with new sensors or software features without major hardware changes.

➤WorksWithoutInternetTemporarily
Even if the internet goes down, the system keeps storing data locally. Once it reconnects, it uploads
everything automatically, making it reliable even in areas with weak or no network.

➤ProtectsEnvironmentandResources
By using just the right amount of water and fertilizer, AgroVision helps in avoiding waste and
preventing damage to the soil. It also reduces the risk of waterlogging and over-irrigation.

GT&MC – Department of Computer Engineering. Page 88


Agro_Vision 2024-25

➤UsefulforStudentsandResearch
AgroVision is a great learning tool for students studying agriculture, environment, or electronics. It
helps them understand real-world applications of IoT and smart farming.

➤SupportsSustainableDevelopmentGoals(SDGs)
AgroVision supports the goal of “Zero Hunger” by helping farmers grow healthier crops and use
resources wisely. It’s a step toward modern, eco-friendly, and tech-driven farming for all.

GT&MC – Department of Computer Engineering. Page 89


Agro_Vision 2024-25

CHAPTER 8
CONCLUSION AND RECOMMENDATIONS
8.1 CONCLUSION

Agrovision is a smart and affordable farming system built to help farmers take better care of their
crops using real-time information. With problems like unpredictable weather, poor soil quality, and
water shortage, there’s a growing need for technology that makes farming easier and more efficient.
Agrovision meets this need by combining useful sensors, automatic controls, and a mobile app that
gives farmers full control from anywhere.
The system uses different sensors to check soil moisture, temperature, humidity, ph, sunlight, and
nutrients (NPK). It also includes animal detection to protect crops and can turn pumps or lights on/off
automatically. This saves water, power, and labor. Farmers get all this information on their phones,
with clear alerts, graphs, and options to control devices remotely. The system is easy to use, even for
farmers with little experience in technology.
Agrovision bridges the gap between traditional and smart farming. It's designed to grow over time with
more features like automatic fertilizer systems and AI-based pest prediction. Overall, agrovision helps
farmers grow healthier crops, save resources, and move toward smarter and more sustainable
agriculture.

GT&MC – Department of Computer Engineering. Page 90


Agro_Vision 2024-25

8.2 RECOMMENDATION ON FUTURE IMPROVEMENT

AgroVision: A Smart Agriculture Monitoring System can be further developed into a more
advanced and intelligent platform. By integrating newer technologies and enhancing current
capabilities, the system can provide broader and deeper support for modern, sustainable, and
efficient farming practices.

1.AdvancedSmartSensorIntegration
Future versions of AgroVision can use more accurate and self-calibrating sensors to collect
real-time data on soil nutrients, pH, temperature, moisture, and environmental conditions.
This will improve precision in decision-making and enhance crop health monitoring.

2.AutomatedNutrientDispensingSystem
By integrating AI-driven fertilizer dispensers, the system can automatically apply the right
amount and type of nutrients based on real-time data analysis. This minimizes manual errors,
saves resources, and ensures optimal plant nutrition.

3.CentralizedFarmDashboardwithIoT&CloudIntegration
The system can be upgraded to support cloud connectivity, enabling farmers to access sensor
data, control devices, and receive alerts from a centralized dashboard. This would allow for
the management of multiple fields or greenhouses from any location.

4.AI-BasedCropDiseaseandPestPrediction
Machine learning can be introduced to analyze historical and real-time data to predict
potential pest infestations or disease outbreaks. Early warnings will help farmers take timely
actions to protect crops and reduce losses.

GT&MC – Department of Computer Engineering. Page 91


Agro_Vision 2024-25

CHAPTER 9

REFERENCES

Website

5. www.androidtutorials.com
6. www.javatpoint.com
7. www.progchamp.com
8. https://www.emarketinginstitute.org/
9. https://www.restolabs.com/

Books:

1. Hello, Android by Ed Burnette.


2. Java: A beginner’s guide by Herbert Schildt.
3. Thinking in java by Bruce Eckel.
4. Android Programming for Beginners by John Horton.

GT&MC – Department of Computer Engineering. Page 92


Agro_Vision 2024-25

STATE LEVEL DIPEX 2025 COMPETITION – RUNNER-UP AWARD AND SPONSORSHIP RECOGNITION

We proudly secured the runner-up position at the state level DIPEX 2025 competition for our
innovative project, AgroVision: Smart Agriculture System. The project was recognized for its
practical impact and technical excellence. As a result, it received sponsorship support and was
honored with an official certificate of achievement (attached below). This milestone reflects the
project's potential in addressing real-world agricultural challenges through sustainable technology.

Fig: Agro _Vision Working Model

GT&MC – Department of Computer Engineering. Page 93


Agro_Vision 2024-25

GT&MC – Department of Computer Engineering. Page 94


Agro_Vision 2024-25

GT&MC – Department of Computer Engineering. Page 95

You might also like