You are on page 1of 72

(Page 1)

A
Major Project Report
On
Automatic Border Alert System for Fishermen
using GPS and GSM Techniques

Submitted
in partial fulfillment of the requirements for
the award of the degree of

Bachelor of Technology

In

ELECTRONICS AND COMMUNICATIONS ENGINEERING


By

M. Chandana (17R15A0448)

Mohammed Fazil (16R11A04N4)

D. Vinay Reddy (16R11A04K8)


Under the Esteemed Guidance of

Mr. U. APPALA RAJU

Assoc Professor

Department of Electronics and Communication Engineering


GEETHANJALI COLLEGE OF ENGINEERING AND TECHNOLOGY
(UGC Autonomous)
Cheeryal (V), Keesara (M), Medchal Dist, Hyderabad– 501 301
(Affiliated to Jawaharlal Nehru Technological University, Hyderabad & Accredited By NAAC & NBA, New Delhi)

2016-2020

“Dept. of ECE, GCET”


Department of Electronics and Communication Engineering

CERTIFICATE

This is to certify that the project seminar report titled Automatic Border Alert System for Fishermen
using GPS and GSM Techniques being submitted by M.Chandana, Mohammed Fazil ,
D.Vinay Reddy bearing hall ticket number 17R15A0448, 16R11A04N4,16R11A04K8 in partial
fulfillment of the requirements for the award of the Degree of Bachelor of Technology in
Electronics and Communication Engineering is a record of bonafide work proposed under
my guidance and supervision.

MR. U. APPALA RAJU(Assoc. Prof) Prof.B.Harikumar


Internal Guide HoD-ECE

Internal Examiner External Examiner


ACKNOWLEGMENTS

We, the students of ECE department of Geethanjali College of Engineering and


Technology would like to convey heartfelt thanks to Dr. S. Udaya Kumar, Principal of the
college for the wonderful encouragement given to us to move ahead in the execution of this
proposed project work.

We are highly grateful to the great personality in the field of Electronics, Prof. B. Hari
Kumar, Head of the Department of Electronics and Communication Engineering of GCET
for guiding and taking care of our career in this field.

We are very happy for being guided by MR. U. APPALA RAJU (Accos.Prof)for her/his
able guidance to us in preparing the abstract and methodology to be followed in the form of
major project seminar report, to complete our major project work successfully.

Lastly, we would thank our overall coordinator Dr.C.V.Narasimhulu, Professor of ECE,


Prof- in-Charge Dr. R. S. Raju (Prof. and Dean, R&D) and members of the Project Review
Committee ( PRC ) for giving us valuable suggestions to complete our major project seminar
report as per given schedule.

Above all, we are very much thankful to the management of Geethanjali College of
Engineering and Technology which was established by the high profile intellectuals for the
cause of technical education in modern era.

With Regards

M. Chandana(17R15A0448)

Mohammed Fazil(16R11A04N4)

D. Vinay Reddy(16R11A04K8)
CONTENTS PAGE NO.s

Abstract ……………….. i

List of Figures ……………….. ii


List of Tables …………………. iii
Chapter 1. Introduction 1
1.1 working principle 1
Chapter 2. Literature Survey 3

Chapter 3. Proposed algorithm 6


3.1 proposed system 6
3.2 proposed system Archictecture 6
3.3 GPS and GSM 7
3.4Methodology 7
3.5Controller 8
3.6GSM Mobile 11
3.7Experimental Results 11
3.8Future Scope 12
Chapter 4 AT89C2051 13
4.1 pin configuration 13
4.1(a) block diagram of AT89C2051 14
4.1(b) pin description 15
4.2 oscillator characteristics 15
4.3 special function register 17
4.4 Restrictions on certain instructions 18
4.5 programming memory lock bits 19
4.6 Lock bit protection modes 19
Chapter 5 Programming Alogrithm 21
5.1 programming the Flash 21
5.2 Programming Alogrithm 21
5.3 Flash Programming Interface 22
5.4 Flash Programming modes 23
5.5 Flash Programming & verification Charactersitics 23
5.6 Flash program &verification waveforms 24
5.7 Dc Charactersitics 25
5.8 External clocks waveforms 26
5.8(a) External clocks drive 26
5.9 Serial port timming 27
CONTENTS Page no:

5.9.1 Shift Register mode 27


5.10 AC testing 27

Chapter 6 DC motors 28
6.1 Princples of Operation 29

Chapter 7 Arduino Uno 31


7.0 Arduino Uno 31
7.1 Buzzer 35
7.2 Electromechanical 35
7.3 Piezoelectric 35
7.4 Relay 36

Chapter 8 Programs 38
8.1 Liquid crystral 41
8.2 Reciever 45
8.3 Transmitter 47

Chapter 9 Conclusion 49

Chapter 10 References 50
Automatic Border Alert System for Fishermen using GPS and GSM Techniques

Abstract
The main idea of this project work is to safeguard the fisherman from the boarder
crossing. In general while hunting the fishes, the fisherman they are not aware of
international boarders and moves further in to other nation waters by which they will be
caught. Though they are innocent, it will be treated as a severe offense in the view of
other nation coast guards and often it happens in indo-Srilanka boarders near
Tamilnadu. To avoid such harassment, here this system is designed as a fisherman
boat device which alerts the fisherman in advance when his boat reaches near to the
boarder. The system is designed with Arduino as main processor and other devices like
GSM, GPS, RF Receiver, DC Motor, LCD, Alarm, etc are interfaced with this processor.
The purpose of GPS is to acquire the global position data of the boat such that
whenever the boat reaches near to the boarder, immediately the processor sends
position data to the our coast guards through GSM module. The information gathered
from the GPS will be in the form of Latitude & Longitude values in North East region and
this data will be transmitted through GSM to the concern mobile phone. When this data
is entered in to the computer Google maps separately, boat location will be displayed.
The DC motor used here is intended to simulate the boat motor which will be switched
off automatically. Means when the boat crosses its limit, the RF receiver interfaced with
the processor acquires warning signal from the antenna tower, this antenna tower
constructed with RF transmitter always transmits warning signal and when the boat is
within the range, motor will be de-energized and at the same time boat location
information will be transmitted automatically. When the boat is taken away from the
antenna tower, automatically motor will be energized and during switched off condition
the boat must be moved manually through oar (Oar means a long stick with a wide flat
blade at one end used to move the boat manually). The antenna tower installed in the
sea water near the boarder can safeguard the boat. For demo purpose, one small pole
will be used over which RF transmitter will be installed. Since the boat device must be
movable, it is designed as battery operated such that when it is brought near to the RF
transmitter, the process begins automatically.

i
“Dept. of ECE, GCET”
LIST OF FIGURES

Fig no: Figure Name Page No:

1.1 GPS Working 2

3.2 Flow of operation 6

3.4 Block diagram 7

3.5(a) PIC Microcontroller 9

3.5(b) Pictorial representation 10

3.5(c) Indo-srilanka loation 10

3.7(a) warning indication 11

3.7(b) Entering GPS location 11

3.7(c) GSM Message 12

4.1 Pin configuration 13

4.1(a) Block diagram 14

4.2 Oscillator Connection 16

4.2(a) External Clock Drive 16

5.4(a) Programming Flash memory 23

5.4(b) Program verification 23


memory

5.6 Flash programming 24


verification wave

5.8 External clock Drive 26

5.9.1 Serial modes 27

5.10 AC testing 27
6.1 DC operation 29

7.1 Electronic sysmbol 35

7.4 PCB 37
LIST OF TABLES

Table no Table Name page no

3.5 Latitude and longitude 8

4.3 Special Function Register 17

4.6 Lock Bit Protection Mode 19

5.4 Programming modes 23

5.5 FlashProgramming 24
charactersitics

5.7 DC charactersitics 25

5.8(a) External Clock Drive 26

5.9(a) Serial port timing 27

9.1 Fisherman death rate 49


Automatic Border Alert System for Fishermen using GPS and GSM Techniques

Chapter 1
INTRODUCTION
Global Positioning System (GPS) provides a wide range of navigation and timing services. With the
combined interlocked usage of the GSM technology, it can be used for border security, tracking of boats
and ships in the oceans and in the seas. The current issue of Indian fishermen being abducted by the Sri
Lankan navy is of serious concern. This paper serves as a benefit for these people where a DGPS
system is attached to the boat which in turn is connected to an alarm device. The DGPS receives the
topographic location of the boat in the sea and then triggers an alarm if the border of the country is
crossed by the boat. Topographic location of a country border can be obtained with the information of
the latitude and longitude of the place and position of the boat. The borders of each country are defined
in two levels. The first level extends till a certain distance in the sea and it is called as the National order
of the country. Succeeding the national borders and just a few kilometers towards is the International
borders. The additional advantage from the existing border alert systems that are already imparted is
that, the interlock of the GSM where minute by minute position of the boat can be received through an
SMS to the family members from the control room through the use of DGPS. The Tamil Nadu fishermen
even today invoke the historical rights and routinely stay into the International Maritime Boundary Line
(IMBL) for fishing.

