smart tanker robot for security operations in the protected area with wireless secured communication

70
SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 1 DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY CHAP TER 1 INTRODUCTION 1.1 OVERVIEW Robotics is the branch of technology that deals with the design, construction, operation, and application of robots, as well as computer systems for their control, sensory feedback, and information processing. These technologies deal with automated machines that can take the place of humans in dangerous environments or manufacturing processes, or resemble humans in appearance, behaviour, and/or cognition. Many of today's robots are inspired by nature contributing to the field of bio-inspired robotics. The concept of creating machines that can operate autonomously dates back to classical times, but research into the functionality and potential uses of robots did not grow substantially until the 20th century. Throughout history, robotics has been often seen to mimic human behaviour, and often manage tasks in a similar fashion. Today, robotics is a rapidly growing field, as technological advances continue; research, design, and building new robots serve various practical purposes, whether domestically, commercially, or militarily. Many robots do jobs that are hazardous to people such as defusing bombs, mines and exploring shipwrecks. 1.2 BRIEF HISTORY OF ROBOTS In 1927 the Maschinenmensch ("machine-human") gynoidhumanoid robot (also called "Parody", "Futura", "Robotrix", or the "Maria impersonator") was the first depiction of a robot ever to appear on film was played by German actress Brigitte Helm in Fritz Lang's film Metropolis. In 1942 the science fiction writer Isaac Asimov formulated his Robotics. In 1948 Norbert Wiener formulated the principles of cybernetics, the basis of practical robotics. Fullyautonomous robots only appeared in the second half of the 20th century. The first digitally operated and programmable robot, the Unimate, was installed in 1961 to lift hot pieces of metal

Upload: saran-sivaprasad

Post on 27-Sep-2015

222 views

Category:

Documents


2 download

DESCRIPTION

Robotics is the branch of technology that deals with the design, construction, operation, and application of robots, as well as computer systems for their control, sensory feedback, and information processing. These technologies deal with automated machines that can take the place of humans in dangerous environments or manufacturing processes, or resemble humans in appearance, behaviour, and/or cognition. Many of today's robots are inspired by nature contributing to the field of bio-inspired robotics.The concept of creating machines that can operate autonomously dates back to classical times, but research into the functionality and potential uses of robots did not grow substantially until the 20th century. Throughout history, robotics has been often seen to mimic human behaviour, and often manage tasks in a similar fashion. Today, robotics is a rapidly growing field, as technological advances continue; research, design, and building new robots serve various practical purposes, whether domestically, commercially, or militarily. Many robots do jobs that are hazardous to people such as defusing bombs, mines and exploring shipwrecks.

