Você está na página 1de 27

TABLE OF CONTENTS

Chapter 1: Preamble
1.1 1.2 1.3 1.4 Introduction Problem statement Project overview Scope of the project

Chapter 2: Theoretical Background


2.1 Microcontroller Atmega16 2.1.1 Introduction 2.1.2 Features of atmega16 2.1.3 Pin diagram and description

Chapter3: Block diagram and its description


3.1 Block diagram of module 3.2 Components of module 3.2.1 Power supply 3.2.2 LCD Display 3.2.3 Transceiver 3.2.4 Microcontroller 3.2.5 GPS

Chapter 4: Software usage


4.1 AVR studio 4.2 Program

List of figures
1 2 3 4 5 6 2.1 3.1 3.2 Pin diagram of microcontroller Block diagram of module 9v 6f22 battery

3.3 7605 voltage regulator 3.4 3.5 LCD Display GPS Module

. ABSTRACT
Social Security System is used to provide the precise location of a happening crime which occurs outdoors against common citizens specially women using a GPS to tell the location of the crime in real time. Violence against women is a technical term used to collectively refer to violent acts that are primarily or exclusively committed against women. This type of violence targets a specific group with the victim's gender as a primary motive. The goal of the project is to provide the security personals the exact location of the crime in real time so that they are able to intervene and stop it from happening. It consists of a microcontroller, GPS, LCD, transmitter and receiver. The module and implementation of the social security system has been theoretical tested and it can be implemented practically to stop the crimes

ACKNOWLEDGEMENT
We the batch mates of the project social security system, consider it as a great privilege to express our gratitude and respect to all those who guided and inspired us in completion of our project. No project is complete without the people, who have rendered advice and helped in making the project successful. It is difficult for us to express our sense of gratitude and appreciation for the help we have received in endeavor. Our effort here is feeble attempt to do so. First of all, we acknowledge for the provision of the required infrastructure by our esteemed institute Jawaharlal Nehru National College of Engineering, Shivamogga and Department of Telecommunication Engineering. We would like to thank our HOD and Associate Prof. S. Amarappa, who stood as our guiding spirit and lending us guidance to achieve our aim with added zeal. We thank our guide Ashwini S.R, Assistant professor, for her valuable suggestions and treasured assistance throughout the course of our project. Her advice and co-operation have been the factors that have contributed to achieve our goals. Our special thanks to our principal Dr. R. Srinivasa Rao Kunte for providing all facilities needed for our project. Lastly, we are thankful to our classmates and everyone who have helped us directly or indirectly for the successful completion of the project. Project Associates: Laki Kumar Sinha (4JN09TE024) Prakash Sharma (4JN09TE037) Sankalp Kumar (4JN09TE045) Saurabh Chandra (4JN08TE044)

Chapter1 PREAMBLE 1.1 Introduction


The objective of this project is to provide safety to citizens especially females against crime like sexual harassment by providing real time information. This information will be provided by using a QUECTEL L50 GPS module which will be interfaced with a microcontroller. The moment the person in need of help senses some suspicious activity or if the crime started happening then the person can switch the module ON. The moment the person do so, the GPS will pass the location to the microcontroller (here we are using ATMEGA 16) which is interfaced systematically to a transmitter. The transmitter sends the coordinates to the nearest police control room or some security agencies, from where help arrives in real time and the crime is stopped. Sometimes when the victim is in motion then also the device will be very helpful in tracking the victim once the distress signal has been sent. This device with slight modifications can also be used for various other applications like tracking of kids, animals, finding out terrains.

1.2

Problem Statement
Incapability to reduce the increasing crime rate despite of having desire to do so, and hence despite having resources, our inability to provide security and safety to common man specially females in our society.

1.3

Project Overview

Sender side:
5