Working Principle

The GPS Modem will continuously give the signal which determines the latitude and longitude
and indicates the position of the fishermen to them. Then it gives the output which gets read and
displayed in the LCD. The same data is sent to the mobile of the fisherman and simultaneously the
same data is sent to the Sea border security. An EEPROM is used to store the data, received by GPS
receiver. The hardware which interfaces with microcontroller are LCD display, GSM modem and GPS
Receiver. GPS (Global Positioning System) is increasingly being used for a wide range of applications
[2]. It provides reliable positioning, navigation, and timing services to world wide users on a continuous
basis in all weather, day and night, anywhere on or near the Earth. 24 satellites inclined at 55° to the
equator orbit the Earth every 11 hours and 58minutes at a height of 20,180 km on 6 different orbital
Lanes and each one of these satellites has up to four atomic clocks on board. All we require is an
accurate clock. By comparing the arrival time of the satellite signal with the on board clock time, at which

1
“Dept. of ECE, GCET”
Automatic Border Alert System for Fishermen using GPS and GSM Techniques
the signal was emitted, the latitude and longitudinal degree of the boat’s location is determined. The
current design is an

2
“Dept. of ECE, GCET”
embedded application, which will continuously monitor a moving Boat and once the boat goes beyond
the level of the defined layer the particular operation will be done. For doing so an PIC microcontroller is
interfaced serially to a GSM MODEM AND GPS receiver.

Fig:1 GPS working

1.1 Existing System

At the present time there are few existing systems which help to identify the current position of
the boats/ships using GPS System and view them on an electronic map. For the purpose of
identification the fisherman are using the GPS72h, equipment used for the navigation in sea. It provides
the fastest and most accurate method for mariners
CHAPTER -2
Literature Survey

Especially the system designed here is intended to safeguard the fisherman’s those who are hunting
the fishes near the international water boarders in a sea. Catching fishes is their main livelihood of the
fisherman’s and since they are innocents, they are not aware of international boarders and hence it is
essential to warn them when they reach near the boarder. In this regard here this electronic device is
designed which must be installed in their boat.

A sea is a large body of salty water that may be connected with an ocean or may be a large salt lake.
Oceans, seas, islands and coastal areas form an integrated ecosystem of our planet and many million
people are depends up on this environment for global food security and for sustaining economic
prosperity and well-being of many national economies, particularly in developing countries like our
country. Oceans and seas cover over 70 per cent of the Earth's surface. Nowadays many fisherman and
people are traveling in sea are punished by other country due to crossing border. This is happening
because they don’t know the border limit when in sea. To help those people this project is designed. In
this project GPS, GSM, RF network and embedded system plays a major role.

The island like Sri Lanka, peninsula like India and the coastal countries are separated by their
navel/sea/maritime borders. The people livelihood in coastal area of those countries purely depends on
fishing occupation in the sea. Crossing the border is being a serious offence. Especially, In Tamilnadu
nearly 20,000 boats perform fishing in the Bay of Bengal. Due to carelessness or unknowing the
boundary limit, the fisherman used to rude the maritime borders. Once they rude the border, they
arrested or killed by the relevant navy and they are being abducted and their boats are being captured
by the neighborhood countries coastal guards. In such situation the lives of fishermen continue to be
difficult. It is a major threatening issue and leads to loss in the both humans as well as their economic
incomes. As far as the fishing activity has not been peaceful since the issue of maritime border crossing.
Coastal route is always a choice of intruders. According to our Indian coast guard survey office, many
Indian fishermen are killed in many incidents by Sri Lanka navy. In 2013 Madurai bench of madras high
court quoted that in order to avoid this issue, there is a need for producing significant realization among
our fishermen to avoid crossing
over into Sri Lanka water boundary. Since those days don’t have any sophisticated devices to warn the
fisherman’s, many of them were killed and many people were caught by other nation coast guards.

The most important duties of the Coast Guard are: Safeguarding and protecting artificial islands,
offshore terminals, installations, and other devices in the maritime zone. Protecting and assisting
fishermen in distress. Preserving and protecting marine environment, including controlling marine
pollution. The Indian Coast Guard is an armed force that protects India's maritime interests and enforces
maritime law, with jurisdiction over the territorial waters of India, including its contiguous zone and
exclusive economic zone.

Now coming to the project work, the main processing unit is constructed with Arduino Uno and this
device is programmed to acquire the global position data through GPS. The data acquired from this
device will be in the form of latitude & longitude values and it will be displayed through LCD. As the
system is supposed to be installed in the boat permanently, the exact position of the boat can be
displayed wherever it goes. Geographically, our nation exists in north-east region and the global position
values acquired from the satellites through GPS will be displayed in degrees. Latitude and longitude is a
pair of coordinate values used to describe a position on the plane of a geographic coordinate system.
Since it is a prototype module, only values in numbers will be displayed and when this data entered in to
the computer through Google maps, exact location over the globe where this GPS is existed with pin
point can be displayed. Presently we are getting only coordinates values and are displayed through
LCD.
The main purpose of using GSM is to send information to the coast guards during emergencies.
Means when the boat reaches near to the boarder, it acquires a warning signal from the antenna tower
through RF communication system. When the main processor receives warning signal, at that particular
boat position information in the form of longitude and latitude values will be passed to the cost guard’s
mobile numbers through this GSM module. Since it is a prototype module and we can not send data to
the authority, here student mobile numbers are stored in to the main processor such that particular cell
phones can receive the data. For demo purpose one or two mobile numbers can be stored in to the
system.

The main processing unit acquires warning signal through sub system, here the sub-system is
constructed with 89C2051 microcontroller chip and it is having a communication link with antenna tower.
The output of this sub system is fed to the main processor such that whenever the boat reaches near to
the antenna tower, the RF receiver interfaced with sub-system will have a communication link with RF
transmitter arranged over the antenna tower. The antenna tower must be installed in to the sea water at
boarder permanently such that both nations fishermen can get a warning signal and therefore this
antenna tower can safe guard both nations fishermen’s. Since it is a prototype module, only one
antenna tower will be constructed for demo purpose by which basic concept can be proved practically.
But for real time applications, number of antenna towers must be installed across the boarder.

The warning signal generator cum transmitter circuit is also constructed with another 89C2051
microcontroller chip and this chip is programmed to transmit a continuous signal in the form of 8-bit data.
To simulate antenna tower, the demo module is having one tiny tower made of metal structure and data
transmitter circuit will be arranged over this tower. The detailed description of entire system will be
explained in following chapters and regarding description of active devices used in the system wi ll be
explained in next chapter.
Chapter 3
PROPOSED ALGORITHM
3.1 Proposed System

The proposed system uses a GPS receiver which receives signal from the satellite and gives the
current position of the boat. The proposed system is used to detect the border of the country through the
specified longitude and latitude of the position, not only between Sri Lanka and India but all over the
world. The particular layer level i.e. border can be predefined and this can be stored in microcontroller
memory. The current value is compared with predefined values and if these values are same,
immediatel y the particular operation will be done i.e, the microcontroller gives instruction to the alarm to
buzzer. It also uses a message transmitter to send message to the base station which monitors the
boats in the sea. The system provides an indication to both fisherman and to coastal guard. Thus it
saves the lives of the fisherman and alerts the base station to provide help [3]. misses warning if he
moved ahead then it shows distance information and also motor will stop now fishermen can start a boat
once it is an indication that border is just few nautical miles away from the border if he ignored and
moved on towards third location whole boat will stop and the location of that point is send to navy
control room and they will come and verify the legitimacy of fishermen and they have to put an randomly
generated key to start boat and same location is sent to family members

3.2 Proposed System Architecture

The GPS receiver receives the signal and converts it into desired data message. The data is sent
to microcontroller and microcontroller extracts the latitude and longitude from the data. The positions are
compared with the stored Boundary latitude and longitude positions. If the vessel is found to be in
predefined location certain warning methods will occurs .
86  ISSN: 2502-4752

Figure 3.2. Flow of operation

3.3 GPS &GSM


Global Positioning Device

A GPS navigation device is any device that receives Global Positioning System (GPS) signals for
the purpose of determining the device's current location on Earth. GPS devices provide latitude and
longitude information, and some may also calculate altitude. GPS devices are used in military, aviation,
marine and consumer product applications.

GPS Accuracy

The accuracy of GPS depends on the type of receiver. Most hand-held GPS units have about 10-
20 meter accuracy. Other types of receivers use a method called Differential GPS (DGPS) to obtain
much higher accuracy. DGPS requires an additional receiver fixed at a known location nearby.
Observations made by the stationary receiver are used to correct positions recorded by the roving units,
producing an accuracy greater than 1meter.

