Professional Documents
Culture Documents
}
}
else
{
Cmd(0X01);//CLEAR SCREEN OF LCD
PORTCbits.RC2=0;//BUZZER GETS OFF
}
}
void Cmd(int Value)
{
PORTD= Value; //WRITE THE COMMAND TO DATA LINES
PORTCbits.RC0 = 0; //RS-0(COMMAND REGISTER)
PORTCbits.RC1 = 1; //E-1(ENABLE)
Delay_us(25);
PORTCbits.RC1 = 0; //E-0(ENABLE)
}
void Data(int Value)
{
PORTD= Value; // WRITE THE CHARACTER TO DATA LINES
PORTCbits.RC0 = 1; //RS-1(DATA REGISTER)
PORTCbits.RC1 = 1; //E-1(ENABLE)
Delay_us(25);
PORTCbits.RC1 = 0; //E-0(ENABLE)
}
void Send2Lcd(const char Adr, const char *Lcd)
{
Cmd(Adr); //ADDRESS OF LOCATION TO DISPLAY STRING
while(*Lcd!='\0') //CHECK FOR TERMINATION CHARACTER
{
Data(*Lcd); // DISPLAYS THE CHARACTER
Lcd++; //INCREMENT THE POINTER
}
}
void Delay_us(int us)
{
us=us>>1;
while(us!=1)
us--;
} //end of the code
WORKING
WORKING
CONCLUSIONS
➢ Hence the project has been successfully made and
demonstrated through simulation in proteous
software with the help of pic18f4520
microcontroller.
➢ The project is also found useful in many cases like it
can be used in various domains like house
protection from thiefs at night times.
Applications
➢The project is found to be useful in various domains
and other places .
➢At night times ,this can be used for finding thiefs
entering in to house.
➢It can be used to know whether the child has slept
or wokeup by his movement in cradle, and message
can be sent to parent nearby at work in home .
FUTURE SCOPE
➢ One of the most needed advancement in the project is ,it
should be inculcated with different sounds in buzzer which
frightens animals ,which to some extends makes the animal
to leave the field by the time farmer takes necessary action
to avoid the crop damage in prior.
➢ It is one of the smart approach to avoid the damage of the
crop.The use of this system gives good output in future
keeping in mind the importance of crop and agriculture .
THANK YOU
Internship Project Report
on
BACHELOR OF TECHNOLOGY
In
ELECTRONICS AND COMMUNICATION ENGINEERING
By
1
SREENIDHI INSTITUTE OF SCIENCE AND TECHNOLOGY
(Affiliated to Jawaharlal Nehru Technological University, Hyderabad)
Yamnampet (V), Ghatkesar (M), Hyderabad – 501 301
CERTIFICATE
Internal guide:
Dr.G.PRASAD ACHARYA
Associate Professor,Department of ECE
2
DECLARATION
We hereby declare that the work described in this thesis titled “SMART
CROP PROTECTION SYSTEM” which is being submitted by us in partial
fulfilment for the award of Bachelor of Technology in the Department of
Electronics and Communication Engineering, Sreenidhi Institute Of
Science and Technology is the result of investigations carried out by us
under the guidance of Dr.G.PRASAD ACHARYA, Associate Professor,
Department of ECE, Sreenidhi Institute of Science and Technology,
Hyderabad.
No part of the thesis is copied from books/ journals/ internet and whenever
the portion is taken, the same has been duly referred. The report is based on
the project work done entirely by us and not copied from any other source.
The work is original and has not been submitted for any Degree/Diploma of
this or any other university.
Place: Hyderabad
Date: 05-09-2020
3
ACKNOWLEDGEMENTS
4
ABSTRACT
5
Contents
Acknowledgments 4
Abstract 5
CHAPTER1 INTRODUCTION 6
1.1 Motivation 1
1.2 Problem statement (Existing and proposed method) 3
1.3 Objectives 4
CHAPTER 2 HARDWARE REQUIREMENTS 11
2.1 PIC18F4520 MicroController 11
2.2 GSM Module 14
2.3 Passive Infra-Red (PIR) Sensor 16
2.4 Buzzer 17
2.5 Buttons or Switches 17
2.6 16X2 LCD Display 18
2.7 Battery(9V-12V) 19
CHAPTER 3 SOFTWARE REQUIREMENTS 20
3.1 Proteous 8 Professional 20
3.2 MPLABX IDE 21
3.3 XC8 Compiler 23
CHAPTER 4 WORKING 24
4.1 Block Diagram 24
4 .2 Circuit Diagram 25
4.3 Program Code 25
4.4 Working Description 28
CHAPTER 5 CONCLUSIONS & FUTURE SCOPE 28
5.1 Conclusions 28
5.2 Future Scope 28
References 29
6
List of figures
Figure No Name Page No
1.1 Pin Description of PIC18 17
1.2 GSM Module 15
1.3 PIR Sensor 16
1.4 Buzzer 17
1.5 Push Button 17
1.6 16X2 LCD Display 19
1.7 Proteous Interface 21
1.8 Proteous Working 21
1.9 MPLABX IDE 22
2.0 Block Diagram 24
2.1 Circuit Diagram 25
7
1.INTRODUCTION
8
of this paper therefore utilizes global system for mobile. service (SMS).
This system helps us to keep away such wild animals from the
farmlands as well as provides surveillance functionality. It has been
found the odour of rotten egg helps to keep the wild pigs and deer from
destroying the crops, hence the farmers manually spray the rotten egg
solution on their fields, and firecrackers are used to ward off the wild
elephants that destroy the crops.This project is based on surveillance
with an animal ward-off system employed in farmlands in order to
prevent crop vandalization by wild animals. In addition to providing
protection this system distinguishes between an intruder and an
authorized person using RFID’s, various PIR sensors are deployed in
the area to detect any motion and hence turns ON a camera when
movement is detected, thereby providing realtime monitoring. It
involves automation of certain methods used to prevent the wild
animals from entering the farmlands and destroying the crops, an
electronic fire cracker (for bigger animals, like elephant) and a rotten
egg spray (for smaller animals like wild pigs and deer) which have been
found useful to ward off the wild animals, we use Haar feature based
cascade classifiers for object detection to distinguish between the
animal and human. When such intrusions occur, a message will be
automatically.
1.1 MOTIVATION
Nowadays ,farmers crop have threat due to the animals entering
in to the field in absence of farmer .
When the animals enters the field ,it disturbs the crop,and eats
some of crop. So,inorder to avoid this a safety measure has to be
taken to not allow the damage of crop.
Here we thought of a smart crop protection system for farmers
which identifies whenever animal got entered into the field.And
this information is sent to farmer and proper measures are taken
by farmer to prevent the damage of the crop.
9
1.2. PROBLEM STATEMENT (PROPOSED AND EXISTING
METHODS)
The Existing method for this problem is fencing our field area ,but the
major drawback for this method is, it is difficult to remove fencing
whenever it is to be removed for use and during ploughing the field
,farmer cant plough through the corners of the field. So,some part of
the field remains un ploughed Hence,Inorder to prevent the damage of
crop,the entry of animals into the crop is informed to the farmer.
Here,we use PIR sensor for detection of animals in field and the
information is sent to the farmer through call or text message with the
help of GSM module and PIC18F4520 microcontroller to his mobile.
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 ineffective 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 exhaustive
and dangerous methods. In the proposed system, Crop monitoring
is done where sensors are used to collect information in the
agricultural field. In our proposed work, PIR, Smoke sensor and GSM is
used. When animals come near to the PIR sensor and it detects the
animal movement. After getting that initial input signal, it is passed for
further processing. Then it will be given to the microcontroller. Our
system will be activated, immediately buzzer will be on, at the same
time it sends an SMS and makes call to the owner. Microcontroller
Block is used for reading the inputs from PIR and Smoke sensor. Whole
process is controlled by microcontroller. The GSM module is used for
10
sending SMS and making call to farmer when movement or smoke is
detected. It also turns ON the motor, when smoke is detected. It alerts
the farmer that some animals try to enter into the farm. Our LCD data
will be display for SMS sending.
1.3 OBJECTIVES
To design a security system for farm protection.
Prohibit the entry of animal into the farm.
Use GSM module for alerting us.
Design a system that sounds through solar animal repellent
when animal tries to enter into the farm.
In night flash light will focus on that side.
The system ensures that the alarm is not triggered by the
presence of a human in the field, or via any random motion.
The system is capable of turning On/Off automatically and
warding off the animals thus protecting the fields from any
damage also we can setup a Timer as per farmer’s requirement.
2.HARDWARE REQUIREMENTS
Different Hardware Components used in this project are as below
PIC18F4520 MicroController
GSM Module
Passive Infra-Red (PIR) Sensor
Buzzer
Buttons or Switches
16X2 LCD Display
Battery(9V-12V)
2.1.PIC18F4520 MICROCONTROLLER
11
pin (mostly used) while other two come with a 44-pin interface.
This microcontroller version comes with CPU, timers, 10-Bit ADC and
other peripherals that are mainly used to develop a connection with
external devices.
This PIC version, like other models in the PIC community, contains
everything that is required to make an embedded system and drive
automation.
The PIC18F4520 contains 256 bytes of EEPROM data memory, 1536
bytes of RAM, and program memory of 32KB.
It also incorporates 2 Comparators,10-bit Analog-to-Digital (A/D)
converter with 13 channels, and houses decent memory endurance
around 1,000,000 for EEPROM and 100,000 for program memory.
The Enhanced Universal Asynchronous Receiver Transmitter
(EUSART) feature is useful for developing the serial communication
with other devices.
12
Figure No:1.1 Pin diagram of PIC18F4520
In-Circuit Serial Programming
13
in normal conditions.The watchdog timer is more or less a countdown
timer that starts from 1000 and ultimately goes down to zero.Power On
Reset function is very helpful and resets the controller and starts it
from scratch when Vdd raises above a certain threshold value. This
function is very useful to prevent the device from malfunctioning.
PIC18F4520 provides total 7 operating modes that help in more
efficient power management. These modes offer multiple options for
selective power conservation in a variety of applications. The power
managed modes are mainly divided into three main categories called:
Run modes
Sleep modes
Idle modes
These categories help in identifying the areas of the device that are
clocked at a specific speed. The Idle and Run modes can operate in any
of three clock sources named primary, secondary, and internal
oscillator block while Sleep mode is not involved in any clock
source.The switching feature is added in the power managed modes
that use the Timer1 oscillator as a replacement of a primary oscillator.
All clocks will be cleared and stopped working in the Sleep mode.The
MCLR pin is used for calling the external reset for the chip. The reset is
triggered by keeping this pin at a LOW value and is not dependent on
the internal resets.The noise filter is added in the MCLR executing
process that helps in detecting and removing the small pulses. The
MCLRE configuration bit can also be used to disable MCLR input.
2.2.GSM MODULE
14
850MHz, 900MHz, 1800MHz and 1900MHz frequency bands.GSM
system was developed as a digital system using time division multiple
access (TDMA) technique for communication purpose. A GSM digitizes
and reduces the data, then sends it down through a channel with two
different streams of client data, each in its own particular time slot.
The digital system has an ability to carry 64 kbps to 120 Mbps of data
rates.
15
Uses encryption to make phone calls more secure
Short message service (SMS)
PIR sensors allow you to sense motion, almost always used to detect
whether a human has moved in or out of the sensors range. They are
small, inexpensive, low-power, easy to use and don't wear out. For that
reason they are commonly found in appliances and gadgets used in
homes or businesses. PIRs are basically made of a pyroelectric sensor,
which can detect levels of infrared radiation. Everything emits some low
level radiation, and the hotter something is, the more radiation is
emitted. The sensor in a motion detector is actually split in two halves.
The reason for that is that we are looking to detect motion (change) not
average IR levels. The two halves are wired up so that they cancel each
other out. If one half sees more or less IR radiation than the other, the
output will swing high or low.
Features:
Output: Digital pulse high (3V) when triggered (motion detected) digital
low when idle (no motion detected). Pulse lengths are determined by
resistors and capacitors on the PCB and differ from sensor to sensor.
Power supply: 5V-12V input voltage for most modules (they have a
3.3V regulator), but 5V is ideal in case the regulator has different
specs.
16
2.4.BUZZER
2.5.PUSH BUTTONS
17
A push button (also spelled push button) or simply button is a
simple switch mechanism to control some aspect of a machine or
a process. Buttons are typically made out of hard material,
usually plastic or metal .The surface is usually flat or shaped to
accommodate the human finger or hand, so as to be easily depressed
or pushed. Buttons are most often biased switches, although many un-
biased buttons (due to their physical nature) still require a spring to
return to their un-pushed state. Terms for the "pushing" or working of
it is being using for the button as well as by the manually and
include pressing, depressing, mashing, slapping, hitting, and punching.
18
Figure No:1.6 16x2 LCD Display
19
flashlights and a multitude of portable electronic devices. Secondary
batteries (rechargeable) can be discharged and recharged multiple
times using an applied electric current; the original composition of the
electrodes can be restored by reverse current. Examples include
the lead acid batteries used in vehicles and lithium ion batteries used
for portable electronics such as laptops and mobile phones.
3.SOFTWARE REQUIREMENTS
3.1.PROTEOUS 8 PROFESSIONAL
20
manual routing options to the PCB Designer. The schematic drawn in
the ISIS can be directly transferred ARES.
21
MPLAB development ecosystem of software and tools, many of which
are completely free. MPLAB X IDE brings a host of features to help you
quickly debug your projects and minimize your development time.
Some newer features include:
22
available features that are sure to simplify and enhance your
development activities.
3.3.XC8 COMPILER
23
4.WORKING
4.1.BLOCK DIAGRAM
24
4.2.CIRCUIT DIAGRAM
4.3.PROGRAM CODE
#include<pic18f4520.h>/*HEADER FILE*/
void Delay_us(int us); /* FUNCTION DECLARATIONS*/
void Data(int Value);
void Cmd(int Value);
void Send2Lcd(const char Adr, const char *Lcd);
void main() /*MAIN FUNCTION*/
{
/* If you want your microcontroller to work at 1MHZ then comment the
three lines below */
OSCCONbits.IRCF0 = 1 ; // set internal clock to 8 MHz
OSCCONbits.IRCF1 = 1; // For Avoiding switch debouncing problem
25
OSCCONbits.IRCF2= 1;
ADCON1bits.PCFG0 = 1; // These 4 settings below determines the
analog or digital input
ADCON1bits.PCFG1 = 1; // In our case we are making all the pins
digital
ADCON1bits.PCFG2 = 1; // by setting them as 1111
ADCON1bits.PCFG3 = 1; // Check with the datasheet for a nice desc of
these bits and config.
ADCON0bits.ADON = 0; // Disabled ADC
TRISA=0xff; //PORTA CONFIGURED AS INPUT
TRISC=0X00; //PORTC CONFIGURED AS OUTPUT
TRISD=0X00; //PORTD CONFIGURED AS OUTPUT
if(PORTAbits.RA1==1)
{
Delay_us(25);
Cmd(0X30); //LCD SPECIFICATION COMMANDS
Delay_us(25);
Cmd(0X30); //LCD SPECIFICATION COMMANDS
Delay_us(25);
Cmd(0X30); //LCD SPECIFICATION COMMANDS
Delay_us(25);
Cmd(0X38); //DOUBLE LINE DISPLAY COMMAND
Cmd(0X06); //AUTO INCREMENT LOCATION ADDRESS COMMAND
Cmd(0X0C);//LCD DISPLAY ON COMMAND
Cmd(0X01);//CLEAR DISPLAY COMMAND
Send2Lcd(0x84," Hello Welcome");//DISPLAYS STRING IN THE FIRST
LINE
Send2Lcd(0xc0," to the project");//DISPLAYS STRING IN THE SECOND
LINE
Delay_us(100000);
while(PORTAbits.RA1==1){ //IF BUTTON IS ON
if(PORTAbits.RA0==1) // IF PIR SENSOR IS HIGH(ANIMAL IS
DETECTED)
26
{
PORTCbits.RC2=1; //BUZZER GETS TURNED ON
Cmd(0X01); // CLEARS THE LCD
Send2Lcd(0x84," detected"); // PRINTS DETECTED ON LCD
Delay_us(10000);
}
else
{
PORTCbits.RC2=0; //BUZZER GETS TURNED OFF
Cmd(0X01); // CLEARS SCREEN
Send2Lcd(0x84," Not detected");// PRINTS NOT DETECTED
Delay_us(10000);
}
}
}
void Send2Lcd(const char Adr, const char *Lcd)
{
Cmd(Adr); //ADDRESS OF LOCATION TO DISPLAY STRING
while(*Lcd!='\0') //CHECK FOR TERMINATION CHARACTER
{
Data(*Lcd); // DISPLAYS THE CHARACTER
Lcd++; //INCREMENT THE POINTER
}
}
void Delay_us(int us)
{
us=us>>1;
while(us!=1)
us--;
} //end of the code
27
4.4 WORKING DESCRIPTION
5.2.FUTURE SCOPE
The project is found to be useful in various domains and other places .
At night times ,this can be used for finding thiefs entering in to house.
It can be used to know whether the child has slept or wokeup by his
movement in cradle, and message can be sent to parent nearby at work
28
in home .One of the most needed advancement in the project is ,it
should be inculcated with different sounds in buzzer which frightens
animals ,which to some extends makes the animal to leave the field by
the time farmer takes necessary action to avoid the crop damage in prior.
It is one of the smart approach to avoid the damage of the crop.The use
of this system gives good output in future keeping in mind the
importance of crop and agriculture.
References
29