92195208 Report on Car Security System by Gsm

download 92195208 Report on Car Security System by Gsm

of 26

Transcript of 92195208 Report on Car Security System by Gsm

  • 7/27/2019 92195208 Report on Car Security System by Gsm

    1/26

    Lingayas Institute of Management And Technology

    A PROJECT REPORT

    ON

    CAR SECURITY SYSTEM BY GSM

    SUBMITTED TO:

    MR.ARVIND PATHAK SUBMITTED

    BY:

    (PROJECT GUIDE) SANDEEPGOYAL 8EC096

    MR.NITIN SALUJA SONU 8EC110

  • 7/27/2019 92195208 Report on Car Security System by Gsm

    2/26

    (PROJECT COORDINATOR) SUHAIL MEHTA

    8EC113

    SHWETANK

    PANWAR 8EC108

    CONTENTS:-

    INTRODUCTIONBLOCK DIAGRAM

    BASIC COMPONENTS

    GSM MODEM

    MICROCONTROLLER

    CIRCUIT DIAGRAM

    LCD

    ALGORITHM

  • 7/27/2019 92195208 Report on Car Security System by Gsm

    3/26

    INTRODUCTION

    In this project we show that, if any body tries to start the car

    without entering a password then car is to be start but at the

    same time alarm is on. If the person enter right password then

    alarm is off. But in the case of theft, it is not possible for thief to

    enter a proper password and in this case controller connected to

    the system is automatic on. Once the controller is on then

    controller immediately send a SMS through GSM modem to

    concerned person automatically.

    It is also possible to SWITCH off the car by sending a reverse SMS.

    to car.

    In this project we use one GSM modem to control the incoming

    and outgoing SMS. We use Siemens 300 based GSM modem andmax232 to INTERFACE modem to microcontroller in this project.

    Modem connected to the controller via serial connector RS232 in

    DB9 mode. We use 89s52 controller with a UART feature inside.

  • 7/27/2019 92195208 Report on Car Security System by Gsm

    4/26

    Password section of 12 switches is connected to the controller.

    Car key is also connected to the controller. DC motor for

    representing car is connected to the controller. When car key is

    pressed an input pulse is given to the controller then controller

    immediately starts the motor and waits for a password input. If

    the password signal is not coming for next 30 second then alarm

    is on and system sends a command to the gsm modem.

    GSM modem operation system based on AT command. With the

    help of AT command it is possible for us to connect a gsm modem

    directly to the controller.

    BLOCK DIAGRAM:-

  • 7/27/2019 92195208 Report on Car Security System by Gsm

    5/26

    GSM MODEM:-

    Used to Send SMS using AT commands

    Some advanced GSM modems like WaveCom and Multitech,

    support the SMS text mode. This mode allows you to send SMS

  • 7/27/2019 92195208 Report on Car Security System by Gsm

    6/26

    messages using AT commands, without the need to encode

    the binary PDU field of the SMS first. This is done by the GSM

    modem.

    AT-Command set

    The following section describes the AT-Command set. The

    commands can be tried out by connecting a GSM modem to one

    of the PCs COM ports. Type in the test-command, adding CR + LF

    (Carriage return + Line feed = \r\n) before executing. Table gives

    an overview of the implemented AT-Commands in this

    application. The use of the commands is described in the later

    sections.

    AT-Command set overview

    Command Description

    AT Check if serial interface and

    http://www.google.co.in/imgres?imgurl=http://technogenious.com/mart/images/gsm%20modem%20pic.JPG&imgrefurl=http://technogenious.com/mart/product_info.php/products_id/36&h=675&w=900&sz=158&tbnid=rjpRKKU3PQVmIM:&tbnh=98&tbnw=130&prev=/search?q=sim300+gsm+module+pic&tbm=isch&tbo=u&zoom=1&q=sim300+gsm+module+pic&docid=KTUbMlHmbG4OjM&hl=en&sa=X&ei=FUp7T-i7EsfKrAe97-ysAg&ved=0CDEQ9QEwAQ&dur=1406
  • 7/27/2019 92195208 Report on Car Security System by Gsm

    7/26

    GSM modem is working.

    ATE0

    Turn echo off, less traffic on

    serial line.

    AT+CNMI Display of new incoming SMS.

    AT+CPMS Selection of SMS memory.

    AT+CMGF

    SMS string format, how they

    are compressed.

    AT+CMGR

    Read new message from a

    given memory location.

    AT+CMGS

    Send message to a given

    recipient.

    AT+CMGD Delete message.

    MICROCONTROLLER

    When we have to learn about a new computer we have to

    familiarize about the machine capability we are using, and we can

    do it by studying the internal hardware design (devices

    architecture), and also to know about the size, number and the

    size of the registers.

  • 7/27/2019 92195208 Report on Car Security System by Gsm

    8/26

    A microcontroller is a single chip that contains the processor

    (the CPU), non-volatile memory for the program (ROM or

    flash), volatile memory for input and output (RAM), a clock

    and an I/O control unit. Also called a "computer on a chip,"

    billions of microcontroller units (MCUs) are embedded each yearin a myriad of products from toys to appliances to automobiles.

    For example, a single vehicle can use 70 or more

    microcontrollers. The following picture describes a general block

    diagram of microcontroller.

    ATMEL 89S52

    The AT89S52 is a low-power, high-performance CMOS 8-bit

    microcontroller with 8K bytes of in-system programmable Flash

  • 7/27/2019 92195208 Report on Car Security System by Gsm

    9/26

    memory. The device is manufactured using Atmels high-density

    nonvolatile memory technology and is compatible with the

    industry-standard 80C51 instruction set and pinout. The

    on-chip Flash allows the program memory to be reprogrammed

    in-system or by a conventional nonvolatile memory programmer.

    By combining a versatile 8-bit CPU with in-system programmable

    Flash on a monolithic chip, the Atmel AT89S52 is a powerful

    microcontroller, which provides a highly flexible and cost-

    effective solution to many, embedded control applications.

    The AT89S52 provides the following standard features:

    8K bytes of Flash

    256 bytes of RAM

    32 I/O lines

    Watchdog timer

    Two data pointers

    Three 16-bit timer/counters

    A six-vector two-level interrupt architecture

    A full duplex serial port, on-chip oscillator, and clock

    circuitry.

    In addition, the AT89S52 is designed with static logic for operation

    down to zero frequency and supports two software selectable

    power saving modes.

  • 7/27/2019 92195208 Report on Car Security System by Gsm

    10/26

    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

    interrupt.

    The hardware is driven by a set of program instructions, or

    software. Once familiar with hardware and software, the user can

    then apply the microcontroller to the problems easily.

    The pin diagram of the 8051 shows all of the input/output pins

    unique to microcontrollers:

  • 7/27/2019 92195208 Report on Car Security System by Gsm

    11/26

    The following are some of the capabilities of 8051 microcontroller.

    Internal ROM and RAM

    I/O ports with programmable pins

    Timers and counters

    Serial data communication

    The 8051 architecture consists of these specific features:

    16 bit PC &data pointer (DPTR)

    8 bit program status word (PSW)

  • 7/27/2019 92195208 Report on Car Security System by Gsm

    12/26

    8 bit stack pointer (SP)

    Internal ROM 4k

    Internal RAM of 128 bytes.

    4 register banks, each containing 8 registers

    80 bits of general purpose data memory

    32 input/output pins arranged as four 8 bit

    ports: P0-P3

    Two 16 bit timer/counters: T0-T1

    Two external and three internal interrupt

    sources Oscillator and clock circuits.

    BASIC COMPONENTS:-

    STEP DOWN TRANSFORMER

    Step down transformer converts 220 volt Ac to 9-0-9 ac. We use step down

    transformer to step down the voltage from 220 to 9 volt ac. This AC is further

  • 7/27/2019 92195208 Report on Car Security System by Gsm

    13/26

    connected to the rectifier circuit for AC to DC conversion. Transformer current rating

    is 750 ma.

    DIODE.

    In this project we use IN 4007 diode as a rectifier. IN 4007 is special diode to

    convert the AC into DC. In this project we use two diode as a rectifier. Here we use

    full wave rectifier. Output of rectifier is pulsating DC. To convert the pulsating dc

    into smooth dc we use Electrolytic capacitor as a main filter. Capacitor converts the

    pulsating dc into smooth dc and this DC is connected to the Regulator circuit for

    Regulated 5 volt DC.

  • 7/27/2019 92195208 Report on Car Security System by Gsm

    14/26

    CIRCUIT FOR 5V POWER SUPPLY

    Output of the diode is pulsating dc .So to convert the pulsating dc into

    smooth dc we use electrolytic capacitor.

    Electrolytic capacitor converts the pulsating dc into smooth dc.

    This Dc is further regulated by the IC 7805 regulator. IC 7805 regulator

    provide a regulated 5 volt dc to the microcontroller circuit and LCD circuit.

    Pin no 40 of the controller is connected to the positive supply.

    Pin no 20 is connected to the ground. Pin no 9 is connected to external

    resistor capacitor to provide a automatic reset option when power is on.

  • 7/27/2019 92195208 Report on Car Security System by Gsm

    15/26

    Reset Circuitry:

    Pin no 9 of the controller is connected to the reset circuit. In the circuit we

    connect one resistor and capacitor circuit to provide a reset option when

    power is ON.

    As soon as you give the power supply the 8051 doesnt start. You need to restart

    for the microcontroller to start. Restarting the microcontroller is nothing but

    giving a Logic 1 to the reset pin at least for the 2 clock pulses. So it is good to go

    for a small circuit which can provide the 2 clock pulses as soon as the

    microcontroller is powered.

    This is not a big circuit we are just using a capacitor to charge the

    microcontroller and again discharging via resistor.

  • 7/27/2019 92195208 Report on Car Security System by Gsm

    16/26

    Crystals

    Pin no 18 and 19 is connected to external crystal oscillator to provide a

    clock to the circuit.

    Crystals provide the synchronization of the internal function and to the peripherals. Whenever

    ever we are using crystals we need to put the capacitor behind it to make it free from noises. It

    is good to go for a 33pf capacitor.

    We can also resonators instead of costly crystal which are low cost and

    external capacitor can be avoided. But the frequency of the resonators

    varies a lot. And it is strictly not advised when used for communications

    projects.

    How is this time then calculated?

    The speed with which a microcontroller executes instructions is determined

    by what is known as the crystal speed. A crystal is a component connected

    externally to the microcontroller. The crystal has different values, and some

    of the used values are 6MHZ, 10MHZ, and 11.059 MHz etc. Thus a 10MHZ

    crystal would pulse at the rate of 10,000,000 times per second.

  • 7/27/2019 92195208 Report on Car Security System by Gsm

    17/26

    The time is calculated using the formula

    No of cycles per second = Crystal frequency in HZ / 12.

    For a 10MHZ crystal the number of cycles would be,

    10,000,000/12=833333.33333 cycles.

    This means that in one second, the microcontroller would execute

    833333.33333 cycles.

    PIN DESCRIPTION OF MICROCONTROLLER:-

    Pin no 1 to pin no 8 is PORT 1 and Pin no 10 to 17 is PORT 3.

    Pin no 18 and 19 of the IC is connected to the external crystal to provide a

    external clock to run the internal CPU of controller.

    Pin no 20 is ground pin.

    Pin no 21 to 28 is PORT 2 pins.

    Pin no 29,30,31 is not use in this project. We use these pin when we

    require a extra memory for the project. If we internal memory of the 89s51 (

    which is 4k rom) then we connect pin no 31 to the positive supply.

  • 7/27/2019 92195208 Report on Car Security System by Gsm

    18/26

    CIRCUIT DIAGRAM

  • 7/27/2019 92195208 Report on Car Security System by Gsm

    19/26

    LCD LIQUID CRYSTAL DISPLAY

    PIN DIAGRAM FOR LCD CONNECTION

    8051LCD

    P1.

    3

    P1.

    6

    P1.

    0P1.

    1P1.2

    RS R/

    W

    E

    D4

    D7

    D0

    D0

    D0

    10K

    PO

    T

    +5

    V

  • 7/27/2019 92195208 Report on Car Security System by Gsm

    20/26

    PIN DESCRIPTION FOR LCD

    Pin Symbol I/O Description1 VSS --- Ground

    2 VCC --- +5V Power Supply

    3 VEE --- Contrast control

    4 RS I RS=0 to select command

    register,

    RS=1 to select data register

    5 R/W I 0 = for write,

    1 = for read

    6 E I/O Enable (Clock)

    7 DB0 I/O The 8-bit data bus

    8 DB1 I/O The 8-bit data bus

    9 DB2 I/O The 8-bit data bus

    10 DB3 I/O The 8-bit data bus

    11 DB4 I/O The 8-bit data bus

    12 DB5 I/O The 8-bit data bus

    13 DB6 I/O The 8-bit data bus

    14 DB7 I/O The 8-bit data bus

  • 7/27/2019 92195208 Report on Car Security System by Gsm

    21/26

    LCD Command Codes

    Code

    (Hex)

    Command on LCD

    REGISTER

    1 Clear display screen

    2 Return home

    4 Decrement cursor (shift cursor to left)

    6 Increment cursor (Shift cursor to right)

    5 Shift display right

    7 Shift display left

    8 Display off, cursor off

    A Display off, cursor on

    C Display on, cursor off

    E Display on, cursor on

    F Display on, cursor blinking

    10 Shift cursor position to left

    14 Shift cursor position to right

    18 Shift the entire display to left

    1C Shift the entire display to right

    80 Force cursor to beginning of 1st line

    C0 Force cursor to beginning of 2nd line

    38 2 lines and 5x7 matrix

  • 7/27/2019 92195208 Report on Car Security System by Gsm

    22/26

    ALGORITHM USED IN DEVELOPMENT OF PROGRAM

    Port Declaration:

    Port 0:- LCD Port2:- KEY 1-7, 9

    Port 3.4-3.7:-KEY 8, 0, SET, RESET

    Port3.3:- Enter (Motor Starting Switch)

    Port1.1:- To Indicate Switching ON/OFF Motor

    Port1.0:- Password Set Indicator

    STEPS TO PREPARE MICRO-CONTROLLER FOR PROGRAM

    EXECUTION:-

    STEP1. Move #00H to PSW

    -Carry, Auxiliary carry, Overflow, Parity Flag = 0.

    -Register Bank 0

    STEP2. Move SP, #70H

    -To Use Memory locations 70H-78H as Stack

    STEP3. Move TMOD, #20H

    -Timer 1 in Mode 2

    STEP4. Move TCON, #00H

    -To Reset All Timer Flag & Run Control Bits

    -To Reset All Interrupt Edge Flag & Type Control Bits

  • 7/27/2019 92195208 Report on Car Security System by Gsm

    23/26

    PROGRAM:-

    STEP1. Prepare microcontroller For Operation.

    2. Load Timer 1 for Required Baud rate.

    3. Configure All Ports as Input Port.

    4. Make LCD To Show ENTER MOBILE NO

    5. Allocate Memory to Store the Enter No.

    6. Activate Keypad To Enter No.

    7. Store No. If of 10 Digits else Show INCorrect No.

    8. Show Stop on LCD.

    9. Put 0 At P1.0 To Show Mobile No. Is Stored.

    10. Wait For Starting Of Motor (Logic 0 at P3.3).

    11. Make LCD To Show ENTER PASSWORD

    12. Allocate Memory to Store the Enter No.

    13. Activate Keypad To Enter No. .

    14. Compare With Stored Password.

    15. Grant Access if Password Is Valid & Wait Until

    Motor Is Switched OFF.

    16. When Motor Is Switched ON Go to Step 10.

  • 7/27/2019 92195208 Report on Car Security System by Gsm

    24/26

    17. If Password Is Incorrect Make LCD To Show

    INVALID PASSWORD.

    18. Put Logic 0 on P1.1 & P1.0.

    19. Activate GSM Modem To Alert The OWNER &

    Wait For Response.

    STEPS TO SHOW MESSAGE ON LCD

    1. Activate LCD in 4-bit Mode.

    2. Configure LCD as 16*2 Matrix of 5*7.

    3.Clear LCD.

    4. Put Data/Command Information On Data Bus Of LCD.

    Issue Control Signal.

    STEPS TO WRITE Data/Command Information ON

    LCD

    1. Put Logic 0 on bit P0.0 For Command & Logic 1 for

    Data.

    2. Put Logic 0 on bit P0.2.

    3. Put Logic 0 on bit P0.1.

    4. Move Data to Accumulator.

  • 7/27/2019 92195208 Report on Car Security System by Gsm

    25/26

    5. Move Upper Nibble of A to Data Bus of LCD.

    6. Apply HIGH to LOW Pulse On Enable Pin Of LCD.

    7. Data Sending Complete Return Else Rotate A & GoBack To Step4.

    STEPS TO READ DATA FROM KEYPAD

    1. Check For Logic 0 on Key If Found Go To Step 2

    Else To Step 5.

    2. Check Again After Appropriate Delay For Logic 0 on

    Key If Found Go To Step 3 Else To Step 5.

    3. Store and Move ASCII Code if Numeric Keys write

    on LCD else call for appropriate subroutines.

    4. Check For Debounce Of Key If Debounces Go ToStep 5 To Check For Next Key Input Else Wait.

    5. Check For Key Logic 0 On Next Key IF Found Go To

    Step 2.

    STEPS TO COMMUNICATE WITH MODEM

    1. Initialize Modem & Microcontroller to Communicate

    Serially.

  • 7/27/2019 92195208 Report on Car Security System by Gsm

    26/26

    2. To Transmit Data Move Data from Memory to Acc &

    Then to SBuf Register & Clear tr0.

    3. Wait For Setting Of T1.

    4. To Receive Data Wait For Rising of R1 If Raises Go To

    Next Step Else Wait.

    5. Move Data from SBuf to Acc Then to Required

    Memory Location.

    Register Declaration

    LCD_Data:- To Communicate Data to LCD

    Trans_Data:- To Communicate with MODEM