3.4 METHODOLOGY
The GPS device will frequently give the signal which determines the latitude and longitude and indicates
the position of the boat and it is displayed in the LCD. The hardware which interfaces with
microcontroller, LCD display, GSM modem and GPS Receiver. GPS provides consistent positioning,
navigation, and timing services to users on a continuous basis in every day and night.

GPS store the storage of the maritime position. While comparing the previous maritime restricted
position and current position and result will be the latitude and longitudinal degree of the boat’s location
is determined If the boat nearer to the restricted zone ,automatically warning message will be send to
the LCD display which is in boat. The warning message are send by using a GSM Modem.

Then the fishermen fails to ignore the warning and they move to reach the restricted zone
automatically engine gets off by means of relay and send through the message to the coastal guard. A
microcontroller is interfaced serially to a GSM modem and GPS receiver. The block diagram of the
entire system is given.

Fig :3.4 block diagram


part of seas as towers cannot be placed in middle of the ocean so it place in coastal control office. Thus
the coastal continuously receive the GPS information from the GPS Address.

3.5 Controller
PIC microcontrollers (Programmable Interface Controllers), are electronic circuits that can be
programmed to carry out a vast range of tasks They are found in most electronic devices such as alarm
systems, computer control systems, phones, in fact almost any electronic device PIC Microcontrollers
are relatively cheap and can be bought as pre-built circuits or as kits that can be assembled by the user.
Figure 3.5(a)PIC microcontroller

Microcontroller receives the data from the GPS receiver through UART. the data received
contains many details along with latitude and longitude. The latitude and Longitude of the current
position is separated from the detailed data from GPS. The current positions are compared with already
stored latitude and longitude of countries boundary locations. At first the latitude is compared with
stored latitude which identifies if the current position is located near to the boundary. If the latitude
matches then the adjacent latitudes and longitudes of the present latitude is retrieved from the
microcontroller. The current position received from GPS is stored as S1(latitude), S2 (longitude). The
latitude S1 is compared with stored latitudes. If latitude match, then adjacent latitude and longitudes
(X1, Y1 and X2, Y2) are retrieved from stored table and compared and simultaneously warning
techniques are implemented

Table 3.5 Table of latitude & Longitudes


Positions Latitude Longitude

Location 1 12˚ 05’.0 N 82˚ 03’.0 E


Location 2 12˚ 05’.8 N 82˚ 05’.0 E
Location 3 12˚ 05’.4 N 82˚ 09’.5 E
Location 4 12˚ 33’.0 N 82˚ 46’.0 E
Figure 3.5(b) Pictorial representation of locations

Figure 3.5(c) Indo-Sri lanka reference locations

Maritime Boundary between Indian and Sri-Lanka

The boundary points are marked above. These points should be stored in microcontroller. The
computation is done in microcontroller with these points. Thus vessel crossing the border is being
calculated.

Consequence
Boat Position and Navigation System contains,

Location 1: buzzer indication

Location 2: motor speed control indication.

Location 3: motor stops.

Location 4: final verification


3.6 GSM Module
GSM module is used for transmission of message seeking assistance. GSM cannot be used in
oceans as towers cannot be placed in oceans. Thus CDMA network or satellites can be used for
message transmissions .When vessel crosses border, the stored message along with current latitude
and longitude positions is sent to the desired GSM module which is stored already. The prototype of the
device is show in Figure 3.6.

Figure 3.6 Working prototype

Because GPS receivers do not have atomic clocks, there is a great deal of uncertainty when
measuring the size of the Spheres. Each radius corresponds to the distance calculated to the satellite.
All possible distances to the satellite are located on the circumference of the circle.

3.7 Experimental Results

Border alert system for fishermen is used to detect the boundary location and warn the fishermen
in danger situations. It not only finds the GPS value, but also compares with the stored value in the
microcontroller, and makes a decision as to whether the fishermen is in the warning range or not.

Figure 3.7(a) Warning indication Figure 3.7(b) Entering GPS locations


Figure 3.7(c) GSM message
3.8 Future Scope

We can use the EEPROM to store the previous Navigating Positions up to 256 locations. We can
navigate up ton number of locations by increasing the memory of EEPROM.

We can reduce the size of the kit by using GPS+GSM on the same module of GPS navigation

We can increase the accuracy up to 3m by increasing the cost of the GPS receivers.

Benefits

1. The hijack of the ship by the pirates can be eradicated.

2. The lost ship wrecks due to natural calamities can be identified

3. By keeping the kits in the entire boats and by knowing the locations of all boats
we can use our kit to assist the traffic.

4. In case of any accident on the sea. it can be detected by the system and the accident
location of the boat is sent to the rescue team.

Application

1. We can use this device also as bomb detector


2. Location of any lost vehicle could be found
.
CHAPTER 4
AT89C2051
4.0 Description
The AT89C2051 is a low-voltage, high-performance CMOS 8-bit microcomputer with 2K bytes of
Flash programmable and erasable read only memory (PEROM). The device is manufactured using
Atmel’s high-density nonvolatile memory technology and is compatible with the industry-standard
MCS-51 instruction set. By combining a versatile 8-bit CPU with Flash on a monolithic chip, the
Atmel AT89C2051 is a power- ful microcomputer which provides a highly-flexible and cost-effective
solution to many embedded control applications.
The AT89C2051 provides the following standard features: 2K bytes of Flash, 128 bytes of RAM,
15 I/O lines, two 16-bit timer/counters, a five vector two-level interrupt architecture, a full duplex
serial port, a precision analog comparator, on-chip oscillator and clock circuitry. In addition, the
AT89C2051 is designed with static logic for opera- tion down to zero frequency and supports two
software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM,
timer/counters, serial port and interrupt system to continue functioning. The power-down mode
saves the RAM contents but freezes the oscillator disabling all other chip functions until the next
hardware reset.

4.1 Pin Configuration


PDIP/SOIC
RST/VPP
VCC
(RXD) P3.0
P1.7
20 P1.6
(TXD) P3.1
P1.5
19 P1.4
XTAL2
P1.3
XTAL1
18 P1.2
(INT0) P3.2
(INT1) P3.3
P1.1 (AIN1)
(TO) 17
P1.0 (AIN0)
P3.4
P3.7
16
(T1) P3.5

GND
Figure: 4.1 pin configuration
Automatic Border Alert System for Fishermen using GPS and GSM Techniques

BlockDiagram
fig:4.1(a) block diagram

14 1
“Dept. of ECE, GCE ”
T
Automatic Border Alert System for Fishermen using GPS and GSM Techniques

Pin Description

VCC
Supply voltage.

GND
Ground.

Port 1
Port 1 is an 8-bit bi-irectional I/O port. Port pins P1.2 to P1.7 provide internal pullups. P1.0 and P1.1
require exter- nal pullups. P1.0 and P1.1 also serve as the positive input (AIN0) and the negative input
(AIN1), respectively, of the on-chip precision analog comparator. The Port 1 output buffers can sink
20 mA and can drive LED displays directly. When 1s are written to Port 1 pins, they can be used as
inputs. When pins P1.2 to P1.7 are used as inputs and are externally pulled low, they will source
current (IIL) because of the internal pullups.

Port 1 also receives code data during Flash programming and verification.

Port 3
Port 3 pins P3.0 to P3.5, P3.7 are seven bi-irectional I/O pins with internal pullups. P3.6 is hard-wired
as an input to the output of the on-chip comparator and is not accessible as a general purpose I/O pin.
The Port 3 output buffers can sink 20 mA. When 1s are written to Port 3 pins they are pulled high by
the internal pullups and can be used as inputs. As inputs, Port 3 pins that are externally being
pulled low will source current (IIL) because of the pullups.

Port Pin Alternate Functions


P3.0 RXD (serial input port)
P3.1 TXD (serial output port)
P3.2 INT0 (external interrupt 0)
P3.3 INT1 (external interrupt 1)

P3.4 T0 (timer 0 external input)


P3.5 T1 (timer 1 external input)
FIG:4.1(b) Port 3 listed pin
4.2 Oscillator Characteristics
XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier which can be
configured for use as an on-chip oscillator, as shown in Figure 1. Either a quartz crystal or ceramic

15
“Dept. of ECE, GCET”
Automatic Border Alert System for Fishermen using GPS and GSM Techniques
resonator may

16
“Dept. of ECE, GCET”
be used. To drive the device from an external clock source, XTAL2 should be left unconnected while
XTAL1 is driven as shown in Figure 2. There are no requirements on the duty cycle of the external clock
signal, since the input to the internal clocking circuitry is through a divide-by-two flip-flop, but minimum
and maxi- mum voltage high and low time specifications must be observed.

Figure 4.2 Oscillator Connections