It has a switch which once pressed enables the whole system. All the components used are interfaced systematically, and the flow of signal is from transmitting to receiving side. It is a microcontroller based security device which uses Global Positioning System (GPS) and radio transceivers. We had used AVR studio for programing. A battery powered GPS will acquire the location of the person and a transceiver will send the location to the security personals. The GPS module and the transceiver will be interfaced to an ATmega16 microcontroller. Receiver Side: A radio antenna at the receiver side will receive the signals and by using a microcontroller interfaced to a 16x2 LCD will display the location of the sender. Signals can be sent in reverse direction too, in case we want to send acknowledgment that the help is coming or the time in which help will be available.

1.4

Scope of the Project


This system can also be used where the information is not needed so frequently and the subject has to be tracked at irregular time periods, such as monitoring of adolescents by parents, in research to track animals in the jungle, coordinating search and rescue efforts, and mapping trails and exploring new terrains. This way it will be used for various applications with some or no modifications in the original module. It has many other future applications which can be achieved or implemented by enhancing the

module. Can be used with security agencies in spying, can be used in army to monitor their vehicles and personnel. Apart from other applications, various features can be added to this module for providing more services. Services like telling what is the time the security personnel will take to reach the location of the victim, for telling what kind of crime is happening and what its severity is. For asking for help for incidents which is not crime but in which urgency is required like fire or some accident. Can also be used for identifying the person from whose device the distress message had been sent.

Chapter 2

THEORETICAL BACKGROUND
2.1 MICROCONTROLLER ATMEGA 16

2.1.1 Introduction:-

The main part of the project is microcontroller. Here we are using ATMEGA 16 microcontroller. Microprocessors and microcontroller are widely used in embedded systems products. Microcontroller is a programmable device. A microcontroller has a CPU in addition to a fixed amount of RAM, ROM, I/O ports and a timer embedded all on a single chip. The fixed amount of on-chip ROM, RAM and number of I/O ports in microcontroller makes them ideal for many applications in which cost and space are critical. ATmega16 is an 8-bit high performance microcontroller of Atmels Mega AVR family with low power consumption. Atmega16 is based on enhanced RISC (Reduced Instruction Set Computing) architecture with 131 powerful instructions. Most of the instructions execute in one machine cycle. Atmega16 can work on a maximum frequency of 16MHz. ATmega16 has 16 KB programmable flash memory, static RAM of 1 KB and EEPROM of 512 Bytes. The endurance cycle of flash memory and EEPROM is 10,000 and 100,000, respectively.

ATmega16 is a 40 pin microcontroller. There are 32 I/O (input/output) lines which are divided into four 8-bit ports designated as PORTA, PORTB, PORTC and PORTD.
8

2.1.2 FEATURES OF ATMEGA 16

8-Bit microcontroller 1K Byte of internal SRAM 512 Bytes EEPROM 16K Bytes of In-system self programmable flash memory Boundary-scan capabilities a/c to JTAG standard 32 programmable I/O lines Uses low power High performance Advanced RISC architecture It can process up to 16 MIPS throughput at 16 MHz Speed grad:0-8MHz

2.1.3PIN Diagram of ATMEGA 16

10

Pin Descriptions:
VCC: Digital supply voltage.

GND:
Ground.

Port B (PB7...PB0):
Port B is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The Port B output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port B pins that are externally pulled low will source current if the pull-up resistors are activated. The Port B pins are tri-stated when a reset condition becomes active, even if the clock is not running.

Port C (PC7...PC0):
Port C is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The Port C output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port C pins that are externally pulled low will source current if the pull-up resistors are activated. The Port C pins are tri-stated when a reset condition becomes active, even if the clock is not running.

Port D (PD7PD0):
Port D is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The Port D output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port D pins that are externally pulled low will source current if the pull-up resistors are activated. The Port D pins are tri-stated when a reset condition becomes active, even if the clock is not running.
11

Port E (PE2...0) RESET/ XTAL1/XTAL2:


Port E is a 3-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The Port E output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port E pins that are externally pulled low will source current if the pull-up resistors are activated. The Port E pins are tri-stated when a reset condition becomes active, even if the clock is not running. If the RSTDISBL Fuse is programmed, PE0 is used as an I/O pin. Note that the electrical characteristicsof PE0 differ from those of the other pins of Port E. If the RSTDISBL Fuse is unprogrammed, PE0 is used as a Reset input. A low level on this pin for longer than the minimum pulse length will generate a Reset, even if the clock is not running. Shorter pulses are not guaranteed to generate a Reset. Depending on the clock selection fuse settings, PE1 can be used as input to the inverting Oscillator Amplifier and input to the internal clock operating circuit. Depending on the clock selection fuse settings, PE2 can be used as output from the inverting Oscillator amplifier Port C also serves the functions of special features of the ATmega16.

AVCC:
AVCC is the supply voltage pin for the A/D Converter, D/A Converter, Current source. It should be externally connected to VCC, even if the ADC, DAC are not used. If the ADC is used, it should be connected to VCC through a low-pass filter.

AREF:
This is the analog reference pin for the A/D Converter.

12

3.2 Components of module


3.2.1 POWER SUPPLY:
For the functioning of all our electronic circuits we require dc power supply. The power supply that comes to our homes is an AC power supply, and we need an AC to DC converter to get a DC supply. Here we will be using a battery to supply the required power. The power requirement for this module is of 5v. As a battery of this output is not available so, we are using a 6F22, 9v battery.

Fig 3.3:6f22 9v Battery

Voltage regulator:
7805 is a voltage regulator integrated circuit. It is a member of 78xx series of fixed linear voltage regulator ICs. The voltage source in a circuit may have fluctuations
13

and would not give the fixed voltage output. The voltage regulator IC maintains the output voltage at a constant value. The xx in 78xx indicates the fixed output voltage it is designed to provide. 7805 provides +5V regulated power supply. Capacitors of suitable values can be connected at input and output pins depending upon the respective voltage levels.

Pin No 1 2 3

Function Input voltage (5V-18V) Ground (0V) Regulated output; 5V (4.8V-5.2V)

Name Input Ground Output

14

3.2.2 LCD Display:


LCD (Liquid Crystal Display) screen is an electronic display module and find a wide range of applications. A 16x2 LCD display is very basic module and is very commonly used in various devices and circuits. These modules are preferred over seven segments and other multi segment LEDs. The reasons being: LCDs are economical; easily programmable; have no limitation of displaying special & even custom characters (unlike in seven segments), animations and so on. A 16x2 LCD means it can display 16 characters per line and there are 2 such lines. In this LCD each character is displayed in 5x7 pixel matrix. This LCD has two registers, namely, Command and Data. The command register stores the command instructions given to the LCD. A command is an instruction given to LCD to do a predefined task like initializing it, clearing its screen, setting the cursor position, controlling display etc. The data register stores the data to be displayed on the LCD. The data is the ASCII value of the character to be displayed on the LCD.

15

3.2.3 GPS:

GPS modem is a device which receives signals from satellite and provides information about latitude, longitude, altitude, time etc. The GPS navigator is more famous in mobiles to track the road maps. The GPS modem has an antenna which receives the satellite signals and transfers them to the modem. The modem in turn converts the data into useful information and sends the output in serial RS232 logic level format. The information about latitude, longitude etc is sent continuously and accompanied by an identifier string.

3.2.4 Transceiver:
The RF module, as the name suggests, operates at Radio Frequency. The corresponding frequency range varies between 30 kHz & 300 GHz. In this RF system, the digital data is represented as variations in the amplitude of carrier wave. This kind of modulation is known as Amplitude Shift Keying (ASK).

Transmission through RF is better than IR (infrared) because of many reasons. Firstly, signals through RF can travel through larger distances making it suitable for long range applications. Also, while IR mostly operates in line-of-sight mode, RF signals can travel even when there is an obstruction between transmitter & receiver. Next, RF transmission is more strong and reliable than IR transmission. RF
16

