Mini Project Report: A Dissertation Submitted in Partial Fulfilment of The Requirements For The Award of Degree of
Mini Project Report: A Dissertation Submitted in Partial Fulfilment of The Requirements For The Award of Degree of
CERTIFICATE
This is to certify that the project entitled “SMART SECURITY FOR CROP CULTIVATION” being
submitted by B.SNEHA bearing hall ticket number 15TQ1A0512, B.HARIKA bearing hall ticket
number 15TQ1A0538, P.SHASIDHAR bearing hall ticket number 15TQ1A0567, N.MANEESHA
bearing hall ticket number 15TQ1A0565 and G.MOKSHITH bearing hall ticket number
15TQ1A0536 in the partial fulfilment for the award of the degree of Bachelor of Technology
in COMPUTER SCIENCE AND ENGINEERING to Siddhartha Institute of Technology and Science
is a record of bonafide work carried out by them under my guidance and supervision. The
results embodied in this project report have not been submitted to any other University or
institute for the award of any degree.
It is our privilege and pleasure to express profound sense of respect, gratitude and
indebtedness to our guide Mr.Sri Hari, Assistant Professor, Dept. of Computer Science and
Engineering, Siddhartha Institute of Technology and Science, for his indefatigable
inspiration, guidance, cogent discussion, constructive criticisms and encouragement
throughout this dissertation work.
We extend our sincere thanks to, Principal, Dr. Syed Basha ,Siddhartha Institute of
Technology and Science,Narapally,Korremula Road,Ranga Reddy District.
B.SNEHA (15TQ1A0512)
B.HARIKA (15TQ1A0538)
P.SHASIDHAR (15TQ1A0567)
N.MANEESHA (15TQ1A0565)
G.MOKSHITH (15TQ1A0536)
We hereby declare that the project work entitled “Smart Security for Crop
Cultivation” submitted to the Siddhartha Institute of Technology and Science in
partial fulfilment of the requirements for the award of the degree of Bachelor of
Technology (B.Tech) in Computer Science and Engineering is a record of an original
work done by us under the guidance of Mr. Sri Hari, Assistant Professor and this
project work have not been submitted to any other university for the award of any other
degree or diploma.
B.SNEHA (15TQ1A0512)
B.HARIKA (15TQ1A0538)
P.SHASIDHAR (15TQ1A0567)
N.MANEESHA (15TQ1A0565)
G.MOKSHITH (15TQ1A0536)
Date:
CONTENTS
PG.NO
1. Introduction……………………………………………………………………..
Purpose
Background
Scope
Features
2. Existing System…………………………………………………………………
3. Proposed System………………………………………………………………..
4. Technologies Used………………………………………………………………
5. Architecture……………………………………………………………………..
5.2--------Un-Authorized user
6. Design Modules…………………………………………………………………
6.2-------- Use-cases
7. Implementation………………………………………………………………….
9. Testing……………………………………………………………………………
11. Bibliography……………………………………………………………………..
ABSTRACT
Most of the farmers are facing an issue of protecting their agricultural farms
being attacked by birds and animals. Birds and animals attack the farm for their
food which causes a greater loss to the farmer. We came up with a solution to
overcome such issues, our approach involves in smart monitoring the farm.
Smart monitoring system monitors the farm and if it detects any unusual
activity then it will notify the farmer about that activity based on that rappelers
can be used to keep animals and birds ward away from the farm.This project
aims to provide an effective solution to the problem stated above in the form
of an ELECTRONIC SURVEILLANCE SYSTEM. This system will enable the
farmers to protect their fields and orchards effectively, without any human
intervention, by warding off the animals with automatically and manually
controlled ultrasonic animal repellent buzzers. It will also enable them
to remotely monitor their fields from any place, thus eliminating the need of
physical presence of a person in the fields.
INTRODUCTION
Surveillance plays a major role in many fields be it at home, hospitals, schools, public
places, farmlands etc. It helps us to monitor a certain area and prevent theft and
people from gaining access to the area as well as to protect the area from animals.
Various methods aim only at surveillance which is mainly for human intruders, but we
tend to forget that the main enemies of such farmers are the animals which destroy
the crops. The problem of wild animal attacks on crop fields i.e. Crop vandalization
Pradesh, Punjab, Haryana and many other states. Wild animals like monkeys, estray
animals especially cows and buffaloes, wild dogs, nilgais, bisons, elephants, deer, wild
pigs and even birds like parakeets cause a lot of damage to crops either by running
over them or eating them and vandalizing them completely. This leads to poor yield
of crops. These animals attack on fruit orchards and destroy the flowerings and fruits.
In both cases, this leads to significant financial loss to the farmers and orchard owners.
The problem is so pronounced that sometimes farmers decide to leave the area barren
due to these animal attacks. The main aim of this project is to provide an effective
solution to this problem, so that the economic losses incurred by our farmers are
1.1 Purpose
In India two- third of population is directly depending on agricultural sector for their
livelihood. The animals from the wild area are continuously attacking to crop from so
many years and the protection of this crop field from wild animals is the serious issue.
The wild animals face an shortage of water and food due to which they move towards
the agriculture area which creates great loss to the crops and annual income of
farmers, It has been estimated that at minimum conservative average damage per
crore every year. This is a very huge amount to loose in a country like India. When
wild animals enter in a farm there is a need for an alert system to prevent crops from
This project aims to provide an effective solution to the problem stated above in the
farmers to protect their fields and orchards effectively, without any human
remotely monitor their fields from any place, thus eliminating the need of physical
1.2 Background
Various traditional techniques are used for providing security but up to date, complete
1.3 Scope
The main objective of this project is to provide an effective solution to this problem,
so that the economic losses incurred by our farmers are minimized and they have a
good crop yield. It helps to save time and money by reducing the manual work that is
farmlands with their constant manual supervision. The manual work done to keep
away the animals from the crops is automated, hence such constant supervision is a
thing of the past with such smart protection systems, which can identify and taking
1.4 Features
Our proposed system overcomes all the security problems in existing system and
provides high security and efficiency. This is a perfect/optimal solution for protecting
the farm from wild animals and birds. The features of our product are briefly described
below:
1.4.1 Effective
This system requires almost no human supervision, except for the task of switching
the system on and off. The system can turn the buzzers on automatically and
warding off the animals thus protecting the fields from any damage.
It determines the presence of animals in the fields and sounds the buzzer. This
system is very effective in driving off the animals from the fields and keeping them
away.
1.4.3 Economical
This system is economical as compared to many of the existing solutions like electric
fences, brick walls and manual supervision of the fields. The cost of the existing
solutions is very high and the cost of this system is only a fraction of their cost.
enables the farmer to have a real time view of his fields from any place via internet
and even provides manual buzzer controls if the need arises to use them. Thus, the
farmer is in effective control of the system and can manually sound the buzzer if
needed. The system also provides a history of the events taking place in the fields,
This system is totally harmless and doesn’t injure animals in any way. It also doesn’t
cause any harm to humans. Also, this system has a very low power requirement
This system, although primarily aimed at crop protection, can be used for other
system. Thus it can be installed at places like godowns, places prone to robbery,
The existing systems mainly provide the surveillance functionality. Also, these systems
don’t provide protection from wild animals, especially in such an application area.
They also need to take actions based on the on the type of animal that tries to enter
the area, as different methods are adopted to prevent different animals from entering
such restricted areas. Also the farmers resort to the other methods by erecting human
puppets and effigies in their farms, which is in effective in warding off the wild animals,
though is useful to some extent to ward off birds. The other commonly used methods
by the farmers in order to prevent the crop vandalization by animals include building
physical barriers, use of electric fences and manual surveillance and various such
Our proposed system overcomes all the security problems in existing farmland and
provides high security and efficiency. This is a perfect/optimal solution for farm
In automatic mode whenever any bird or animal enter near to the farm then our PIR
sensor will detect that some living object has come near the farm then it will be notified
to the farmer, and at the same time reppelers like Ultrasonic sensor, Buzzer, Light are
used to ward of animals and birds away from the farm. In manual mode after notifying
the farmer, the farmer can decide which repellent can be used to ward off the animals
and birds through the interface provided to him where he can choose different options
consisting of an option for buzzer and other for ultrasonic and light. Farmer can choose
either buzzer option to repel birds and animals or ultrasonic to repel animals.
TECHNOLOGIES USED
Software Interfaces:
We are using Raspbian Noobs and python programming language for writing the
project code.
Software Requirements:
2. Androids OS
Hardware Requirements:
4. Sensors:
a. Ultrasonic
b. PIR Sensor
c. Buzzer
d. Led Bulb
ARCHITECTURE
The above diagram shows the architecture of the Smart security for crop protection
with its interfaces. The Raspberry pi microcontroller centrally controls all the devices
connected to it. The program must be fed into the Raspberry pi board and connected
to the power supply. The devices are triggered according to the flow of the code. First
PIR sensor will senses if any motion has occurred or not. If any motion has occurred
the data is sent to the microcontroller. From microcontroller the data is sent to the
cloud and to user. The rappelers like Buzzer, Ultrasonic, Light are activated to ward
The below diagrams describe the architecture of the farm security with its interfaces.
The Raspberry microcontroller centrally controls all the devices connected to it. The
program must be fed into the Raspberry and connected to the power supply. The
Our proposed system overcomes all the security problems in existing system and
saving/protecting farm from birds and animals. When the module is turned on in
automatic mode and if any animal or bird comes near to the farm then our PIR sensor
detects the motion of the body and sends a alerting signal to the farmer through
raspberry pi interface and cloud and at the same time it will turn on the reppelers i.e.
Buzzer which is used to make a buzz sound, Light to create luminous effect and
Ultrasonic sensors for generating the Ultrasonic waves. Through reppelers our device
In manual mode if PIR sensor detects any motion then immediately it will be uploaded
to cloud through Raspberry pi gateway and alert will be sent to the farmer then farmer
can manually turn on the repellers to ward off animals and birds.
6.5 Software Requirement Specification:
• SRS:
developing activity. As system grew more complex it became evident that the goal of
the entire system cannot be easily comprehended. Hence the need for the requirement
phase arose. The software project is initiated by the client needs. The SRS is the means
of translating the ideas of the minds of clients (the input) into a formal document (the
• Problem/Requirement Analysis:
The process deals with understanding the problem, goal and constraints.
• Requirement Specification:
Here, the focus is on specifying what has been found giving analysis such as
representation, specification languages and tools, and checking the specifications are
The Requirements phase terminates with the production of the validate SRS
document producing the SRS document is the basic goal of this phase.
• Document Conventions:
We have used Tahoma (text size 12). Bold font is used for Main headings
(text size 16). Normal font is used for sub headings (text size 14).
Font: Tahoma
• IOT Technology:
mechanical and digital machines, objects, animals or people that are provided with
unique identifiers and the ability to transfer data over a network without requiring
7.1.2 Raspberry Pi
The Raspberry Pi is a low cost, credit-card sized computer that plugs into a computer
monitor or TV, and uses a standard keyboard and mouse. It is a capable little device
that enables people of all ages to explore computing, and to learn how to program in
languages like Scratch and Python. It’s capable of doing everything you’d expect a
desktop computer to do, from browsing the internet and playing high-definition video,
Raspberry Pi has the ability to interact with the outside world, and has been used in
a wide array of digital maker projects, from music machines and parent detectors to
weather stations and tweeting birdhouses with infra-red cameras. We want to see the
Raspberry Pi being used by kids all over the world to learn to program and understand
Raspberry Pi Foundation
1129409) based in the UK. Our Foundation’s goal is to advance the education of adults
and children, particularly in the field of computers, computer science and related
subjects.
Media steamer
Tablet computer
Home automation
Internet radio
Controlling robots
Cosmic Computer
Arcade machines
operating systems
Second point is that all the required tools to develop Arduino applications are freely
Raspberry pi
PIR
Ultrasonic Sensor
Buzzer
Final Setup
SAMPLE CODE
Farm Security
import firebase_admin
import time
import urllib
import urllib.request
PIN_TRIGGER = 7
PIN_ECHO = 11
cred =credentials.Certificate('farm-672f9-firebase-adminsdk-2eud9-
ba87c485bd.json') # name of the downloaded json file
root = db.reference()
GPIO.setmode(GPIO.BOARD)
GPIO.setwarnings(False)
GPIO.setup(18,GPIO.OUT)#led
GPIO.setup(PIN_TRIGGER, GPIO.OUT)
GPIO.setup(PIN_ECHO, GPIO.IN)
def ultrasonic():
GPIO.output(PIN_TRIGGER, GPIO.LOW)
print("Transmitting Ultrasonic Waves")
time.sleep(2)
GPIO.output(PIN_TRIGGER, GPIO.HIGH)
time.sleep(0.00001)
GPIO.output(PIN_TRIGGER, GPIO.LOW)
while GPIO.input(PIN_ECHO)==0:
pulse_start_time = time.time()
while GPIO.input(PIN_ECHO)==1:
pulse_end_time = time.time()
print("Object is at",distance,"cm")
def get():
print("get");
x = str(db.reference('farm-672f9/farm-
672f9/Command/Command'.format()).get())
print(x)
if(x == '"ON"'):#Led on
print("led is on")
GPIO.output(18,1)
if (x == '"OFF"'):#Led off
print("led is off")
GPIO.output(18,0)
if(x == '"BON"'):#buzzer_on
print("Buzzer on")
GPIO.output(24, True)
print("Buzzer off")
GPIO.output(24, False)
if(x == '"UON"'):#Ultrasonic on
print("Ultrasonic on")
ultrasonic()
print("Ultrasonic off")
print("Repellers off")
GPIO.output(24, False)
GPIO.output(18,0)
if(x == '"RON"'):#Repellers on
print("Repellers on")
GPIO.output(24, True)
GPIO.output(18,1)
if(x == '"MOFF"'):
automatic()
def manual():
print("manual")
while True:
print("testing")
if GPIO.input(23):
print("Motion Detected...")
url = base_url+"&field1=1"
print(url)
f = urllib.request.urlopen(url)
response=f.read()
print('response')
print(response)
f.close()
get()
time.sleep(1)
def automatic():
print("automatic")
while True:
x = str(db.reference('farm-672f9/farm-
672f9/Command/Command'.format()).get())
if(x == '"MOFF"'):
if GPIO.input(23):
print("Motion Detected...")
url = base_url+"&field1=1"
print(url)
f = urllib.request.urlopen(url)
response=f.read()
print('response')
print(response)
f.close()
ultrasonic()
GPIO.output(24, True)#buzzer
GPIO.output(18, True)#led
else:
print("not detected")
GPIO.output(24, False)
GPIO.output(18, False)
time.sleep(1)
if(x == '"MON"'):
manual()
while True:
print("testing")
x = str(db.reference('farm-672f9/farm-
672f9/Command/Command'.format()).get())
if (x=='"MON"'):
manual()
if(x=='"MOFF"'):
automatic()
time.sleep(1)
SCREEN SHOTS
TEST CASES:
Introduction:
product. It is the process of exercising software with the intent of ensuring that the
software system meets its requirements and user expectations and does not fail in
an unacceptable manner. There are various types of test. Each test type addresses a
Types of Test:
Unit Testing:
Unit testing is essentially for the verification of the code produced during the coding
phase and the goal is test the internal logic of the module/program. In the Generic
code project, the unit testing is done during coding phase of data entry forms
whether the functions are working properly or not. In this phase all the drivers are
tested they are rightly connected or not. Unit testing is usually conducted as part of
a combined code and unit test phase of the software lifecycle, although it is not
uncommon for coding and unit testing to be conducted as two different phases.
Execution Testing:
The program is successfully loaded and executed with no execution errors. All the
“CSE-Labs” is good.
CONCLUSION
The problem of crop vandalization by wild animals has become a major social
problem in current time. It requires urgent attention for this problem. Thus, this
project carries a great social relevance as it aims to address this problem. This
project will help farmers in protecting their orchards and fields and save them from
significant financial losses and will save them from the unproductive efforts that they
endure for the protection their fields. This will also help them in achieving better
12. BIBLIOGRAPHY
http://www.ijariie.com/AdminUploadPdf/A_SMART_FARMLAND_USING_RASPBERRY
_PI_CROP_VANDALIZATION_PREVENTION___INTRUSION_DETECTION_SYSTEM_14
04.pdf
https://www.electroschematics.com/3864/ultrasound-and-insects/
https://www.researchgate.net/publication/256494027_Damage_to_agricultural_yield
_due_to_farmland_birds_present_repelling_techniques_and_its_impacts_an_insight_
from_the_Indian_perspective
http://www.entomoljournal.com/archives/?year=2018&vol=6&issue=3&part=K&Arti
cleId=3641
http://www.ijecscse.org/papers/IETE2017/13.pdf