Note: C1, C2 = 30 pF  10 pF for Crystals


= 40 pF  10 pF for Ceramic Resonators

Figure 4.2(a) External Clock Drive Configuration


4.3 Special Function Registers
A map of the on-chip memory area called the Special Func- tion Register (SFR) space is shown in the
table below.
Note that not all of the addresses are occupied, and unoc- cupied addresses may not be implemented
on the chip. Read accesses to these addresses will in general return

B 00000000

ACC 00000000

PSW 00000000

IP XXX00000
P3 11111111
IE 0XX00000

SCON 00000000 SBUF XXXXXXXX


P1 11111111
TCON 00000000

TMOD 00000000 TL0 00000000 TL1 00000000 TH0TH1


SP 00000111 DPL 00000000 DPH 00000000 0000000000000000
PCON 0XXX0000

Table: 4.3 special function Register


4.4 Restrictions on Certain Instructions
The AT89C2051 and is an economical and cost-effective member of Atmel’s growing family of
microcontrollers. It contains 2K bytes of flash program memory. It is fully com- patible with the MCS-51
architecture, and can be programmed using the MCS-51 instruction set. However, there are a few
considerations one must keep in mind when utilizing certain instructions to program this device.

All the instructions related to jumping or branching should be restricted such that the destination address
falls within the physical program memory space of the device, which is 2K for the AT89C2051. This
should be the responsibility of the software programmer. For example, LJMP 7E0H would be a valid
instruction for the AT89C2051 (with 2K of memory), whereas LJMP 900H would not.

1.Branching instructions:
LCALL, LJMP, ACALL, AJMP, SJMP, JMP @A+DPTR
These unconditional branching instructions will execute correctly as long as the programmer keeps in
mind that the destination branching address must fall within the physical boundaries of the program
memory size (locations 00H to 7FFH for the 89C2051). Violating the physical space limits may cause
unknown program behavior.
CJNE [...], DJNZ [...], JB, JNB, JC, JNC, JBC, JZ, JNZ With
these conditional branching instructions the same rule above applies. Again, violating the memory
boundaries may cause erratic execution.
For applications involving interrupts the normal interrupt service routine address locations of the 80C51
family archi- tecture have been preserved.

2.MOVX-related instructions, Data Memory:


The AT89C2051 contains 128 bytes of internal data mem- ory. Thus, in the AT89C2051 the stack depth
is limited to 128 bytes, the amount of available RAM. External DATA memory access is not supported in
this device, nor is exter- nal PROGRAM memory execution. Therefore, no MOVX [...] instructions
should be included in the program.
A typical 80C51 assembler will still assemble instructions, even if they are written in violation of the
restrictions men- tioned above. It is the responsibility of the controller user to know the physical features
and limitations of the device being used and ad just the instru ctions used correspondingly.
4.5 Program Memory Lock Bits
On the chip are two lock bits which can be left unpro- grammed (U) or can be programmed (P) to
obtain the additional features listed in the table below:

4.6 Lock Bit Protection Modes(1)


Program Lock Bits
LB1 LB2 Protection Type
1 U U No program lock features.
2 P U Further programming of the Flash
is disabled.
3 P P Same as mode 2, also verify is
disabled.

Table: 4.6 : Lock bit Protection mode

Note: 1. The Lock Bits can only be erased with the Chip Erase operation.

Idle Mode
In idle mode, the CPU puts itself to sleep while all the on- chip peripherals remain active. The mode is
invoked by software. The content of the on-chip RAM and all the spe- cial functions registers remain
unchanged during this mode. The idle mode can be terminated by any enabled interrupt or by a
hardware reset.

P1.0 and P1.1 should be set to “0” if no external pullups are used, or set to “1” if external pullups are
used.
It should be noted that when idle is terminated by a hard- ware reset, the device normally resumes
program execution, from where it left off, up to two machine cycles before the internal reset algorithm
takes control. On-chip hardware inhibits access to internal RAM in this event, but access to the port
pins is not inhibited. To eliminate the possibility of an unexpected write to a port pin when Idle is
terminated by reset, the instruction following the one that invokes Idle should not be one that writes to
a port pin or to external memory.
Power-down Mode
In the power down mode the oscillator is stopped, and the instruction that invokes power down is the
last instruction executed. The on-chip RAM and Special Function Regis- ters retain their values until
the power down mode is terminated. The only exit from power down is a hardware reset. Reset
redefines the SFRs but does not change the on-chip RAM. The reset should not be activated before
VCC is restored to its normal operating level and must be held active long enough to allow the
oscillator to restart and stabilize.

P1.0 and P1.1 should be set to “0” if no external pullups are used, or set to “1” if external pullups are
used.
CHAPTER 5 PROGRAMMING ALGORITHM

5.1 Programming The Flash


The AT89C2051 is shipped with the 2K bytes of on-chip PEROM code memory array in the erased
state (i.e., con- tents = FFH) and ready to be programmed. The code memory array is programmed
one byte at a time. Once the array is programmed, to re-program any non-blank byte, the entire
memory array needs to be erased electrically.

Internal Address Counter: The AT89C2051 contains an internal PEROM address counter which
is always reset to 000H on the rising edge of RST and is advanced by apply- ing a positive going pulse
to pin XTAL1.

5.2 Programming Algorithm: To program the AT89C2051, the following sequence is


recommended.

1. Power-up sequence:
Apply power between VCC and GND pins Set RST and XTAL1 to GND

2. Set pin RST to “H” Set pin P3.2 to “H”


3. Apply the appropriate combination of “H” or “L” logic levels to pins P3.3, P3.4, P3.5, P3.7 to select
one of the programming operations shown in the PEROM Pro gramming Modes table.
To Program and Verify the Array:
4. Apply data for Code byte at location 000H to P1.0 to P1.7.
5. Raise RST to 12V to enable programming.
6. Pulse P3.2 once to program a byte in the PEROM array or the lock bits. The byte-write cycle is self-
timed and typically takes 1.2 ms.
7. To verify the programmed data, lower RST from 12V to logic “H” level and set pins P3.3 to P3.7 to
the appropiate levels. Output data can be read at the port P1 pins.
8. To program a byte at the next address location, pulse XTAL1 pin once to advance the internal
address counter. Apply new data to the port P1 pins.
9. Repeat steps 5 through 8, changing data and advancing the address counter for the entire 2K bytes
array or until the end of the object file is reached.
10. Power-off sequence: set XTAL1 to “L”
set RST to “L” Turn VCC power off
Data Polling: The AT89C2051 features Data Polling to indicate the end of a write cycle. During a
write cycle, an attempted read of the last byte written will result in the com- plement of the written data
on P1.7. Once the write cycle has been completed, true data is valid on all outputs, and the next cycle
may begin. Data Polling may begin any time after a write cycle has been initiated.

Ready/Busy: The Progress of byte programming can also be monitored by the RDY/BSY output
signal. Pin P3.1 is pulled low after P3.2 goes High during programming to indi- cate BUSY. P3.1 is
pulled High again when programming is done to indicate READY.

Program Verify: If lock bits LB1 and LB2 have not been programmed code data can be read back
via the data lines for verification:
1. Reset the internal address counter to 000H by bringing RST from “L” to “H”.
2. Apply the appropriate control signals for Read Code data and read the output data at the port P1 pins.
3. Pulse pin XTAL1 once to advance the internal address counter.
4. Read the next code data byte at the port P1 pins.
5. Repeat steps 3 and 4 until the entire array is read.
The lock bits cannot be verified directly. Verification of the lock bits is achieved by observing that their
features are enabled.
Chip Erase: The entire PEROM array (2K bytes) and the two Lock Bits are erased electrically by
using the proper combination of control signals and by holding P3.2 low for 10 ms. The code array is
written with all “1”s in the Chip Erase operation and must be executed before any non- blank memory
byte can be re-programmed.
Reading the Signature Bytes: The signature bytes are read by the same procedure as a normal
verification of locations 000H, 001H, and 002H, except that P3.5 and P3.7 must be pulled to a logic
low. The values returned are as follows.

(000H) = 1EH indicates manufactured by Atmel (001H) = 21H indicates 89C2051

5.3 Programming Interface


Every code byte in the Flash array can be written and the entire array can be erased by using the
appropriate combi- nation of control signals. The write operation cycle is self- timed and once
initiated, will automatically time itself to completion.
All major programming vendors offer worldwide support for the Atmel microcontroller series. Please
contact your local programming vendor for the appropriate software revision.
5.4 Flash Programming Modes
Mode RST/V P3.2/PROG P3 P3 P3 P3
PP .3 .4 .5 .7
Write Code Data(1)(3) 12V L H H H

Read Code Data(1) H H L L H H


Write Lock Bit - 1 12V H H H H

Bit - 2 12V H H L L

Chip Erase 12V H L L L