communication uses a specific frequency unlike IR signals which are affected by other IR emitting sources.

This RF module comprises of an RF Transmitter and an RF Receiver. The transmitter/receiver (Tx/Rx) pair operates at a frequency of 434 MHz an RF transmitter receives serial data and transmits it wirelessly through RF through its antenna connected at pin4. The transmission occurs at the rate of 1Kbps 10Kbps.The transmitted data is received by an RF receiver operating at the same frequency as that of the transmitter.

17

Chapter 4
Software usage
5.1 AVR Studio
AVR studio is an Integrated Development Environment (IDE) by ATMEL for developing applications based on 8-bit AVR microcontroller. Prior to installation of AVR Studio you have to install the compiler WinAVR.

5.2 Program
.include "m16def.inc" .def bytlw=r2 .def bythg=r3 .def odchk=r4 .def evchk=r5 .def sftcnt=r6 .def vlpos=r7 .def opval=r8 .def opdvc=r9 .def opspd=r10 .def status=r11 .def count=r12 .def endval=r13 .def togval=r14 .def temp=r16 .def temp1=r17 .def temp2=r18 .def temp3=r19 .def temp4=r20 .def temp5=r21 .def temp6=r22 .def temp7=r23 .def temp8=r24 .def dcnt1=r25
18

.equ lcddprt=porta .equ lcdcprt=portc .equ lcd_rs=0 .equ lcd_en=2 .equ gpsloc=$70 .equ latloc=$100 .equ lagloc=$200 .equ cnt=$10 .equ brp=143 .equ latpos=$85 .equ longpos=$c5 .org $00 rjmp RESET

.org $30 RESET: ldi temp,low(RAMEND) out SPL,temp ldi temp,high(RAMEND) out SPH,temp ldi temp,$ff out ddra,temp ldi temp,$ff out ddrb,temp ldi temp,$ff out ddrc,temp ldi temp,$fe out ddrd,temp ldi temp,$00 out porta,temp ldi temp,$00 out portc,temp ldi temp,$00 out portd,temp ldi temp,$00 out portb,temp rcall urtini
19

here:

rcall dly6ms rcall dly6ms rcall dly6ms rcall lcdinit rcall init ;rcall gpsrx ;rcall gpsdis rcall sertst ldi temp,$14 rcall delay rjmp here ;System initial

init: ldi zl,low(2*ttl1) display ldi zh,high(2*ttl1) rcall lcdl1 rcall sndmsg ldi zl,low(2*ttl2) ldi zh,high(2*ttl2) rcall lcdl2 rcall sndmsg clr status ldi temp,$0a mov endval,temp ldi temp,$01 mov togval,temp ldi temp,$14 rcall delay ldi zl,low(2*gps1) ldi zh,high(2*gps1) rcall lcdl1 rcall sndmsg ldi zl,low(2*gps2) ldi zh,high(2*gps2) rcall lcdl2 rcall sndmsg ret sertst: rcall lcdl1 ldi temp4,$10

20

st01:

st02:

rcall srrcv rcall datdisp dec temp4 brne st01 rcall lcdl2 ldi temp4,$10 rcall srrcv rcall datdisp dec temp4 brne st02 ldi temp,$28 rcall delay ret ldi xh,high(latloc) ldi xl,low(latloc) ldi yh,high(lagloc) ldi yl,low(lagloc) clr count rcall srrcv cpi temp,'$' brne gr01 rcall srrcv cpi temp,'G' brne gr02 rcall srrcv cpi temp,'P' brne gr03 rcall srrcv cpi temp,'R' brne gr04 rcall srrcv cpi temp,'M' brne gr05 rcall srrcv cpi temp,'C' brne gr06 ldi temp1,14 rcall srrcv dec temp1
21

gpsrx:

gr00: gr01: gr02: gr03: gr04: gr05: gr06:

gr07:

gr08:

gr09:

grout:

brne gr07 ldi temp1,11 mov count,temp1 rcall srrcv st x+,temp dec count brne gr08 rcall srrcv rcall srrcv ldi temp1,12 mov count,temp1 rcall srrcv st y+,temp dec count brne gr09 ret

gpsdis: ldi xh,high(latloc) ldi xl,low(latloc) ldi dcnt1,11 ldi temp,latpos rcall command gd01: ld temp,x+ rcall datdisp dec dcnt1 brne gd01 ldi yh,high(lagloc) ldi yl,low(lagloc) ldi dcnt1,12 ldi temp,longpos rcall command gd02: ld temp,y+ rcall datdisp dec dcnt1 brne gd02 ret split: mov temp1,temp andi temp,$0f
22

mov bytlw,temp mov temp,temp1 andi temp,$f0 swap temp mov bythg,temp ret unsplit:mov temp,bythg swap temp add temp,bytlw ret srsnd: nop sd1: sbis ucsra,udre rjmp sd1 out udr,temp ret srrcv: nop sr1: sbis ucsra,RXC rjmp sr1 in temp,udr ret urtini: ldi out ldi out ldi out ldi out ret lcdl1: line 1 temp,high(brp) ubrrh,temp temp,low(brp) ubrrl,temp temp,(1<<RXEN)|(1<<TXEN) ucsrb,temp temp,(1<<URSEL)|(1<<UCSZ1)|(1<<UCSZ0) ucsrc,temp ;Forcing LCD cursor to

ldi temp,$01 rcall command ldi temp,$80 rcall command ret

23

lcdln1: ldi temp,$80 rcall command ret lcdl2: line 1 ldi temp,$c0 rcall command ret lcdinit:ldi temp,$38 rcall command matrix display ldi temp,$0e rcall command ldi temp,$06 printing rcall command ldi temp,$01 rcall command rcall dly6ms ret command:out lcddprt,temp cbi lcdcprt,lcd_rs to LCD sbi lcdcprt,lcd_en cbi lcdcprt,lcd_en rcall dly6ms ret datdisp:out lcddprt,temp sbi lcdcprt,lcd_rs in LCD sbi lcdcprt,lcd_en cbi lcdcprt,lcd_en rcall dly6ms ret ;LCD initialization ;2 line display, 5*7 ; Cursor ON and blinking ;Shift to right after ;Clear display ;Forcing LCD cursor to

;Writing command word

;Writing a character

24

sndmsg: ldi temp8,$10 message to LCD sm01: lpm temp,z+ rcall datdisp dec temp8 brne sm01 ret send: LCD ldi zl,low(2*data) ldi zh,high(2*data) add zl,temp brcc sn01 inc zh lpm temp,z rcall datdisp ret

;Sending a full

;Sending a number to

sn01:

sndbyt: ldi zl,low(2*data) data to LCD ldi zh,high(2*data) rcall split mov temp,bythg add zl,temp brcc ckd01 inc zh ckd01: lpm temp,z rcall datdisp ldi zl,low(2*data) ldi zh,high(2*data) mov temp,bytlw add zl,temp brcc ckd02 inc zh ckd02: lpm temp,z rcall datdisp ret dly20ms:ldi temp1,$4e

;Sending one byte of

;delay for 20ms


25

ldi temp3,$20 rcall dly ret dly6ms: ldi temp1,$8e ldi temp3,$e0 rcall dly ret delay: rcall dly50ms dec temp brne delay ret ;$2e ;$e0

;Custom delay

dly50ms:ldi temp4,$04 d5: ldi temp1,$b4 ldi temp3,$d8 rcall dly dec temp4 brne d5 ret dly: lp2: lp1: nop mov temp2,temp3 dec temp2 brne lp1 dec temp1 brne lp2 ret

dlylcd: ldi temp2,$de dl1: dec temp2 brne dl1 ret data: ttl1: ttl2: gps1: gps2: .db .db .db .db .db "0123456789ABCDEF" " GPS test board " "Ready to operate" "Lati" "Long"
26

27

Você também pode gostar