TRANSCRIPT

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 1

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    CHAPTER 1

    INTRODUCTION

    1.1 OVERVIEW

    Robotics is the branch of technology that deals with the design, construction, operation,

    and application of robots, as well as computer systems for their control, sensory feedback, and

    information processing. These technologies deal with automated machines that can take the place

    of humans in dangerous environments or manufacturing processes, or resemble humans in

    appearance, behaviour, and/or cognition. Many of today's robots are inspired by nature

    contributing to the field of bio- inspired robotics.

    The concept of creating machines that can operate autonomously dates back to classical

    times, but research into the functionality and potential uses of robots did not grow substantially

    until the 20th century. Throughout history, robotics has been often seen to mimic human

    behaviour, and often manage tasks in a similar fashion. Today, robotics is a rapidly growing

    field, as technological advances continue; research, design, and building new robots serve

    various practical purposes, whether domestically, commercially, or militarily. Many robots do

    jobs that are hazardous to people such as defusing bombs, mines and exploring shipwrecks.

    1.2 BRIEF HISTORY OF ROBOTS

    In 1927 the Maschinenmensch ("machine-human") gynoidhumanoid robot (also called

    "Parody", "Futura", "Robotrix", or the "Maria impersonator") was the first depiction of a robot

    ever to appear on film was played by German actress Brigitte Helm in Fritz Lang's film

    Metropolis. In 1942 the science fiction writer Isaac Asimov formulated his Robotics. In 1948

    Norbert Wiener formulated the principles of cybernetics, the basis of practical robotics.

    Fullyautonomous robots only appeared in the second half of the 20th century. The first digitally

    operated and programmable robot, the Unimate, was installed in 1961 to lift hot pieces of metal

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 2

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    from a die casting machine and stack them. Commercial and industrial robots are widespread

    today and used to perform jobs more cheaply, or more accurately and reliably, than humans.

    They are also employed in jobs which are too dirty, dangerous, or dull to be suitable for

    humans. Robots are widely used in manufacturing, assembly, packing and packaging, transport,

    earth and space exploration, surgery, weaponry, laboratory research, safety, and the mass

    production of consumer and industrial goods.

    1.3 BASIC BUILDING BLOCKS OF A ROBOT

    1.3.1 POWER SOURCE

    At present mostly (lead-acid) batteries are used as a power source. Many different types

    of batteries can be used as a power source for robots. They range from lead acid batteries which

    are safe and have relatively long shelf lives but are rather heavy to silver cadmium batteries that

    are much smaller in volume and are currently much more expensive. Designing a battery

    powered robot needs to take into account factors such as safety, cycle lifetime and weight.

    Generators, often some type of internal combustion engine, can also be used. However, such

    designs are often mechanically complex and need fuel, require heat dissipation and are relatively

    heavy. A tether connecting the robot to a power supply would remove the power supply from the

    robot entirely. This has the advantage of saving weight and space by moving all power

    generation and storage components elsewhere. However, this design does come with the

    drawback of constantly having a cable connected to the robot, which can be difficult to manage.

    Potential power sources could be pneumatic (compressed gases), hydraulics (liquids), flywheel

    energy storage, organic garbage (through anaerobic digestion).

    1.3.2 ACTUATORS

    Actuators are like the "muscles" of a robot, the parts which convert stored energy into

    movement. By far the most popular actuators are electric motors that spin a wheel or gear, and

    linear actuators that control industrial robots in factories. But there are some recent advances in

    alternative types of actuators, powered by electricity, chemicals, or compressed air. The majority

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 3

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    of robots use electric motors, often brushed and brushless DC motors in portable robots, or AC

    motors in industrial robots and CNC machines. These motors are often preferred in systems with

    lighter loads, and where the predominant form of motion is rotational. Various types of linear

    actuators move in and out instead of rotating, and often have quicker direction changes,

    particularly when very large forces are needed such as with industrial robotics. They are

    typically powered by compressed air (pneumatic actuator) or oil (hydraulic actuator).

    1.3.3 SENSORS

    Sensors allow robots to receive information about a certain measurement of the

    environment, or internal components. This is essential for robots to perform their tasks, and act

    upon any changes in the environment to calculate the appropriate response. They are used for

    various forms of measurements, to give the robots warnings about safety or malfunctions, and to

    provide real time information of the task it is performing. Current robotic and prosthetic hands

    receive far less tactile information than the human hand. Recent research has developed a tactile

    sensor array that mimics the mechanical properties and touch receptors of human fingertips. The

    sensor array is constructed as a rigid core surrounded by conductive fluid contained by an

    elastomeric skin. Electrodes are mounted on the surface of the rigid core and are connected to an

    impedance-measuring device within the core. When the artificial skin touches an object the fluid

    path around the electrodes is deformed, producing impedance changes that map the forces

    received from the object. The researchers expect that an important function of such artificial

    fingertips will be adjusting robotic grip on held objects. Computer is the science and technology

    of machines that see. As a scientific discipline, computer vision is concerned with the theory

    behind artificial systems that extract information from images. The image data can take many

    forms, such as video sequences and views from cameras.

    1.3.4 MANIPULATOR

    Robots need to manipulate objects; pick up, modify, destroy, or otherwise have an effect.

    Thus the "hands" of a robot are often referred to as end effectors, while the "arm" is referred to

    as a manipulator. Most robot arms have replaceable effectors, each allowing them to perform

    some small range of tasks. Some have a fixed manipulator which cannot be replaced, while a few

    have one very general purpose manipulator, for example a humanoid hand.

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 4

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    CHAPTER 2

    PROJECT DEFINITION

    Aim of the project is to design embedded system to create a wireless spy robot for secret

    monitoring purpose, which can be used for safety and security purpose where the security

    threads are high and to find the human body inside the building blocks that are destroyed by

    earthquake or building crashes and focuses. An embedded system is a combination of computer

    circuitry and software that is built into a product for purposes such as control, monitoring and

    communication without human intervention. Embedded systems are at the core of every modern

    electronic product, ranging from toys to medical equipment to aircraft control systems.

    Embedded systems span all aspects of modern life and there are many examples of their use. The

    uses of embedded systems are virtually limitless, because every day new products are introduced

    to the market that utilizes embedded system in novel ways. An embedded system contains at

    least one microprocessor which performs the logic operations for the system. Many embedded

    systems use one or more microcontrollers, which are a type of microprocessor that emphasizes

    self-sufficiency and cost-effectiveness, instead of a general purpose microprocessor. A typical

    microcontroller contains sufficient memory and interfaces for simple applications, whereas

    general-purpose microprocessors require additional chips to provide these functions, including at

    least one ROM (read-only memory) chip to store the software. Project uses Microchips

    microcontroller IC named Peripheral Interface Controller (PIC) and Microchips Integrated

    Development Environment, MPLAB, to simulate and assemble the written code.

    In this project the robot consist of wireless camera, PIR sensor and motor drivers. The

    robot is an all-terrain vehicle, it can move anywhere like a spy. It is a belted vehicle as military

    tanker. The wireless camera captures all traveled areas of the robot. The PIR sensor detects the

    human intrusion in protected areas or person trapped inside building blocks destroyed by earth

    quake. These values are fed to the microcontroller and transmitted to PC through Bluetooth. At

    that time RF transmitter also transmit the signals to the PC via RF receiver and tuner card.

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 5

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    CHAPTER 3

    LITERATURE SURVEY

    3.1 INTRUDER TRACKING USING WIRELESS SENSOR NETWORK

    Nowadays, almost all the countries are facing threats from terrorists and intruders from

    their border areas, challenging the internal security of the country in those areas. So many

    civilian and military applications require locating an intruder in a secured area. Target tracking,

    data processing and analysis play a major role in this type of applications. The proposed system

    is to develop a centralized computer application that needs to identify moving objects in a

    specific area using sensors. The system will be basically designed to detect human intruders. The

    objective is to design and implement an object tracking system using a wireless sensor network.

    The human intruder is detected using a passive infrared (PIR) sensor. The PIR sensor is able to

    detect the humans and provide information about the direction of the movement.

    Published in: Computational 28-29 Dec. 2010

    3.2 URBAN SEARCH AND RESCUE (USAR) ROBOTS

    There are many different kind of catastrophe in natural and man-made disaster:

    earthquake, flooding, hurricane and they cause different disaster area like collapsed building,

    landslide or crater. During these emergency situations, and especially in urban d isaster, many

    different people are deployed (policeman, fire fighters and medical assistance). They need to

    cooperate to save lives, protect structural infrastructure, and evacuate victims to safety. In these

    situations, human rescuers must make quick decisions under stress, and try to get victims to

    safety often at their own risk. They must gather determine the location and status of victims and

    the stability of the structures as quickly as possible so that medics and fire fighters can enter the

    disaster area and save victims. All of these tasks are performed mostly by human and trained

    dogs, often in very dangerous and risky situations. This is why since some years; mobile robots

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 6

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    have been proposed to help them and to perform tasks that neither humans dogs nor existing

    tools can do. For this project, we will focus only on robots which will work in a disaster

    environment of manmade structure, like collapsed buildings. They are called Urban Search and

    Rescue (USAR) robots.

    Published in: IEEE transactions-2012

    3.3 AVATAR III SECURITY ROBOT

    Avatar III Security Robots can significantly augment your existing security capabilities.

    Robots stationed around an area can be activated at a moments notice to inspect a situation of

    interest significantly reducing incident response times in the process. It can be used hundreds

    of miles away from a central Security Operations Centre they run through your existing Wi-Fi

    network and recharge at remote docking stations that plug into existing power outlets. Control

    software installs on a PC or Mac and uses a handheld controller to provide on-site, ad-hoc robot

    control over existing Wi-Fi networks. Just unpack the robot and start patrolling through your

    existing security infrastructure. Wireless, real-time video and two-way audio feeds allow the

    robot to act as a mobile camera platform, public announcement system, and remote

    communication tool. Groups of Avatar III Security Robots can provide coverage for cents-on-

    the-dollar when compared to traditional security deployments.

    Each Avatar III Security Robot comes with 100% flipper-to-flipper hardware coverage

    and free technical support. We also make customization and integration simple. We work with a

    network of integrators to make sure each Avatar III Security Robot deployment meets your

    unique security needs and works with your existing infrastructure. Stair climbing ability, built- in

    IR night vision, and dock-connector charging work to ensure full range of movement for robot

    security patrols. The robots rugged track system also works almost anywhere carpets, wet

    floors, rugged outdoor terrain, and slick concrete.

    Published in: Elsevier-2011

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 7

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    CHAPTER 4

    SYSTEM DESCRIPTION

    4.1 BLOCK DIAGRAM

    The block diagram consists of the robot and receiver section. They can be represented as

    the following block diagrams.

    Fig 4.1 Block Diagram of Robot

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 8

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    Fig. 4.2 Block Diagram of Receiver Section

    4.2 HARDWARE DETAILS

    The details of hardware components used in the system are given below.

    4.2.1 16F877A PIC

    PIC is a family of modified Harvard architecture microcontrollers made by Microchip

    Technology, derived from the PIC1650 originally developed by General Instrument's

    Microelectronics Division. The name PIC initially referred to "Peripheral Interface Controller".

    PICs are popular with both industrial developers and hobbyists alike due to their low

    cost, wide availability, large user base, extensive collection of application notes, availability of

    low cost or free development tools, and serial programming (and re-programming with flash

    memory) capability. They are also commonly used in educational programming as they often

    come with the easy to use 'PIC logicator' software. System consists of a PIC microcontroller unit

    of pic-16F family. The PIC processor used in this category is 877A.

    The PIC16F877A features 256 bytes of EEPROM data memory, self programming, an

    ICD, 2Comparators, 8 channels of 10-bit Analog-to-Digital (A/D) converter, 2

    capture/compare/PWM functions, the synchronous serial port can be configured as either 3- wire

    Serial Peripheral Interface (SPI) or the 2-wire Inter-Integrated Circuit (IC) bus and a Universal

    Asynchronous Receiver Transmitter (USART).

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 9

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    High-Performance RISC CPU:

    Only 35 single-word instructions to learn

    All single-cycle instructions except for program branches, which are two-cycle

    Operating speed: DC 20 MHz clock input, DC 200 ns instruction cycle

    Up to 8K x 14 words of Flash Program Memory,

    Up to 368 x 8 bytes of Data Memory (RAM),

    Up to 256 x 8 bytes of EEPROM Data Memory

    Pinout compatible to other 28-pin or 40/44-pin

    PIC16CXXX and PIC16FXXX microcontrollers

    Peripheral Features:

    Timer0: 8-bit timer/counter with 8-bit prescaler

    Timer1: 16-bit timer/counter with prescaler, can be incremented during Sleep via external

    crystal/clock

    Timer2: 8-bit timer/counter with 8-bit period register, prescaler and postscaler

    Two Capture, Compare, PWM modules

    - Capture is 16-bit, max. resolution is 12.5 ns

    - Compare is 16-bit, max. resolution is 200 ns

    - PWM max. resolution is 10-bit

    Synchronous Serial Port (SSP) with SPI (Master mode) and I2C (Master/Slave)

    Universal Synchronous Asynchronous Receiver Transmitter (USART/SCI) with 9-bit address

    detection

    Parallel Slave Port (PSP) 8 bits wide with external RD, WR and CS controls (40/44-pin only)

    Brown-out detection circuitry for Brown-out Reset (BOR)

    Analog Features:

    10-bit, up to 8-channel Analog-to-Digital Converter (A/D)

    Brown-out Reset (BOR)

    Analog Comparator module with:

    - Two analog comparators

    - Programmable on-chip voltage reference (VREF) module

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 10

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    - Programmable input multiplexing from device inputs and internal voltage reference

    - Comparator outputs are externally accessible

    4.2.1.1 PINOUT DIAGRAM

    Fig 4.3.Pin out diagram of PIC16F877A

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 11

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    Table 4.1: PIC16F877A device features

    4.2.1.2 INPUT/OUTPUT PORTS

    One of the most important features of the microcontroller is a number of input/output

    pins used for connection with peripherals. In this case, there are in total of thirty-five general

    purpose I/O pins available, which is quite enough for the most applications. In order pins

    operation can match internal 8-bit organization, all of them are, similar to registers, grouped into

    five so called ports denoted by A, B, C, D and E. They all have several features in common:

    For practical reasons, many I/O pins have two or three functions. If a pin is used as any

    other function, it may not be used as a general purpose input/output pin and every port has its

    satellite, i.e. the corresponding TRIS register: TRISA, TRISB, TRISC etc. which determines

    performance, but not the contents of the port bits.

    By clearing some bit of the TRIS register (bit=0), the corresponding port pin is

    configured as output. Similarly, by setting some bit of the TRIS register (bit=1), the

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 12

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    corresponding port pin is configured as input. This rule is easy to remember 0 = Output, 1 =

    Input.

    Port A and TRISA Register

    Port A is an 8-bit wide, bidirectional port. Bits of the TRISA and ANSEL control the

    PORTA pins. All Port A pins act as digital inputs/outputs. Five of them can also be analog inputs

    (denoted as AN):

    Port A and TRISA Register

    Fig 4.4. Port A

    Similar to bits of the TRISA register which determine which of the pins will be

    configured as input and which as output, the appropriate bits of the ANSEL register determine

    whether the pins will act as analog inputs or digital inputs/outputs.

    RA0 = AN0 (determined by bit ANS0 of the ANSEL register);

    RA1 = AN1 (determined by bit ANS1 of the ANSEL register);

    RA2 = AN2 (determined by bit ANS2 of the ANSEL register);

    RA3 = AN3 (determined by bit ANS3 of the ANSEL register); and

    RA5 = AN4 (determined by bit ANS4 of the ANSEL register).

    Each bit of this port has an additional function related to some of built- in peripheral units.

    These additional functions will be described in later chapters. This chapter covers only the RA0

    pins additional function since it is related to Port A only.

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 13

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    Port B and TRISB Register

    Port B is an 8-bit wide, bidirectional port. Bits of the TRISB register determine the

    function of its pins.

    Fig 4.5. Port B

    Similar to Port A, a logic one (1) in the TRISB register configures the appropriate port

    pin as input and vice versa. Six pins on this port can act as analog inputs (AN). The bits of the

    ANSELH register determine whether these pins act as analog inputs or digital inputs/outputs:

    RB0 = AN12 (determined by bit ANS12 of the ANSELH register);

    RB1 = AN10 (determined by bit ANS10 of the ANSELH register);

    RB2 = AN8 (determined by bit ANS8 of the ANSELH register);

    RB3 = AN9 (determined by bit ANS9 of the ANSELH register);

    RB4 = AN11 (determined by bit ANS11 of the ANSELH register); and

    RB5 = AN13 (determined by bit ANS13 of the ANSELH register).

    Each Port B pin has an additional function related to some of the built- in peripheral units,

    which will be explained in later chapters. All the port pins have built in pull-up resistor, which

    make them ideal for connection to push-buttons, switches and couplers. In order to connect these

    resistors to the microcontroller ports, the appropriate bit of the WPUB register should be set.

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 14

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    Port C and TRISC Register

    Port C is an 8-bit wide, bidirectional port. Bits of the TRISC Register determine the

    function of its pins. Similar to other ports, a logic one (1) in the TRISC Register configures the

    appropriate port pin as an input.

    Fig 4.6. Port C

    Port D and TRISD Register

    Port D is an 8-bit wide, bidirectional port. Bits of the TRISD register determine the

    function of its pins. A logic one (1) in the TRISD register configures the appropriate port pin as

    input.

    Fig 4.7. Port D

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 15

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    Port E and TRISE Register

    Port E is a 4-bit wide, bidirectional port. The TRISE registers bits determine the function

    of its pins. Similar to other ports, a logic one (1) in the TRISE register configures the appropriate

    port pin as input. The exception is RE3 which is input only and its TRIS bit is always read as 1.

    Similar to Ports A and B, three pins can be configured as analog inputs in this case. The

    ANSELH register bits determine whether a pin will act as analog input (AN) or digital

    input/output:

    RE0 = AN5 (determined by bit ANS5 of the ANSELregister);

    RE1 = AN6 (determined by bit ANS6 of the ANSELregister); and

    RE2 = AN7 (determined by bit ANS7 of the ANSELregister).

    Fig 4.8. Port E

    4.2.2 MOTOR CONTROL CIRCUITRY

    Fig 4.9. L293D

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 16

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    The L293 and L293D are quadruple high-current half-H drivers. The L293 is designed to

    provide bidirectional drive currents of up to 1 A at voltages from 4.5 V to 36 V. The L293D is

    designed to provide bidirectional drive currents of up to600-mA at voltages from 4.5 V to 36 V.

    Both devices are designed to drive inductive loads such as relays, solenoids, dc and bipolar

    stepping motors, as well as other high-current/high-voltage loads in positive-supply applications.

    All inputs are TTL compatible. Each output is complete totem-pole drive circuit, with a

    Darlington transistor sink and a pseudo-Darlington source.

    Drivers are enabled in pairs, with drivers 1 and 2 enabled by 1,2EN and drivers 3 and

    4enabled by 3,4EN. When an enable input is high, the associated drivers are enabled, and their

    outputs are active and in phase with their inputs. When the enable input is low, those drivers are

    disabled, and their outputs are off and in the high- impedance state. With the proper data inputs,

    each pair of drivers forms a full-H (or bridge) reversible drive suitable for solenoid or motor

    applications

    _ Wide Supply-Voltage Range: 4.5 V to 36 V

    _ Separate Input-Logic Supply

    _ Internal ESD Protection

    _ Thermal Shutdown

    _ High-Noise-Immunity Inputs

    _ Functionally Similar to SGS L293 and SGS L293D

    _ Output Current 1 A Per Channel (600 mA for L293D)

    _ Peak Output Current 2 A Per Channel (1.2 A for L293D)

    _ Output Clamp Diodes for Inductive Transient Suppression (L293D)

    Fig 4.10.Enable diagram

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 17

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    Fig 4.11. logic diagram of L293D

    4.2.3 DC GEARED MOTOR

    Geared DC motors can be defined as an extension of DC motor which already had its

    Insight details demystified here. A geared DC Motor has a gear assembly attached to the motor.

    The speed of motor is counted in terms of rotations of the shaft per minute and is termed as RPM

    .The gear assembly helps in increasing the torque and reducing the speed. Using the correct

    combination of gears in a gear motor, its speed can be reduced to any desirab le figure. This

    concept where gears reduce the speed of the vehicle but increase its torque is known as gear

    reduction. This Insight will explore all the minor and major details that make the gear head and

    hence the working of geared DC motor.

    Fig 4.12 DC Geared Motor

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 18

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    WORKING

    The working of the gears is very interesting to know. It can be explained by the principle

    of conservation of angular momentum. The gear having smaller radius will cover more RPM

    than the one with larger radius. However, the larger gear will give more torque to the smaller

    gear than vice versa. The comparison of angular velocity between input gear (the one that

    transfers energy) to output gear gives the gear ratio. When multiple gears are connected together,

    conservation of energy is also followed. The direction in which the other gear rotates is always

    the opposite of the gear adjacent to it.

    In any DC motor, RPM and torque are inversely proportional. Hence the gear having

    more torque will provide a lesser RPM and converse. In a geared DC motor, the concept of pulse

    width modulation is applied.In a geared DC motor, the gear connecting the motor and the gear

    head is quite small, hence it transfers more speed to the larger teeth part of the gear head and

    makes it rotate. The larger part of the gear further turns the smaller duplex part. The small duplex

    part receives the torque but not the speed from its predecessor which it transfers to larger part of

    other gear and so on. The third gears duplex part has more teeth than others and hence it

    transfers more torque to the gear that is connected to the shaft.

    The DC motor works over a fair range of voltage. The higher the input voltage more is

    the RPM (rotations per minute) of the motor. For example, if the motor works in the range of 6-

    12V, it will have the least RPM at 6V and maximum at 12 V.

    In terms of voltage, we can put the equation as:

    RPM= K1 * V, where,

    K1= induced voltage constant

    V=voltage applied

    Fig 4.13 Gear Structure

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 19

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    INTERNAL STRUCTURE

    On opening the outer plastic casing of the gear head, gear assemblies on the top as well

    as on bottom part of the gear head are visible. These gear assemblies are highly lubricated with

    grease so as to avoid any sort of wear and tear due to frictional forces.

    Shown below is the top part of the gear head. It is connected to rotating shaft and has one

    gear that allows the rotation. A strong circular imprint shows the presence of the gear that rotates

    the gear at the upper portion.

    Fig 4.14 Internal Structure

    4.2.4 PIR SENSORS

    Fig 4.15 Pin Diagram of PIR sensor

    PIR sensors are motion detectors, which can be installed outside your home to detect

    human intrusion. This sensor detects changes in infrared heat, caused by human movement and

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 20

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    immune to pets Passive infrared (PIR) sensors react to the infrared heat energy emitted by

    people. PIR sensors are passive devices in that they only detect radiation; they do not emit. They

    are designed to be maximally sensitive to objects that emit heat energy at a wavelength of around

    10microns (the peak wavelength of the heat energy emitted by humans.

    4.2.5 BLUETOOTH

    This module enables you to wireless transmit & receive serial data. It is a drop in

    replacement for wired serial connections allowing transparent two way data communication. Its

    key features are

    5V power operation

    UART interface

    10 meters range

    Easy to use

    Minimum External Components

    Status LED

    Fig 4.16 Bluetooth Module

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 21

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    4.2.6 WIRELESS CAMERA

    The wireless camera kit includes 1 mini camera and 1 receiver, which provides a

    complete wireless security system, perfect for monitoring around your home or small businesses

    with great convenience. Powered by the included adapter and an extra battery clip.It is a

    Wireless Colour Camera Set with Audio and Video set. The physical size of camera is really

    small and it is easy to hide in different locations and hard to be discovery. This system can be

    applied to various areas, such as Surveillance for Shops, Factories, Warehouses, HOME -

    Monitoring Children, Elders, and Visitors etc. The setup procedure is simple, just using a AV

    cable linking with above mentioned devices.

    Specifications:

    Imaging pickup: 1/3, 1/4

    TV system: NTSC/ELA

    Definition: 380TV Lines

    Scan frequency: NTSC/ELA 60Hz

    Min. Illumination: 2Lux

    Output power: 200mW

    Output frequency: 900MHz/ 1200MHz/ 2400MHz

    Camera power: DC +8V 200mAh

    Receiver power: DC +12V 500mAh

    Fig 4.17 Wireless Camera set

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 22

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    4.2.7 TUNER CARD

    A TV tuner card is a kind of television tuner that allows television signals to be received by a

    computer. Most TV tuners also function as video capture cards, allowing them to record

    television programs onto a hard disk much like the digital video recorder (DVR) does. The

    interfaces for TV tuner cards are most commonly either PCI bus expansion card or the newer

    PCI Express (PCIe) bus for many modern cards, but PCMCIA, Express Card, or USB devices

    also exist. In addition, some video cards double as TV tuners, notably the ATI All-In-Wonder

    series. The card contains a tuner and an analog-to-digital converter (collectively known as the

    analog front end) along with demodulation and interface logic.

    Fig 4.18 Tuner Card

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 23

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    CHAPTER 5

    HARDWARE IMPLEMENTTION

    5.1 DESIGN OF THE SYSTEM

    REGULATOR

    Fig 5.1 LM7805 Voltage Regulator

    Transformer used here is a step down transformer. This Voltage is given to LM7805

    voltage regulator IC. The input voltage to the LM7805 IC should be at least 2V greater than the

    required output voltage.

    The Output Voltage

    VO= 4.75V to 5.25V

    The Output Current

    Io = 5mA to 1.5A

    For Load Regulation

    = ((4.75-5.25)/5.75)/ ((5 X 10-3-1.5)/5 X 10-3)

    = 3.522 X 10-4V

    OO

    OO

    Ii

    VvgLoad

    /

    /Re

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 24

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    Line regulation (source regulation SR) is the change in the line voltage. It depends on the

    line voltage (230V10V)

    Line Regulation=vo/V0

    v1/V1

    = ((4.75-5.75)/5.75)/ ((8-12/12))

    =0.286V

    Ripple factor of the power supply () =0.48

    = 1/4*3fRC

    Take R=330

    C=1.8*10-5

    =0.1F

    MICROCONTROLLER

    Fig 5.2 Design of PIC16F877A

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 25

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    PIC microcontroller has 2 VDD pins (11 & 32) for 3.3v supply and 2 VSS pins (12 &

    31) for ground. First pin of PIC IC is pin , when this pin is grounded or active low PIC

    get reset. So for making IC in working mode, pin is pulled up through resister R2. A

    switch sw1 is given to ground pin and to reset the program.

    The value of resistor R2,

    R2=

    I

    V=5V

    I=0.5mA

    R2=5V / .5mA

    =10K

    For working in 1 micro second clock, a 4MHz crystal oscillator is used. The capacitors

    C4 & C5 connected to the crystal oscillator. These are the stabilizing capacitors which stabilizes

    oscillations from the crystal, without these capacitors the oscillations produced by the crystal

    oscillator will die out and the crystal oscillator will not be able to produce the clock frequency of

    4MHz

    The value of capacitors,

    C4 & C5= 0.7

    5

    f= 4MHZ

    I= 0.5mA

    C4 & C5 = (0.7*0.5mA) / (5*4MHz)

    =17.5*10-11 F

    =22 PF std.

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 26

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    5.2 CIRCUIT DESCRIPTION

    Fig. 5.3 Circuit Diagram

    The above figure shows the circuit diagram of the proposed system. It consists of a PIC

    16F877a microcontroller, two PIR sensors, two motor driver ICs, a Bluetooth module & a7805

    voltage regulator. A constant voltage of 5V is applied to the 11th & 32nd pin of microcontroller,

    4th pin of Bluetooth module, 3rd pin of PIR sensors & various pins of the motor driver ICs

    through voltage regulator LM7805. The output of the PIR sensor is obtained from pin 2. The

    output of the 1st PIR sensor is connected to the RB0 (pin 33) of the microcontroller. RB0 acts as

    the external interrupt. The output from the 2nd sensor is given to the RB1 (Pin 34) of

    microcontroller. The operating frequency of the microcontroller is determined by the 13 th & 14th

    pin. The operating frequency of the proposed system is 4Mhz. for the efficient working of the

    motors; it should get a voltage of 12V & 1A current. The motor driver L293D increases the

    voltage from 5V to 12V & current to 1A. The data from the microcontroller is sent to the

    receiver through the Bluetooth module. The 2nd & 3rd pin of the module is connected to

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 27

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    microcontroller for this purpose. The motor driver L293D have 4 output pins. So two motors can

    be connected using a motor driver IC. The direction of motors is determined by the o utput pins.

    5.3 PCB LAYOUT

    Fig 5.4 Top Layout

    Fig 5.5 Bottom Layout

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 28

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    5.4 WORKING PRINCIPLE

    All objects with a temperature above absolute zero emit heat energy in the form of

    radiation. Usually this radiation is invisible to the human eye because it radiates at infrared

    wavelengths, but it can be detected by electronic devices designed for such a purpose. Here a

    PIR-based motion detector is used to sense movement of people, animals, or other objects. They

    are commonly used in burglar alarms and automatically-activated lighting systems. They are

    commonly called simply "PIR", or sometimes "PID", for "passive infrared detector". What is

    actually detected is the broken field for a normal temperature. The sensor detects the change in

    the infrared radiation and triggers an alarm if the gradient of the change is higher than a

    predefined value. Thus the field does not have to be broken by an object with a different

    temperature in order to register change, as sensors will activate from the configuration change of

    the environment. The PIR sensor senses temperature ranging from 35-40 degrees Celsius. Thus

    any presence of intruders may be human or animal are detected.

    The sensed signal is then passed to the microprocessor as an external interrupt. A 5v

    power supply is provided for the operation of the microprocessor. The microcontroller is used to

    control the motion of the tanker robot. A motor driver acts as a voltage and current amplifier.

    12v power supply is required for the mechanical operation of the wheels. Whenever an interrupt

    is sensed, the signal is transmitted to PC using Bluetooth.

    A wireless camera with a video receiver is connected to the robot which is independent to

    theworking of microprocessor. The video signals are also transmitted to PC using RF.

    The receiver section consists of two transceiver antennas and a PC. One antenna is used

    to receive Bluetooth signals from the microcontroller. The motion of robot can be also controlled

    through this section. The other antenna receives RF signals from the video camera and is given

    to the PC through tuner card.

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 29

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    CHAPTER 6

    SOFTWARE IMPLEMENTATION

    The software system mainly includes the implementation of Smart Tanker Robot. Here

    the program is used to control the movement of the robot as well as to detect human presence.

    This is done using PIC 16F877A. The interfacing of the entire system is done as per the port

    available with the PIC 16F877A. The program for the PIC microcontroller is done using MP lab

    software and simulation of the program is done on Proteus Software.

    The main steps of the program from which the system works is explained here.

    6.1 ALGORITHM

    Step 1: Start

    Step 2: Turn on the system, initialize the PIR sensors, motor driver and Bluetooth module and

    wireless camera

    Step 3: Sense the command given by the user and move according to it.

    Step 4: If PIR sensor detects human presence, stop the robot

    Step 5: Turn the camera to the desired direction where the PIR sensor detected Human presence

    Step 6: Send a message to the user saying that Human presence is detected

    Step 5: Check of command from user, if a command is not received continue with Step 5

    Step 6: If a command is received, turn camera to forward direction and more according to the

    given command

    Step 6: Stop.

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 30

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    6.2 FLOW CHART

    6.2.1 Movement

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 31

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    6.2.2 Human Detection

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 32

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    6.3 SOFTWARE TOOLS

    6.3.1 PROTEUS

    Proteus is software for microcontroller simulation, schematic capture, and printed circuit

    board (PCB) design .Proteus Professional - software for automated design of electronic circuits.

    The package is a system of circuit simulation, based on the models o f electronic components in

    Spice. A distinctive feature of the package Proteus Professional is the possibility of modelling of

    the programmable devices: microcontrollers, microprocessors, DSP and others.

    Additionally, the package of Proteus Professional is a system design of printed circuit

    boards. Proteus Professional can simulate the following microcontrollers: 8051, ARM7, AVR,

    Motorola, PIC, Basic Stamp. The library contains the components of reference data Co-

    simulation of microprocessor software within a mixed mode SPICE simulator .Proteus 7.1 issued

    to design good microcontroller circuit. Proteus 7.1 SP2 is also good to learn basic electronics

    such as electronics to the application microcontroller.

    Fig 6.1 Main window of Proteus 7.1

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 33

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    6.3.2 MP LAB IDE

    MPLAB IDE is a software program that runs on a PC to develop applications for

    Microchip microcontrollers. It is called an Integrated Development Environment, or IDE,

    because it provides a single integrated environment to develop code for embedded

    microcontrollers.

    IMPLEMENTING AN EMBEDDED SYSTEM DESIGN WITH MPLAB IDE

    A development system for embedded controllers is a system of programs running on

    desktop PC to help write, edit, debug and program code. The intelligence of embedded systems

    applications. Into a microcontroller. MPLAB IDE runs on a PC and contains all the components

    needed to design and deploy embedded systems applications. The typical tasks for developing an

    embedded controller application are:

    1. Create the high level design. From the features and performance desired, decide which PIC

    micro MCU or dsPIC DSC device is best suited to the application, and then design the associated

    hardware circuitry. After determining which peripherals and pins control the hardware, write the

    firmware. The software that will control the hardware aspects of the embedded application.

    A language tool such as an assembler, which is directly translatable into machine code, or

    a compiler that allows a more natural language for creating programs, should be used to write

    and edit code. Assemblers and compilers help make the code understandable, allowing function

    labels to identify code routines with variables that have names associated with their use, and with

    constructs that help organize the code in maintainable structure.

    2. Compile, assemble and link the software using the assembler and/or compiler and linker to

    convert your code into ones and zeroes machine code for the PIC micro MCUs. This machine

    code will eventually become the firmware (the code programmed into the microcontroller).

    3. Test your code. Usually a complex program does not work exactly the way imagined, and

    .bugs. Need to be removed from the design to get proper results. The debugger allows you to see

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 34

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    the .ones and zeroes. Execute, related to the source code you wrote, with the symbols and

    function names from your program. Debugging allows you to experiment with your code to see

    the value of variables at various points in the program, and to do .what if. Checks, changing

    variable values and stepping through routines.

    4. .Burn the code into a microcontroller and verify that it executes correctly in the finished

    application

    COMPONENTS OF MPLAB IDE

    The MPLAB IDE has both built- in components and plug- in modules to configure the

    System for a variety of software and hardware tools.

    MPLAB IDE BUILT-IN COMPONENTS

    The built- in components consist of

    PROJECT MANAGER

    The project manager provides integration and communication between the IDE and the

    language tools.

    EDITOR

    The editor is a full- featured programmers text editor that also serves as a window into

    the debugger.

    ASSEMBLER/LINKER AND LANGUAGE TOOLS

    The assembler can be used stand-alone to assemble a single file, or can be used with the

    linker to build a project from separate source files, libraries and recompiled objects. The linker is

    responsible for positioning the compiled code into memory areas of the target microcontroller.

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 35

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    DEBUGGER

    The Microchip debugger allows breakpoints, single stepping, watch windows and all the features

    of a modern debugger for the MPLAB IDE. It works in conjunction with the editor to reference

    information from the target being debugged back to the source code.

    EXECUTION ENGINES

    There are software simulators in MPLAB IDE for all PIC micro MCU and dsPIC DSC

    devices. These simulators use the PC to simulate the instructions and some peripheral functions

    of the PIC micro MCU and ds PIC DSC devices. Optional in-circuit emulator sand in-circuit

    debuggers are also available to test code as it runs in the applications hardware.

    ADDITIONAL OPTIONAL COMPONENTS FOR MPLAB IDE

    Optional components can be purchased and added to the MPLAB IDE:

    COMPILER LANGUAGE TOOLS

    MPLAB C18 and MPLAB C30 C compilers from Microchip provide fully integrated,

    optimized code. Along with compilers from HI-TECH, IAR, micro Engineering Labs, CCS and

    Byte Craft, they are invoked by the MPLAB IDE project manager to compile code that is

    automatically loaded into the target debugger for instant testing and verification.

    PROGRAMMERS

    PICSTART Plus, Pick kit 1 and 2, PRO MATE II, MPLAB PM3 as well as MPLAB ICD

    2 can program code into target devices. MPLAB IDE offers full control over programming both

    code and data, as well as the Configuration bits to set the various operat ing modes of the target

    microcontrollers or digital signal controllers.

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 36

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    IN-CIRCUIT EMULATORS

    MPLAB ICE 2000 and MPLAB ICE 4000 are full- featured emulators for the PIC micro

    MCU and dsPIC DSC devices. They connect to the PC via I/O ports and allow full control over

    the operation of microcontroller in the target applications.

    IN-CIRCUIT DEBUGGER

    MPLAB ICD 2 provides an economic alternative to an emulator. By using some of the

    on-chip resources, MPLAB ICD 2 can download code into a target microcontroller inserted in

    the application, set breakpoints, single step and monitor registers and variables.

    The main steps in creating a project in MP lab includes

    Running MPLAB IDE

    To start MPLAB IDE, double click on the icon installed on the desktop after installation

    or select Start>Programs>Microchip>MPLAB IDE vx.xx>MPLAB IDE. A screen will display

    the MPLAB IDE logo followed by the MPLAB IDE desktop

    Fig 6.2 Main window of MP lab

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 37

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    SELECTING THE DEVICE

    To show menu selections in this document, the menu item from the top row in MPLAB

    IDE will be shown after the menu name like this Menu Name>Menu Item. To choose the Select

    Device entry in the Configure menu, it would be written as Configure>Select Device. Choose

    Configure>Select Device. In the Device dialog, select the PIC18F877Afrom the list if its not

    already selected

    Fig 6.3 Indication of supporting components

    The lights indicate which MPLAB IDE components support this device. A green light

    indicates full support. A yellow light indicates preliminary support for an upcoming part by the

    particular MPLAB IDE tool component. Components with a yellow light instead of a green light

    are often intended for early adopters of new parts who need quick support and understand that

    some operations or functions may not be available.. A red light indicates no support for this

    device. Support may be forthcoming or inappropriate for the tool, e.g., ds PIC DSC devices

    cannot be supported on MPLAB ICE 2000.

    6.3.3 ORCAD

    Orcad is a suite of tools from Cadence for the design and layout of printed circuit boards

    (PCBs). We are currently using version 9.2 of the Orcad suite. This document will give you a

    crash course in designing an entire circuit board from start to finish. This will be a very small

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 38

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    and simple circuit, but it will demonstrate the major concepts and introduce the tools behind

    completing a PCB design. After you have completed this tutorial, you will know all the steps

    needed to make PCBs using Orcad.

    STEPS

    1. STARTING A NEW SCHEMATIC PROJECT

    Fig 6.4 window of new project in Orcad

    To create a new project, first start orcad capture c is then click filenewproject. you

    will see the following dialog box. browse to the power supply\schematic directory that you

    created and name the project psu (short for power supply unit). the project name is more

    important than the name of your project folder. it is used as the name of all the files in your

    project. so give the project a meaningful and short name. select the pc board wizard radio button

    and click ok. in the next dialog box uncheck enable project simulation. click next and then

    remove all libraries from rhs then click Finish. You should see an empty schematic page and a

    project window like the following.

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 39

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    Fig 6.5 Window of Orcad capture

    ABOUT LIBRARIES AND PARTS

    Orcad allows you to have libraries of part symbols for use in schematic entry. These

    libraries are kept in separate files that are included in the project workspace. This allows you to

    reuse libraries in other designs. Enormous parts are already in existing Orcad libraries. You can

    use these parts directly from these libraries. Open your schematic page from the Project window

    if it is not open. Your schematic is located in psu.dsnSCHEMATIC1PAGE1 in the project

    window. Now click on the Place Part tool from the right toolbar. The following dialog box

    appears.

    Fig 6.6 Window of Dialog Box

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 40

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    CREATING A SCHEMATIC PARTS LIBRARY

    Orcad allows you to create your own libraries of part symbols. You can create symbols

    for those parts, which you are unable to find in Orcad libraries, or you want to draw a part

    symbol according to your own standard and convenience. We will now create symbols for some

    of the parts in our design and use the rest from the Orcad built- in libraries. For this we have to

    add a new library to our design. To do this, highlight the psu.dsn in the project window and click

    File New Library. Right-click thelibrary1.olb file in the project window and select Save As...

    Name the file psu symbols and place it in the libraries directory w that you created earlier. Your

    project window will now look like the figure below. You are now ready to add parts to your

    library.

    Fig 6.7 Window of library creation

    CREATING SCHEMATIC SYMBOLS

    To add a new part to your library, right-click the library file and select New Part. This

    will bring up a dialog box for New Part Properties. Make the entries in the dialog box so that it

    looks like the following.

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 41

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    Fig 6.8 window of new part creation

    Click OK to bring up the workspace for part creation. It should look like the picture

    below. Tools for working with the part are located on the toolbar on the right-hand side of the

    screen

    SCHEMATIC ENTRY

    You are now ready to start placing the electrical components for your design. The circuit

    that we will be drawing is shown in the beginning of this tutorial in the hand drawn form. We

    will need all the parts that are included in that circuit diagram. Open up the schematic page and

    click the Place Part tool on the toolbar on the right side of the screen.

    Here you will have to add those libraries, which contain your desired parts. As a novice

    designer, you might experience difficulties in finding a particular part because there are so many

    libraries and thousands of parts in each of them. But you can always do away with this difficulty

    if you carefully read the library name. The Part Search feature will certainly be very helpful in

    these circumstances.

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 42

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    2. PREPARING FOR LAYOUT

    CREATING FOOTPRINT LIBRARIES

    A footprint is the representation of the physical area that a component occupies on a

    PCB. Your next step will be to design footprints for all the parts in your circuit. Like Capture,

    Layout has also several built- in libraries of footprints. But unlike Capture libraries, I suggest you

    not to use the Layout libraries as an ovice designer. The reason is that the names of Layout

    libraries and the footprints contained within them are very cumbersome and confusing to

    understand. There is also no option of searching these libraries.

    It is better that you yourself design footprints of your components. This will ensure you

    that the footprints you are using are correct. Once you will get enough knowledge and

    experience about the packaging of electronic components, so that you will be able to locate the

    desired footprint in these libraries then you can, of course, use them.

    PCBs consist of a number of electrical and non-electrical layers. 2 to 4 electrical layers

    are fairly common for simple circuit boards. 8 to 20 layers can often be seen in many industry

    applications. In our lab, we have the facility to fabricate two layers boards i.e. double sided

    PCBs. The diagram below shows the layer stack up for a 2- layer board like the one you are

    making now. The layers are defined below

    Top and Bottom Layers are sheets of copper and used for routing nets between parts.

    Solder Mask is a coating on the top and bottom of the PCB to prevent solder from flowing

    freely on the board. It also protects copper tracks from oxidation and provides insulation. This is

    what gives most circuit boards their green or brown color.

    Substrate is made up of Bakelite, fiberglass or epoxy resin dielectric material. It separates the

    two layers and also gives stiffness to the board.

    Drill Layer This layer defines finished drill sizes and drill locations for parts that have pins

    that go through the board.

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 43

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    Start Orcad Layout. Layout has a separate tool for working with footprint libraries. To

    start this tool, select Tools Library Manager. In the new window that opens, you will notice that

    there are already several libraries available for use. These are the built- in libraries. For designing

    a footprint, you can use either of the two approaches:

    1. Use the mechanical information contained in the component datasheet.

    2. Manually measure the size of the component, distance between its pins and their dia meter.

    This is only possible if you have the component at your disposal at this step .Footprints

    are composed of one or more pad stacks. These pad stacks define how a pin on a part looks on

    each of the electrical and non-electrical layers. Each of your footprints will need at least one pad

    stack defined. Lets take a look at a pad stack definition for an existing part. In the Library

    Manager, select the library DIP100T and highlight the first part DIP.100/14/W.300/L.700. You

    will see the part footprint in the Library Manager.

    Fig 6.9 Window of layout

    We will now set each layer individually. You can also select multiple layers at a time by

    holding down the CTRL key when you click the layer name. First lets define the size of the drill

    used for this part. The datasheet tells us that the pin dia can vary from 0.027 to 0.037 in. So we

    should use a drill of dia greater than 37 mils.

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 44

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    Let us use a drill of 40 mils. Select the layers DRLDWG and DRILL. When you have

    multiple layers selected, you will need to right click and choose Properties or press CTRL+E to

    bring up the Edit Pad stack dialog. Choose the Round radio button and give the width and height

    a value of 40. Click OK when done.

    The changes you made should now be reflected in the spreadsheet. Now we will define

    the amount of metal on the routing layers beyond the size of the drill. This is called the annular

    ring. Each board shop will have requirements on the minimum annular ring size based on the

    drill diameter. In most cases 20 mils is a safe bet. Select the TOP, BOTTOM layers and bring up

    the Edit Pad stack dialog. Make the pads round and put the value of 60 (40+20 mils) in the

    height and width fields. The last thing we need to define is the solder mask. This is usually

    defined as slightly larger (about 5 mils) that then annular rings on the top and bottom layers.

    Select SMTOP and SMBOT and make them round pads with height and width of 65 (60+5

    mils).

    Fig 6.10 Window of pad stacks

    CREATING THE NETLIST

    To export your design to Layout, you must first create a netlist. A netlist is a file that has

    all the parts, footprints and nets for your design in a format that can be read by the layout

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 45

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    program. To start net list generation, highlight your dsn file and select Tools Create Netlist to

    bring up the Create

    Fig 6.11 Window of creation of netlist

    CREATING A BOARD TEMPLATE FILE

    Fig 6.12 Window of system settings

    You are almost ready to export your schematic design to Layout. Before doing this, we

    must create a board template file because you will be asked for it when you will be exporting

    your design to Layout. This file defines some default properties for the board that will be used

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 46

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    throughout layout. To create a template, start Layout and select File New. When you see the

    dialog, press Cancel. You should now see a blank workspace. You can use the same shortcut

    keys that you used in Capture to zoom and center the design (I, O, and C).

    Fig 6.13 Board template file

    3. STARTING LAYOUT

    CREATING A NEW BOARD

    Now we have everything that we need to import our design into Layout so we can start

    moving on to the third phase of our project. Start Orcad Layout or Layout Plus but not Layout

    Engineers Edition and select FileNew. You will first be prompted for the template file you

    created. It should be located in your libraries directory. Second, you will be asked for your

    netlist. This should be located in your schematic directory. Third, you will be asked to give your

    board file a name. Name this file psu and place it in the board directory. If all the footprint names

    in your design match those in your library, then you should get no errors and you will see a

    screen in layout like the one below.

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 47

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    Fig 6.14 Window of layout with no errors

    GETTING AROUND & PLACING PARTS

    All of your parts from schematics should be line up on the left side of the board. Learn a

    few things about the Layout environment before you start placing these parts. First turn off DRC

    (Design Rule Check) by clicking the button to vanish the dotted rectangle. We will use it later

    when routing, but not now. Again you can use the same shortcut keys that you used in Capture to

    zoom in, out and center the design (I, O, and C) and SHIFT+Hometo zoom all. You will

    also notice that the workspace often gets too messy while working in Layout, so you will need to

    refresh the screen very often. Use the Refresh All button or press Home key. Also on the toolbar,

    there is a drop-down box of layers. You can select any layer and turn it visible or invisible. To

    toggle a layer visible/ invisible, select the layer and hit the (minus) key on your keyboard.

    You will also notice that there are a bunch of lines connecting your parts. These are

    connections that are still un routed, and this is usually referred to as the Ratsnest. When placing

    parts, it is sometimes useful to turn this off. So click the View Spreadsheet icon and select Nets.

    Remember when you used this spreadsheet before? It had just one net called DEFAULT. Now,

    every net in your design should appear in this spreadsheet. This spreadsheet can be a useful way

    to see if you have misnamed nets in your schematics. Highlight every net by clicking the cell

    labeled Net Name. Right-click and choose Properties. Uncheck the Routing Enabled box and

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 48

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    click OK. The ratsnest should have disappeared. You are now ready to place parts on your

    design. To get into parts placement mode, make sure that the Component Tool is selected.

    In addition to placing the components that are in your schematics, you can also place

    non-electrical components right in Layout. You will do that now to place some mounting holes

    on your board. While using the Component Tool, right-click and select New to bring up the Add

    Component dialog box.

    Fig 6.15 Window of component editing

    Give this component a reference designator of mh1. then click the footprint button and

    select the board mounting hole footprint from psu _footprints library. check the non-electric

    checkbox so that it becomes checked with a dark tick and uncheck the route enabled check box

    since this is a non-electrical part. click ok when finished. the part will now be attached to your

    cursor and you can place it on the board. place it at the edge of the board in the lower left corner.

    AUTOROUTING

    To let the Layout automatically route the board for you, select Auto Autoroute Board.

    In a second or two, Layout will route the whole board. Click OK at the message. Then press

    SHIFT+Home and your board should look like this.

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 49

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    Fig 6.16 Window of Auto routing

    6.3.4 VISUAL BASIC

    Visual Basic is a third-generation event-driven programming language and integrated

    development environment (IDE) from Microsoft for its COM programming model first released

    in 1991. Microsoft intends Visual Basic to be relatively easy to learn and use. Visual Basic was

    derived from BASIC and enables the rapid application development (RAD) of graphical user

    interface (GUI) applications, access to databases using Data Access Objects, Remote Data

    Objects, or ActiveX Data Objects, and creation of ActiveX controls and objects. A programmer

    can create an application using the components provided by the Visual Basic program itself.

    Programs written in Visual Basic can also use the Windows API, but doing so requires external

    function declarations. Though the program has received criticism for its perceived faults, version

    3 of Visual Basic was a commercial success, and many companies offered third party controls

    greatly extending its functionality.

    Like the BASIC programming language, Visual Basic was designed to accommodate

    beginner programmers. Programmers can not only create simple GUI applications, but to also

    develop complex applications. Programming in VB is a combination of visually arranging

    components or controls on a form, specifying attributes and actions for those components, and

    writing additional lines of code for more functionality. Since VB defines default attributes and

    actions for the components, a programmer can develop a simple program without writing much

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 50

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    code. Programs built with earlier versions suffered performance problems, but faster computers

    and native code compilation has made this less of an issue. Though VB programs can be

    compiled into native code executablefrom version 5 on, they still require the presence of around

    1 MB of runtime libraries. Runtime libraries are included by default in Windows 2000 and later.

    Earlier versions of Windows (95/98/NT), require that the runtime libraries be distributed with the

    executable.

    Forms are created using drag-and-drop techniques. A tool is used to place controls (e.g.,

    text boxes, buttons, etc.) on the form (window). Controls have attributes and event handlers

    associated with them. Default values are provided when the control is created, but may be

    changed by the programmer. Many attribute values can be modified during run time based on

    user actions or changes in the environment, providing a dynamic application. For example, code

    can be inserted into the form resize event handler to reposition a control so that it remains

    centered on the form, expands to fill up the form, etc. By inserting code into the event handler

    for a keypress in a text box, the program can automatically translate the case of the text being

    entered, or even prevent certain characters from being inserted.

    Fig 6.17 An empty form in VB

    Visual Basic can create executable (EXE files), ActiveX controls, or DLL files, but is

    primarily used to develop Windows applications and to interface database systems. Dialog boxes

    with less functionality can be used to provide pop-up capabilities. Controls provide the basic

    functionality of the application, while programmers can insert additional logic within the

    appropriate event handlers. For example, a drop-down combination box automatically displays a

    list. When the user selects an element, an event handler is called that executes code that the

    programmer created to perform the action for that list item. Alternatively, a Visual Basic

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 51

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    component can have no user interface, and instead provide ActiveX objects to other programs

    via Component Object Model (COM). This allows for server-side processing or an add- in

    module. The runtime recovers unused memory using reference counting, which depends on

    variables passing out of scope or being set to nothing, avoiding the problem of memory leaks

    common to other languages. There is a large library of utility objects, and the language provides

    basic object oriented support. Unlike many other programming languages, Visual Basic is

    generally not case sensitivethough it transforms keywords into a standard case configuration

    and forces the case of variable names to conform to the case of the entry in the symbol table.

    String comparisons are case sensitive by default.

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 52

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    CHAPTER 7

    RESULT

    The simulations below show the movement of the robot.

    Fig 7.1 Forward

    Fig 7.2 Backward

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 53

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    Fig 7.3 Right

    Fig 7.4 Left

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 54

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    The PIR sensor senses temperature ranging from 35-40 degrees Celsius. Thus any

    presence of intruders may be human or animal are detected.

    The sensed signal is then passed to the microprocessor as an external interrupt. Whenever

    an interrupt is sensed, the robot stops its motion and the signal HUMAN DETECTED is

    transmitted to PC using Bluetooth. The wireless camera automatically turns to the direction

    where the signal is sensed simultaneously.

    The simulations are given below.

    Fig 7.5 Simulation output when PIR sensor detects human presence at right side

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 55

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    Fig 7.6 Simulation output when PIR sensor detects human presence at left side

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 56

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    CHAPTER 8

    CONCLUSION

    The system presented here is for security operations in the protected area with wireless

    secured communication. Security system available today is just a video camera or a burglar

    alarm system. This system used a wireless communication system along with a wireless camera.

    Thus this system becomes much more effective than the present system. The main attractive

    feature of this system is that it is cost effective and reduces the human efforts take n in protected

    area.

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 57

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    CHAPTER 9

    FUTURE SCOPE

    The application of this proposed system can be extended further to be used in military

    purposes to find human intruders. This system can be used in those areas which are destroyed by

    natural or manmade calamities such as earth quakes, fire hazards etc. Human presence under

    destroyed building blocks can be detected where it is difficult for a man to reach and find the

    affected people.

    Using additional sensors such as gas sensors, metal detectors this system can be used for

    gas leakage detection, bomb detection etc.

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 58

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    REFERENCES

    [1] Microprocessors &MicrocontrollersD.A.Godse A.P.Godse-2008

    [2] Antenna and Wave Propagation R. L Yadava 2011

    [3] ZigBee Wireless Networks and Transceivers ShahinFarahani 2011

    [4] A versatile gas/vision tracking robot for security system applications Cheng-Ta

    ChiangControl, Systems & Industrial Informatics (ICCSII), 2012

    [5] Distributed computing in sensor systems V.K. Prasannakumar, ieee

    [6] Electronic security Systems Philip Walker -1998

    [7] Networking and Internetworking with Microcontrollers Fred Eady-2004

    [8] Programming and Circuits for RS232 Jan Axelson-1998

    [9] Embedded Systems Circuits and Programming Julio Sanchez, Maria.P.Canton-2012

    [10] Embedded Systems with PIC microcontrollers Tim Wilmshurst-2009

    [11] MikroC PIC 16F877 HikmetSahin K Serkan Dedeoglu-2012

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 59

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    APPENDIX

    A1.7805 DATA SHEET

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 60

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 61

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    A2.PIC MICROCONTROLLER DATASHEET

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 62

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 63

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 64

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    A3. PIR SENSOR DATASHEET

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 65

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 66

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    A4. MICROCONTROLLER PROGRAM

    #include

    #include

    #define _XTAL_FREQ 4000000

    void transmit(char i);

    void string(char *s);

    int i;

    void forward()

    {

    RD0=1;

    RD1=0;

    RD2=1;

    RD3=0;

    }

    void backward()

    {

    RD0=0;

    RD1=1;

    RD2=0;

    RD3=1;

    }

    void left()

    {

    RD0=0;

    RD1=0;

    RD2=1;

    RD3=0;

    }

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 67

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    void right()

    {

    RD0=1;

    RD1=0;

    RD2=0;

    RD3=0;

    }

    void stop()

    {

    RD0=0;

    RD1=0;

    RD2=0;

    RD3=0;

    }

    void main()

    {

    GIE=1;

    PEIE=1;

    INTE=1;

    RCIE=1;

    TRISB0=1;

    TRISB1=1;

    TRISD=0;

    PORTD=0X00;

    CREN=1;

    TXEN=1;

    BRGH=1;

    SPBRG=25;

    SPEN=1;

    SYNC=0;

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 68

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    while(1)

    {

    i=0;

    if(RB1==1)

    {

    string("HUMAN DETECTED!!!");

    stop();

    RD4=1;

    RD5=0;

    __delay_ms(600);

    RD4=0;

    RD5=0;

    while(i!=1);

    RD4=0;

    RD5=1;

    __delay_ms(600);

    RD4=0;

    RD5=0;

    while(RB1==1);

    }

    }

    }

    void static interrupt isr()

    {

    if(INTF==1)

    {

    RB0=1;

    string("HUMAN DETECTED!!!");

    INTF=0;

    stop();

    RD4=0;

    RD5=1;

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 69

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    __delay_ms(600);

    RD4=0;

    RD5=0;

    while(RCIF!=1);

    RD4=1;

    RD5=0;

    __delay_ms(600);

    RD4=0;

    RD5=0;

    }

    if(RCIF==1)

    {

    i=1;

    if(RCREG=='F'||RCREG=='f')

    forward();

    else if(RCREG=='B'||RCREG=='b')

    backward();

    else if(RCREG=='L'||RCREG=='l')

    left();

    else if(RCREG=='R'||RCREG=='r')

    right();

    else

    stop();

    }

    }

    void transmit(char i)

    {

    TXREG=i;

    while(TRMT==0);

    }

    void string(char *s)

    {

  • SMART TANKER ROBOT FOR SECURITY OPERATIONS IN THE

    PROTECTED AREA WITH WIRELESS SECURED COMMUNICATION 70

    DEPT OF ECE JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY

    while(*s)

    transmit(*s++);

    }