(2)
Read Signature Byte H H L L L L
Table: 5.4: Flash Programming Modes

Notes: 1. The internal PEROM address counter is reset to 000H on the rising edge of RST and is
advanced by a positive pulse at XTAL 1 pin.
2. Chip Erase requires a 10 ms PROG pulse.
3. P3.1 is pulled Low during programming to indicate RDY/BSY.

Figure 5.4(a) Programming the Flash Memory Figure 5 .4(b) Verifying the Flash Memory
5.5 Flash Programming and Verification Characteristics
TA = 0°C to 70°C, VCC = 5.0  10%
Symbol Parameter Min Max Units
VPP Programming Enable Voltage 11.5 12.5 V
IPP Programming Enable Current 250 A
tDVGL Data Setup to PROG Low 1.0 s
tGHDX Data Hold after PROG 1.0 s
tEHSH P3.4 (ENABLE) High to VPP 1.0 s
tSHGL VPP Setup to PROG Low 10 s
tGHSL VPP Hold after PROG 10 s
tGLGH PROG Width 1 110 s
tELQV ENABLE Low to Data Valid 1.0 s
tEHQZ Data Float after ENABLE 0 1.0 s
tGHBL PROG High to BUSY Low 50 ns
tWC Byte Write Cycle Time 2.0 ms
tBHIH RDY/BSY\ to Increment Clock Delay 1.0 s
tIHIL Increment Clock High 200 ns
Table:5.5: Flash programming characteristics

Note: 1. Only used in 12-volt programming mode.

5.6 Flash Programming and Verification Waveforms

Fig: 5.6 : Flash Programming verification waveforms


5.7 DC Characteristics
TA = -40°C to 85°C, VCC = 2.0V to 6.0V (unless otherwise noted)
Symbol Parameter Condition Mi Max Units
n
VIL Input Low-voltage - 0.2 VCC - 0.1 V
0.5
VIH Input High-voltage (Except XTAL1, RST) 0.2 VCC + 0.9 VCC + V
0.5
VIH1 Input High-voltage (XTAL1, RST) 0.7 VCC VCC + V
0.5
VOL Output Low- IOL = 20 mA, VCC = 5V 0.5 V
voltage(1) (Ports 1, IOL = 10 mA, VCC =
3) 2.7V

VOH Output High- IOH = -80 A, VCC = 5V  10% 2.4 V


voltage (Ports 1, 3)
IOH = -30 A 0.75 VCC V
IOH = -12 A 0.9 VCC V
IIL Logical 0 Input VIN = 0.45V -50 A
Current (Ports 1, 3)
ITL Logical 1 to 0 Transition Current VIN = 2V, VCC = 5V  10% -750 A
(Ports 1, 3)
ILI Input Leakage 0 < VIN < VCC 10 A
Current (Port P1.0,
P1.1)
VOS Comparator Input Offset Voltage VCC = 5V 20 mV
VCM Comparator Input Common 0 VCC V
Mode Voltage
RRST Reset Pull-down Resistor 50 300 K
CIO Pin Capacitance Test Freq. = 1 MHz, TA = 25°C 10 pF
ICC Power Supply Current Active Mode, 12 MHz, VCC = 6V/3V 15/5.5 mA
Idle Mode, 12 MHz, VCC = 6V/3V 5/1 mA
P1.0 & P1.1 = 0V or VCC
Power-down Mode(2) VCC = 6V P1.0 & P1.1 = 0V or VCC 100 A
VCC = 3V P1.0 & P1.1 = 0V or VCC 20 A
Table:5.7: DC characterstics

Notes: 1. Under steady state (non-transient) conditions, I OL must be


externally limited as follows: Maximum IOL per port pin: 20 mA
Maximum total IOL for all output pins: 80 mA

If IOL exceeds the test condition, V OL may exceed the related specification. Pins are not
guaranteed to sink current greater than the listed test conditions.
2. Minimum VCC for Power-down is 2V.

5.8 External Clock Drive Waveforms

Fig: 5:8: External Clock Drive Waveforms

5.8(a)External Clock Drive


VCC = 2.7V to 6.0V VCC = 4.0V to 6.0V
Symbol Parameter Min Max Min Max Units
1/tCLCL Oscillator Frequency 0 12 0 2 MHz
4
tCLCL Clock Period 8 4 n
3. 1. s
3 6
tCHCX High Time 3 1 n
0 5 s
tCLCX Low Time 3 1 n
0 5 s
tCLCH Rise Time 20 2 n
0 s
tCHCL Fall Time 20 2 n
0 s
Table: 5.8(a): External Clock Drive
5.9 Serial Port Timing: Shift Register Mode Test Conditions
VCC = 5.0V  20%; Load Capacitance = 80 pF
12 MHz Osc Variable Oscillator
Symbol Parameter Min Max Min Max Units
tXLXL Serial Port Clock Cycle Time 1.0 12tCLCL s
tQVXH Output Data Setup to Clock Rising Edge 700 10tCLCL- ns
133
tXHQX Output Data Hold after Clock Rising Edge 50 2tCLCL- ns
117
tXHDX Input Data Hold after Clock Rising Edge 0 0 ns
tXHDV Clock Rising Edge to Input Data Valid 70 10tCLCL-133 ns
0
Table:5.9(a): serial port timing

5.9.1 Shift Register Mode Timing Waveforms

Fig: 5.9.1(b) : Shift Register mode timing

5.10 AC Testing Input/Output Waveforms(1)

Fig: 5.10 :Ac testing

Note: 1. AC Inputs during testing are driven at V CC - 0.5V for a logic 1 and 0.45V for a logic 0. Timing
measurements are made at VIH min. for a logic 1 and VIL max. for a logic 0.
CHAPTER – 6

DC MOTORS

6 DC MOTORS – AN OVER VIEW

Permanent magnet DC motor responds to both voltage and current. The steady state voltage
across a motor determines the motor’s running speed, and the current through its armature windings
determines the torque. Apply a voltage and the motor will start running in one direction; reverse the
polarity and the direction will be reversed. If you apply a load to the motor shaft, it will draw more current,
if the power supply does not able to provide enough current, the voltage will drop and the speed of the
motor will be reduced. However, if the power supply can maintain voltage while supplying the current, the
motor will run at the same speed. In general, you can control the speed by applying the appropriate
voltage, while torque is controlled by current. In most cases, DC motors are powered up by using fixed
DC power supply, therefore; it is more efficient to use a chopping circuit.

Consider what happens when a voltage applied to a motor’s windings is rapidly turned ON and
OFF in such a way that the frequency of the pulses produced remains constant, but the width of the ON
pulse is varied. This is known as Pulse Width Modulation (PWM). Current only flows through the motor
during the ON portion of the PWM waveform. If the frequency of the PWM input is high enough, the
mechanical inertia of the motor cannot react to the ripple wave; instead, the motor behaves as if the
current were the DC average of the ripple wave. Therefore, by changing the width of pulse, we can
control the motor speed.

At the most basic level, electric motors exist to convert electrical energy into mechanical energy.
This is done by way of two interacting magnetic fields -- one stationary, and another attached to a part
that can move. A number of types of electric motors exist, but most BEAM bots use DC motors in some
form or another. DC motors have the potential for very high torque capabilities (although this is generally
a function of the physical size of the motor), are easy to miniaturize. easy to miniaturize, and can be
"throttled" via adjusting their supply voltage. DC motors are also not only the simplest, but the oldest
electric motors.

The basic principles of electromagnetic induction were discovered in the early 1800's by Oersted,
Gauss, and Faraday. By 1820, Hans Christian Oersted and Andre Marie Ampere had discovered that an
electric current produces a magnetic field. The next 15 years saw a flurry of cross-Atlantic experimentation
and innovation, leading finally to a simple DC rotary motor. A number of men were involved in the work,
so proper credit for the first DC motor is really a function of just how broadly you choose to define the
word "motor

6.1 Principles of operation

In any electric motor, operation is based on simple electromagnetism. A current-carrying


conductor generates a magnetic field; when this is then placed in an external magnetic field, it will
experience a force proportional to the current in the conductor, and to the strength of the external
magnetic field. As you are well aware of from playing with magnets as a kid, opposite (North and South)
polarities attract, while like polarities (North and North, South and South) repel. The internal
configuration of a DC motor is designed to harness the magnetic interaction between a current-carrying
conductor and an external magnetic field to generate rotational motion .

Let's start by looking at a simple 2-pole DC electric motor (here dark black represents a magnet or
winding with a "North" polarization, while light colour represents a magnet or winding with a "South"
polarization).

Fig: 6.1:dc operation

Every DC motor has six basic parts -- axle, rotor (a.k.a., armature), stator, commutator, field
magnet’s, and brushes. In most common DC motors, the external magnetic field is produced by high-
strength permanent magnets. The stator is the stationary part of the motor -- this includes the motor
casing, as well as two or more permanent magnet pole pieces. The rotor (together with the axle and
attached commutator) rotates with respect to the stator. The rotor consists of windings (generally on a
core), the windings being electrically connected to the commutator. The above diagram shows a
common motor layout -- with the rotor inside the stator (field) magnets.
The geometry of the brushes, commutator contacts, and rotor windings are such that when power
is applied, the polarities of the energized winding and the stator magnet(s) are misaligned, and the rotor
will rotate until it is almost aligned with the stator's field magnets. As the rotor reaches alignment, the
brushes move to the next commutator contacts, and energize the next winding. Given our example two-
pole motor, the rotation reverses the direction of current through the rotor winding, leading to a "flip" of
the rotor's magnetic field, driving it to continue rotating.

In real life, though, DC motors will always have more than two poles (three is a very common
number). In particular, this avoids "dead spots" in the commutator. You can imagine how with our
example two-pole motor, if the rotor is exactly at the middle of its rotation (perfectly aligned with the field
magnets), it will get "stuck" there. Meanwhile, with a two-pole motor, there is a moment where the
commutator shorts out the power supply (i.e., both brushes touch both commutator contacts
simultaneously). This would be bad for the power supply, waste energy, and damage motor components
as well. Yet another disadvantage of such a simple motor is that it would exhibit a high amount of torque
"ripple" (the amount of torque it could produce is cyclic with the position of the rotor).
CHAPTER -7
ARDUINO UNO
7.0 Arduino Uno

The Arduino Uno is a microcontroller board based on the ATmega328 (datasheet). It has 14
digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz ceramic
resonator, a USB connection, a power jack, an ICSP header, and a reset button. It contains everything
needed to support the microcontroller; simply connect it to a computer with a USB cable or power it with
a AC-to-DC adapter or battery to get started. The Uno differs from all preceding boards in that it does
not use the FTDI USB-to-serial driver chip. Instead, it features the Atmega16U2 (Atmega8U2 up to
version R2) programmed as a USB-to-serial converter. Revision 2 of the Uno board has a resistor
pulling the 8U2 HWB line to ground, making it easier to put into DFU mode. Revision 3 of the board has
the following new features:

1.0 pinout: added SDA and SCL pins that are near to the AREF pin and two other new pins placed
near to the RESET pin, the IOREF that allow the shields to adapt to the voltage provided from the board.
In future, shields will be compatible both with the board that use the AVR, which operate with 5V and
with the Arduino Due that operate with 3.3V. The second one is a not connected pin, that is reserved for
future purposes.

Stronger RESET circuit. Atmega 16U2 replace the 8U2. "Uno" means one in Italian and is
named to mark the upcoming release of Arduino 1.0. The Uno and version 1.0 will be the reference
versions of Arduino, moving forward. The Uno is the latest in a series of USB Arduino boards, and the
reference model for the Arduino platform; for a comparison with previous versions, see the index of
Arduino boards. Summary Microcontroller ATmega328 Operating Voltage 5V Input Voltage
(recommended) 7-12V Input Voltage (limits) 6-20V Digital I/O Pins 14 (of which 6 provide PWM output)
Analog Input Pins 6 DC Current per I/O Pin 40 mA DC Current for 3.3V Pin 50 mA Flash Memory 32 KB
(ATmega328) of which 0.5 KB used by bootloader SRAM 2 KB (ATmega328) EEPROM 1 KB
(ATmega328) Clock Speed 16 MHz Schematic & Reference Design EAGLE files: arduino-uno-Rev3-
reference-design.zip (NOTE: works with Eagle 6.0 and newer) Schematic: arduino-uno-Rev3-
schematic.pdf
Note: The Arduino reference design can use an Atmega8, 168, or 328, Current models use an
ATmega328, but an Atmega8 is shown in the schematic for reference. The pin configuration is identical
on all three processors. Power The Arduino Uno can be powered via the USB connection or with an
external power supply. The power source is selected automatically. External (non-USB) power can come
either from an AC-to-DC adapter (wall-wart) or battery. The adapter can be connected by plugging a
2.1mm center-positive plug into the board's power jack. Leads from a battery can be inserted in the Gnd
and Vin pin headers of the POWER connector. The board can operate on an external supply of 6 to 20
volts. If supplied with less than 7V, however, the 5V pin may supply less than five volts and the board
may be unstable. If using more than 12V, the voltage regulator may overheat and damage the board.
The recommended range is 7 to 12 volts.

The power pins are as follows:

VIN. The input voltage to the Arduino board when it's using an external power source (as opposed to 5
volts from the USB connection or other regulated power source). You can supply voltage through this
pin, or, if supplying voltage via the power jack, access it through this pin. 5V.This pin outputs a regulated
5V from the regulator on the board. The board can be supplied with power either from the DC power
jack (7
- 12V), the USB connector (5V), or the VIN pin of the board (7-12V). Supplying voltage via the 5V or
3.3V pins bypasses the regulator, and can damage your board. We don't advise it. 3V3. A 3.3 volt
supply generated by the on-board regulator. Maximum current draw is 50 mA. GND. Ground pins.
Memory The ATmega328 has 32 KB (with 0.5 KB used for the bootloader). It also has 2 KB of SRAM
and 1 KB of EEPROM (which can be read and written with the EEPROM library).

Input and Output Each of the 14 digital pins on the Uno can be used as an input or output, using
pinMode(), digitalWrite(), and digitalRead() functions. They operate at 5 volts. Each pin can provide or
receive a maximum of 40 mA and has an internal pull-up resistor (disconnected by default) of 20-50
kOhms. In addition, some pins have specialized functions: Serial: 0 (RX) and 1 (TX). Used to receive
(RX) and transmit (TX) TTL serial data. These pins are connected to the corresponding pins of the
ATmega8U2 USB-to-TTL Serial chip. External Interrupts: 2 and 3. These pins can be configured to
trigger an interrupt on a low value, a rising or falling edge, or a change in value. See the attach
Interrupt() function for details. PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analog
Write() function. SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI
communication using the SPI library.
LED: 13. There is a built-in LED connected to digital pin 13. When the pin is HIGH value, the LED is
on, when the pin is LOW, it's off. The Uno has 6 analog inputs, labeled A0 through A5, each of which
provide 10 bits of resolution (i.e. 1024 different values). By default they measure from ground to 5 volts,
though is it possible to change the upper end of their range using the AREF pin and the
analogReference() function. Additionally, some pins have specialized functionality: TWI: A4 or SDA pin
and A5 or SCL pin. Support TWI communication using the Wire library. There are a couple of other pins
on the board: AREF. Reference voltage for the analog inputs. Used with analogReference().

Reset. Bring this line LOW to reset the microcontroller. Typically used to add a reset button to  shields
which block the one on the board. See also the mapping between Arduino pins and ATmega328 ports.
The mapping for the Atmega8, 168, and 328 is identical. Communication The Arduino Uno has a
number of facilities for communicating with a computer, another Arduino, or other microcontrollers. The
ATmega328 provides UART TTL (5V) serial communication, which is available on digital pins 0 (RX) and
1 (TX). An ATmega16U2 on the board channels this serial communication over USB and appears as a
virtual com port to software on the computer. The '16U2 firmware uses the standard USB COM drivers,
and no external driver is needed. However, on Windows, a .inf file is required.

The Arduino software includes a serial monitor which allows simple textual data to be sent to and
from the Arduino board. The RX and TX LEDs on the board will flash when data is being transmitted via
the USB-to-serial chip and USB connection to the computer (but not for serial communication on pins 0
and 1). A Software Serial library allows for serial communication on any of the Uno's digital pins. The
ATmega328 also supports I2C (TWI) and SPI communication. The Arduino software includes a Wire
library to simplify use of the I2C bus; see the documentation for details. For SPI communication, use the
SPI library. Programming The Arduino Uno can be programmed with the Arduino software (download).
Select "Arduino Uno from the Tools > Board menu (according to the microcontroller on your board). For
details, see the reference and tutorials. The ATmega328 on the Arduino Uno comes preburned with a
bootloader that allows you to upload new code to it without the use of an external hardware programmer.
It communicates using the original STK500 protocol (reference, C header files). You can also bypass the
bootloader and program the microcontroller through the ICSP (In-Circuit Serial Programming) header;
see these instructions for details.
The ATmega16U2 (or 8U2 in the rev1 and rev2 boards) firmware source code is available . The
ATmega16U2/8U2 is loaded with a DFU bootloader, which can be activated by: On Rev1 boards:
connecting the solder jumper on the back of the board (near the map of Italy) and then resetting the
8U2. On Rev2 or later boards: there is a resistor that pulling the 8U2/16U2 HWB line to ground, making
it easier to put into DFU mode. You can then use Atmel's FLIP software (Windows) or the DFU
programmer (Mac OS X and Linux) to load a new firmware. Or you can use the ISP header with an
external programmer (overwriting the DFU bootloader). See this user-contributed tutorial for more
information. Automatic (Software) Reset Rather than requiring a physical press of the reset button
before an upload, the Arduino Uno is designed in a way that allows it to be reset by software running on
a connected computer.

One of the hardware flow control lines (DTR) of the ATmega8U2/16U2 is connected to the reset line
of the ATmega328 via a 100 nano-farad capacitor. When this line is asserted (taken low), the reset line
drops long enough to reset the chip. The Arduino software uses this capability to allow you to upload
code by simply pressing the upload button in the Arduino environment. This means that the bootloader
can have a shorter timeout, as the lowering of DTR can be well-coordinated with the start of the upload.
This setup has other implications. When the Uno is connected to either a computer running Mac OS X or
Linux, it resets each time a connection is made to it from software (via USB). For the following
halfsecond or so, the bootloader is running on the Uno. While it is programmed to ignore malformed data
(i.e. anything besides an upload of new code), it will intercept the first few bytes of data sent to the board
after a connection is opened. If a sketch running on the board receives one-time configuration or other
data when it first starts, make sure that the software with which it communicates waits a second after
opening the connection and before sending this data.

The Uno contains a trace that can be cut to disable the auto-reset. The pads on either side of the
trace can be soldered together to re-enable it. It's labeled "RESET-EN". You may also be able to disable
the auto-reset by connecting a 110 ohm resistor from 5V to the reset line; see this forum thread for
details. USB Overcurrent Protection The Arduino Uno has a resettable polyfuse that protects your
computer's USB ports from shorts and overcurrent. Although most computers provide their own internal
protection, the fuse provides an extra layer of protection. If more than 500 mA is applied to the USB
port, the fuse will automatically break the connection until the short or overload is removed. Physical
Characteristics The maximum length and width of the Uno PCB are 2.7 and 2.1 inches respectively, with
the USB connector and power jack extending beyond the former dimension. Four screw holes allow the
board to
be attached to a surface or case. Note that the distance between digital pins 7 and 8 is 160 mil (0.16"),
not an even multiple of the 100 mil spacing of the other pins

7.1 Buzzer

A buzzer or beeper is an audio signaling device which may be Electromechanical or piezoelectric.


Typical uses of buzzers and beepers include alarm devices, timers, and confirmation of user input such
as a processing units.

FIG: 7.1:Electronic symbol of buzzer

7.2 Electromechanical

The electric buzzer was invented in 1831 by Joseph Henry. They were mainly used in early doorbells
until they were phased out in the early 1930s in favor of musical chimes, which had a softer tone.

7.3 Piezoelectric
Piezoelectric buzzers, or piezo buzzers, as they are sometimes called, were invented by Japanese
manufacturers and fitted into a wide array of products during the 1970s to 1980s. This advancement
mainly came about because of cooperative efforts by Japanese manufacturing companies. In 1951, they
established the Barium Titanate Application Research Committee, which allowed the companies to be
"competitively cooperative" and bring about several piezoelectric innovations and inventions.
Automatic Border Alert System for Fishermen using GPS and GSM Techniques

7.4 Relay

A relay is an electrically operated switch. Many relays use an electromagnet to mechanically operate
a switch, but other operating principles are also used, such as solid-state relays. Relays are used where
it is necessary to control a circuit by a separate low-power signal, or where several circuits must be
controlled by one signal. The first relays were used in long distance telegraph circuits as amplifiers: they
repeated the signal coming in from one circuit and re-transmitted it on another circuit. Relays were used
extensively in telephone exchanges and early computers to perform logical operations.

A type of relay that can handle the high power required to directly control an electric motor or other
loads is called a contactor. Solid-state relays control power circuits with no moving parts, instead using a
semiconductor device to perform switching. Relays with calibrated operating characteristics and
sometimes multiple operating coils are used to protect electrical circuits from overload or faults; in
modern electric power systems these functions are performed by digital instruments still called
"protective relays".

Magnetic latching relays require one pulse of coil power to move their contacts in one direction, and
another, redirected pulse to move them back. Repeated pulses from the same input have no effect.
Magnetic latching relays are useful in applications where interrupted power should not be able to
transition the contacts.

Magnetic latching relays can have either single or dual coils. On a single coil device, the relay will
operate in one direction when power is applied with one polarity, and will reset when the polarity is
reversed. On a dual coil device, when polarized voltage is applied to the reset coil the contacts will
transition. AC controlled magnetic latch relays have single coils that employ steering diodes to
differentiate between operate and reset commands.
A simple electromagnetic relay consists of a coil of wire wrapped around a soft iron core, an iron
yoke which provides a low reluctance path for magnetic flux, a movable iron armature, and one or more
sets of contacts. The armature is hinged to the yoke and mechanically linked to one or more sets of
moving contacts. The armature is held in place by a spring so that when the relay is de-energized there
is an air gap in the magnetic circuit. In this condition, one of the two sets of contacts in the relay pictured
is closed, and the other set is open. Other relays may have more or fewer sets of contacts depending on
their function. The relay in the following picture also has a wire connecting the armature to the yoke.

“Dept. of ECE, GCET”


Automatic Border Alert System for Fishermen using GPS and GSM Techniques
This

36

“Dept. of ECE, GCET”


ensures continuity of the circuit between the moving contacts on the armature, and the circuit track on
the printed circuit board (PCB) via the yoke, which is soldered to the PCB.

FIG:7.4:PCB
When an electric current is passed through the coil it generates a magnetic field that activates the
armature and the consequent movement of the movable contact(s) either makes or breaks (depending
upon construction) a connection with a fixed contact. If the set of contacts was closed when the relay
was de-energized, then the movement opens the contacts and breaks the connection, and vice versa if
the contacts were open. When the current to the coil is switched off, the armature is returned by a force,
approximately half as strong as the magnetic force, to its relaxed position. Usually this force is provided
by a spring, but gravity is also used commonly in industrial motor starters. Most relays are manufactured
to operate quickly. In a low-voltage application this reduces noise; in a high voltage or current application
it reduces arcing.

37
Automatic Border Alert System for Fishermen using GPS and GSM Techniques

CHAPTER -8
PROGRAMS
#include <Adafruit_GPS.h>

// what's the name of the hardware serial port?


#define GPSSerial Serial1
// Connect to the GPS on the hardware port
Adafruit_GPS GPS(&GPSSerial);

// Set GPSECHO to 'false' to turn off echoing the GPS data to the Serial console
// Set to 'true' if you want to debug and listen to the raw GPS sentences
#define GPSECHO false
uint32_t timer = millis();
void setup()
{
//while (!Serial); // uncomment to have the sketch wait until Serial is ready

// connect at 115200 so we can read the GPS fast enough and echo without dropping chars
// also spit it out
Serial.begin(115200);
Serial.println("Adafruit GPS library basic test!");
// 9600 NMEA is the default baud rate for Adafruit MTK GPS's- some use 4800
GPS.begin(9600);
// uncomment this line to turn on RMC (recommended minimum) and GGA (fix data) including altitude
GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA);
// uncomment this line to turn on only the "minimum recommended" data
//GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCONLY);
// For parsing data, we don't suggest using anything but either RMC only or RMC+GGA since
// the parser doesn't care about other sentences at this time
// Set the update rate
GPS.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ); // 1 Hz update rate
// For the parsing code to work nicely and have time to sort thru the data, and

38
“Dept. of ECE, GCET”
Automatic Border Alert System for Fishermen using GPS and GSM Techniques
// print it out we don't suggest using anything higher than 1 Hz

39
“Dept. of ECE, GCET”
// Request updates on antenna status, comment out to keep quiet
GPS.sendCommand(PGCMD_ANTENNA);

delay(1000);

// Ask for firmware version


GPSSerial.println(PMTK_Q_RELEASE);
}
void loop() // run over and over again
{
// read data from the GPS in the 'main loop'
char c = GPS.read();
// if you want to debug, this is a good time to do it!
if (GPSECHO)
if (c) Serial.print(c);
// if a sentence is received, we can check the checksum, parse it...
if (GPS.newNMEAreceived()) {
// a tricky thing here is if we print the NMEA sentence, or data
// we end up not listening and catching other sentences!
// so be very wary if using OUTPUT_ALLDATA and trying to print out data
Serial.println(GPS.lastNMEA()); // this also sets the newNMEAreceived() flag to false
if (!GPS.parse(GPS.lastNMEA())) // this also sets the newNMEAreceived() flag to false
return; // we can fail to parse a sentence in which case we should just wait for another
}
// if millis() or timer wraps around, we'll just reset it
if (timer > millis()) timer = millis();

// approximately every 2 seconds or so, print out the current stats


if (millis() - timer > 2000) {
timer = millis(); // reset the timer
Serial.print("\nTime: ");
if (GPS.hour < 10) { Serial.print('0'); }
Serial.print(GPS.hour, DEC); Serial.print(':');
if (GPS.minute < 10) { Serial.print('0'); }
Serial.print(GPS.minute, DEC); Serial.print(':');
if (GPS.seconds < 10) { Serial.print('0'); }
Serial.print(GPS.seconds, DEC);
Serial.print('.'); if (GPS.milliseconds < 10) {
Serial.print("00");
} else if (GPS.milliseconds > 9 && GPS.milliseconds < 100) {
Serial.print("0");
}
Serial.println(GPS.milliseconds);
Serial.print("Date: ");
Serial.print(GPS.day, DEC); Serial.print('/');
Serial.print(GPS.month, DEC); Serial.print("/20");
Serial.println(GPS.year, DEC);
Serial.print("Fix: "); Serial.print((int)GPS.fix);
Serial.print(" quality: ");
Serial.println((int)GPS.fixquality); if (GPS.fix) {
Serial.print("Location: ");
Serial.print(GPS.latitude, 4);
Serial.print(GPS.lat); Serial.print(", ");
Serial.print(GPS.longitude, 4); Serial.println(GPS.lon);
Serial.print("Speed (knots): "); Serial.println(GPS.speed);
Serial.print("Angle: "); Serial.println(GPS.angle);
Serial.print("Altitude: "); Serial.println(GPS.altitude);
Serial.print("Satellites: "); Serial.println((int)GPS.satellites);
}
}
}
8.1 LIQUID CRYSTAL:

#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3,
2); #include <Adafruit_GPS.h>
#define GPSSerial Serial
#define GPSECHO false
uint32_t timer = millis();
Adafruit_GPS GPS(&GPSSerial);
const int INP=6;
int flag=0;
int flag1=0;
void setup()
{
Serial.begin(9600);
Serial.println("WELCOME");
lcd.begin(16, 2);
lcd.setCursor(0,0);
lcd.print(" WELCOME ");
lcd.setCursor(0,1);
lcd.print(" ");
Serial.begin(9600);
GPS.begin(9600);
GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA);
GPS.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ); // 1 Hz update rate
GPS.sendCommand(PGCMD_ANTENNA);
delay(1000);
GPSSerial.println(PMTK_Q_RELEASE);
pinMode(INP,INPUT);
delay(500);
lcd.setCursor(0,0);
lcd.print(" ");
lcd.setCursor(0,1);
lcd.print(" ");
}
void loop()
{
gps();
if(digitalRead(INP)== LOW)
{
flag=1;
}
else
{
flag=0;
flag1=0;
}
}
void gps()
{
GPS.begin(9600);
GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA);
GPS.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ); // 1 Hz update rate
GPS.sendCommand(PGCMD_ANTENNA);
delay(1000);
GPSSerial.println(PMTK_Q_RELEASE);
again:

char c = GPS.read();
if (GPSECHO)
if (c) Serial.print(c);
if (GPS.newNMEAreceived()) {
// Serial.println(GPS.lastNMEA()); // this also sets the newNMEAreceived() flag to false
if (!GPS.parse(GPS.lastNMEA())) // this also sets the newNMEAreceived() flag to false
goto again; // we can fail to parse a sentence in which case we should just wait for
another
}
else
{
goto again;
}
if (timer > millis()) timer = millis();
if (millis() - timer > 2000) {
timer = millis(); // reset the timer

if (GPS.fix)
{ Serial.print("Location:
");
Serial.print(GPS.latitude, 4); Serial.print(GPS.lat);
Serial.print(", ");
Serial.print(GPS.longitude, 4); Serial.println(GPS.lon);
// lcd.clear();
lcd.setCursor(0,0);
// lcd.print("lt:");
lcd.print(GPS.latitude, 4); lcd.print(GPS.lat);
lcd.setCursor(0,1);
// lcd.print("lg:");
lcd.print(GPS.longitude, 4); lcd.print(GPS.lon);
delay(500);
if(flag==1)
{
if(flag1==0)
{
lcd.setCursor(13,0);
lcd.print("SMS");
Serial.begin(9600);
Serial.print("AT+CMGF=1\n\r");
delay(1000);
Serial.print("AT+CMGS="); // send the SMS number
Serial.print('"');
Serial.print("+918179793574");
Serial.println('"');
delay(1000);
Serial.print("ALERT PLS,BOUNDARY ALERT AT
LOCATION: https://www.google.co.in/maps/place/");
Serial.print(GPS.latitudeDegrees,5);
Serial.print(",");
Serial.print(GPS.longitudeDegrees,5);

delay(500);
Serial.write(0x1A);
Serial.write(0x0D);
Serial.write(0x0A);
flag1=1;
lcd.setCursor(13,0);
lcd.print(" ");
}
}
}
else
{
Serial.print("gps not initilized ");
goto again;
}
}
}
8.2 RECIEVER :

MOTOR BIT P1.3

BUZZ BIT P1.2

STRT BIT P3.3

OUT BIT P3.2

org 00h

LJMP RT

RT:

MOV P1,#00H

mov SCON,#50h

mov TMOD,#20h

mov TH1,#0E8H

setb TR1

AGN:

JB STRT,$

SETB MOTOR

CLR BUZZ

SETB OUT

main:

JNB RI,MAIN

CLR RI
MOV A,SBUF

CJNE A,#035H,MAIN

JNB RI,$

CLR RI

MOV A,SBUF

CJNE A,#085H,MAIN

CLR MOTOR

SETB BUZZ

CLR OUT

LCALL DDELAY

LJMP AGN

ddelay:

mov r2,#90D

laa1z: mov r3,#90D

laa0z: mov r5,#90D

djnz r5,$

djnz r3,laa0z

djnz r2,laa1z

ret
END

8.3 TRANSMITTER:

org 0000h

LJMP RT

RT:

MOV SCON,#40H

MOV TMOD,#20H

MOV TH1,#0E8H

CLR TI

SETB TR1

MAIN:

MOV A,#035H

MOV SBUF,A

JNB TI,$

CLR TI

LCALL DDELAY

MOV A,#085H

MOV SBUF,A

JNB TI,$

CLR TI

LCALL DDELAY

LJMP MAIN
ddelay:

mov r2,#12D

laa1z: mov r3,#12D

laa0z: mov r5,#12D

djnz r5,$

djnz r3,laa0z

djnz r2,laa1z

ret

end
Chapter- 9

Conclusion

In the recent times the capture of Indian fishermen across Sri Lanka border has been
increased. It is difficult for the fishermen to discover the borders and lost into other country’
borders. Our objective is to give wireless support to those fishermen and aside from to go out
after them if they are found missing. This project is a low cost efficient method of wireless
tracking. It also gives sufficient information to both ship and coastal guardians of anyone crossing
the border.

Table no:9.1 Fisherman death rate

Thus the fishermen can easily identify the national sea borders and therefore prevents them from
entering their area. Thus saving their lives and providing good relationship with the neighbouring
countries. Also, the piracy of ship can be easily brought under control.
Chapter-10
References
[1] GPS-based vessel position monitoring and display system. IEEE Aerospace and Electronic
Systems Magazine. 1990.
[2] www.falcomusa.com.
[3] A Michalski, J Czajewski. The accuracy of the global positioning systems. IEEE Instrumentation
& Measurement Magazine. 2004; 7(1): 56-60.
[4] http://earth.google.com/
Jim Isaac , the paper titled as “Advanced border alert system using GPS and with intelligent Engine
control unit “International Journal of Electrical and Computing

[5] Engineering (IJECE) Vol. 1, Issue. 4, June 2015.


[6] S.Kiruthika, N.Rajasekaran the paper titled as” A Wireless mode of protected defense
mechanism to mariners using GSM technology ”International Journal of Emerging Technology and
Innovative Engineering Volume I, Issue 5, May 2015 (ISSN: 2394 – 6598).
[7] G.Sivagnanam , A.J.Midhun, N.Krishna, G.Maria Samuel Reuben A.Anguraj5 “Coast guard alert and
rescue system for international maritime line crossing of fisherman” “ at International Journal of
Innovative Research in Advanced Engineering
[8] Naveen Kumar.M Ranjith.R The paper titled as” Border alert and smart tracking system with alarm
[9] Charles Finny Joseph , R Dinesh Kumar , Alert System for Fishermen Crossing Border using Android
, International Conference on Electrical, Electronics, and Optimization Techniques(ICEEOT) – 2016.
[10] Brones T.Costa,P.D.Etter R,”A rule based approach towards context- aware user notification
services,” IEEE International conference on Pervasive service,pp.281284,2006. 10. Michalski,
J.Czajewski,The accuracy of the global positioning systems, IEEE Instrumentation & Measurement
Magazine,vol.7(1), pp.56–60,2004

You might also like