You are on page 1of 86

WIRELESS OPERATED WARFIELD LAND ROVER

CHAPTER 1

PRAGATI ENGINEERING COLLEGE

WIRELESS OPERATED WARFIELD LAND ROVER

INTRODUCTION
1.1 WHAT IS A ROBOT?
A robot is a mechanical or virtual, artificial agent. A robot is usually an electro-mechanical system, which, by its appearance or movement, conveys a sense that it has intent or agency of its own. The word robot can refer to both physical robots and virtual software agents, but the latter are often referred to as bots. A typical robot must have several, but not all of the following properties: Is not natural / has been artificially created. Can sense its environment. Can manipulate things in its environment. Has some degree of intelligence or ability to make choices based on the environment or automatic control / preprogrammed sequence. Is programmable. Can make with one or more axes of rotation or translation. Appears to have intent or agency. The appearance of agency is important when people are considering whether to call a machine a robot. In general, the more a machine has the appearance of agency, the more it is considered a robot. For robotic engineers, the physical appearance of a machine is less important than the way its actions are controlled. The more the control system seems to have agency of its own, the more likely the machine is to be called a robot. An important feature of agency is the ability to make choice. So the ore a machine could feasible choose to do something different, the more agencies it has. The simple appearance of agency is not sufficient to be called a robot. A robot must do something, whether it is useful work or not. So, for example, a rubber dog chew, shaped like Asimo, would not be considered a robot.

PRAGATI ENGINEERING COLLEGE

WIRELESS OPERATED WARFIELD LAND ROVER

DEFINITIONS OF ROBOT:
International standard ISO 8373 defines a robot as: An automatically controlled, reprogrammable, multipurpose, manipulator programmable in three or more axes, which may be either, fixed in place or mobile for use in industrial automation applications. The Cambridge Online Dictionary defines robot as: A machine used to perform jobs automatically, which is controlled by a computer. The Japanese Industrial Robot Association, (JIRA) does not provide a general definition. It distinguishes robot as per their performance and structure as follows: 1. Manipulator Robot 2. Fixed sequence Robot 3. Variable sequence Robot 4. Play back Robot 5. Numerical control Robot 6. Intelligent Robot The Robot Institute of America (RIA) defines a robot as: A reprogrammable multifunctional manipulator designed to move and manipulate material, parts, tools or specialized devices through variable programmed motions for the performance of a variety of specific tasks.

1.2 REASONS FOR USING A ROBOT:


Over a period of years, need of a robot increased and technology progressed with lots of research efforts taking place worldwide making robot as on date as part and parcel of human, assisting them in several ways. The growing areas of robots utilization are discussed here in a systematized way.

Hazards and Discomforts:


The first industrial application of robot took place in the year 1961, which was used for loading and unloading a die casting machine, a particularly unpleasant task for human operator. Infact, advent of robot was necessitated due
PRAGATI ENGINEERING COLLEGE

WIRELESS OPERATED WARFIELD LAND ROVER

to mans desire to free himself from high degree of hazardous and discomfort jobs, especially in the areas of welding, painting, foundry operations etc. In the earlier applications, this was the prime consideration for using a robot.

Increased productivity:
Third consideration for using industrial robot is its capability for providing increased productivity. This is due to robots ability to work almost continuously without breaks in comparision with human operartor. Robot machine can work with no tiresomeness, doing job repetitively with no grumbling. Human workers in contrast may not be so productive as well as demanding more than due to them.

Better quality:
The fourth consideration in using a robot lies in its suitability in handling repetitive jobs. Robots can be used to handle this type of tasks with high degree of consistency, which in turn leads to improved product quality. This improvement in quality justifies robots application in areas like spray painting, welding, inspection etc. The above four benefits, namely relieving human operator from hazardous tasks, reduced costs, improved productivity and better quality, primarily justify the reasons for using robots in industry. The way we listen, research for a need based robot is being carried out producing robots that help human in multiple ways.

1.3 CLASSIFICATION OF ROBOTS


In view of the definitions given, robots may be classified based on generations, manipulators geometry and mobility.

1.3.1 Classification Based On Generations:


1. The first generation of robots mainly comprises of Manipulator, Fixed sequence and Variable sequence types
PRAGATI ENGINEERING COLLEGE

WIRELESS OPERATED WARFIELD LAND ROVER

In manipulator type, the operator controls the transport arm directly with or without power assistance depending on application. In Fixed sequence type, a manipulator does the pre-set tasks repetitively as per predetermined sequence, which cannot be altered. In contrast, a Variable sequence type allows the sequence to be changed while doing the repetitive job. Thus, the robots of the first generation are not capable of adapting to a continuously changing environment. 2. The second generation of robots comprises of Playback and Numerical control types. These are being provided with sensory inputs of rudimentary nature such as vision and touch. These features enable them to respond to the changing environment. 3. The third generation of robot is of intelligent type. In this generation of robots, lot of refinements have been made in sensory devices, like visual, acoustic and others implementing true adaptive control. This has resulted in increased efficiency and precision.

1.3.2 Classification Based On Manipulator:


The robots have been also classified based on the construction of manipulator arm. They are: 1. Cartesian type 2. Cylindrical type 3. Spherical type 4. Anthropomorphic type In Cartesian type of robots, the working head is manipulated along three perpendicular tracks so as to achieve the required height, width and depth. The base of manipulating robot may be positioned horizontally on the floor, or may be suspended from a gantry or a travelling bridge. In Cylindrical type of robots, the movements of the working head takes place in a cylindrical volume for reaching any required height and azimuth. This can be achieved by mounting an extendable arm on a central side, which moves up and down and swivels on its base. This gives two longitudinal movements with perpendicular axis and on rotational movement.

PRAGATI ENGINEERING COLLEGE

WIRELESS OPERATED WARFIELD LAND ROVER

In Spherical type of robots, the movement of working head takes place in spherical range according to spherical coordinates. The manipulator is provided with an extendable arm mounted on a central pivot, thereby allowing rotations on a non-parallel axes. In Anthropomorphic type of robots, the philosophy is based on the human morphology, wherein the mechanical arm can be bent at an elbow and swivel at ashoulder.

1.3.3 Classification Based On Mobility:


Yet another classification of robots can be based on the mobility of the overall structure of the robot. While a universal robot is able to undertake almost any task, a real robot can be performing a specific range of tasks only as specified. In this context, two kinds of robots may be highlighted, namely, Fixed robot and Mobile robot. A Fixed robot, as the name signifies, has a defined workspace and any manipulation task on a work-piece is done within the defined workspace. This type of robot performs the following types of tasks: Handling moving objects Transformation of an object Dismantling Fixing Measuring A Mobile robot on the other hand has the ability to move to the workspace, exceeding the dimensions set for the robot itself. Thus, it will be able to do other tasks as well. Additionally, the mobile robot can do the following tasks: Conveying Exploration Gathering Tele-operation This categorization gives us a feel of how complex is a real working robot in relation to the simple robots.

PRAGATI ENGINEERING COLLEGE

WIRELESS OPERATED WARFIELD LAND ROVER

CHAPTER 2

PRAGATI ENGINEERING COLLEGE

WIRELESS OPERATED WARFIELD LAND ROVER

2. EMBEDED SYSTEMS
Embedded systems are electronic devices that incorporate microprocessors with in their implementations. The main purposes of the microprocessors are to simplify the system design and provide flexibility. Having a microprocessor in the device helps in removing the bugs, making modifications, or adding new features are only matter of rewriting the software that controls the device. Or in other words embedded computer systems are electronic systems that include a microprocessor to perform a specific dedicated application. The computer is hidden inside these products. Embedded systems are ubiquitous. Every week millions of tiny computer chips come pouring out of factories finding their way into our everyday products. Embedded systems are self-contained programs that are embedded within a piece of hardware. Whereas a regular computer has many different applications and software that can be applied to various tasks, embedded systems are usually set to a specific task that cannot be altered without physically manipulating the circuitry. Another way to think of an embedded system is as a computer system that is created with optimal efficiency, thereby allowing it to complete specific functions as quickly as possible. Embedded systems designers usually have a significant grasp of hardware technologies. They use specific programming languages and software to develop embedded systems and manipulate the equipment. When searching online, companies offer embedded systems tools for use by engineers and businesses. Embedded systems technologies are usually fairly expensive due to the necessary development time and built in efficiencies, but they are highly valued in specific industries. Smaller businesses may wish to hire a consultant to determine what sort of embedded systems will add value to their organization.

PRAGATI ENGINEERING COLLEGE

WIRELESS OPERATED WARFIELD LAND ROVER

2.1 CHARACTERISTICS
Two major areas of differences are cost and power consumption. Since many embedded systems are produced in tens of thousands to millions of units range, reducing cost is a major concern. Embedded systems often use a slow processor and small memory size to minimize costs. The slowness is not just clock speed. The whole architecture of computer is often intentionally simplified to lower costs. For examples, embedded systems often use peripherals controlled by synchronous serial interfaces, which are ten to hundreds of times slower often run with real time constrains with limited hardware resources : often there is no disk drive, operating system, keyboard or screen may be used instead of a PCs keyboard and screen.

2.2 EMBEDDED SYSTEMS CONSTRAINTS


An embedded system is software designed to keep in view three constraints: Available system memory Available processor speed The need to limit the power dissipation

2.3 WHAT MAKES EMBEDDED SYSTEMS DIFFERENT


Real-time operation Size Cost Time Reliability Safety Energy Security

PRAGATI ENGINEERING COLLEGE

WIRELESS OPERATED WARFIELD LAND ROVER

2.4 CLASSIFICATIONS OF EMBEDDED SYSTEM


1. Small Scale Embedded System 2. Medium Scale Embedded System 3. Sophisticated Embedded System

SMALL SCALE EMBEDDED SYSTEM


Single 8 bit or 16bit Microcontroller. Little hardware and software complexity. They May even be battery operated. Usually C is used for developing this system. The need to limit power dissipation when system is running continuously. Programming tools: Editor, Assembler and Cross Assembler

Fig:2.4.1

MEDIUM SCALE EMBEDDED SYSTEM


Single or few 16 or 32 bit microcontrollers or Digital Signal Processors (DSP) or Reduced Instructions Set Computers (RISC). Both hardware and software complexity. Programming tools: RTOS, Source code Engineering Tool, Simulator, Debugger and Integrated Development Environment (IDE).

Fig:2.4.2
PRAGATI ENGINEERING COLLEGE

10

WIRELESS OPERATED WARFIELD LAND ROVER

SOPHISTICATED EMBEDDED SYSTEM


Enormous hardware and software complexity Which may need scalable processor or configurable processor and programming logic arrays Constrained by the processing speed available in their hardware units. Programming Tools: For these systems may not be readily available at a reasonable cost or may not be available at all. A compiler or retarget able compiler might have to be developed for this.

Fig:2.4.3

PRAGATI ENGINEERING COLLEGE

11

WIRELESS OPERATED WARFIELD LAND ROVER

CHAPTER 3

PRAGATI ENGINEERING COLLEGE

12

WIRELESS OPERATED WARFIELD LAND ROVER

3. MICROCONTROLLER
Microcontroller as the name suggests are small controllers. They are like single hip computers that are often embedded into other systems to functions as processing/controlling unit. For example the remote control you are using probably has micro controllers inside that do micro wave ovens, toys etc., where automation is needed. Micro controllers are useful to the extent that they communicate with other devices, such as sensors, motors, switches, keypads, displays, memory and even other microcontrollers. Many interface methods have been developed over the years to solve the complex problem of balancing circuit design criteria such as features, cost, size, weight, power consumption, reliability, availability, manufacturability. Many microcontroller designs typically mix multiple interfacing methods. In a very simplistic form, a micro controller system can be viewed as a system that reads from (monitors) inputs, performs processing and writes to (controls) outputs. Embedded system means the processor is embedded into the required application. An embedded product uses a microprocessor or microcontroller to do one task only. In an embedded system, there is only application software that is typically burned into ROM. Example: printer, keyboard, video-game player. Microprocessor -A single chip that contains the CPU or most of the computer Microcontrollers - A single chip that controls other devices.

Microcontroller differs from a microprocessor in many ways. First and the most important is its functionality. In order for a microprocessor to be used, other components such as memory, or components for receiving and sending data must be added to it. In short that means the microprocessor is the main heart of the computer. On the other hand, microcontroller is designed to be all of that in one. No other external components are needed for its application because all necessary peripherals are already built into it. Thus we save time and space needed to construct devices.

PRAGATI ENGINEERING COLLEGE

13

WIRELESS OPERATED WARFIELD LAND ROVER

3.1 MICROPROCESSOR VS MICROCONTROLLER MICROPROCESSOR


CPU is stand-alone, RAM, ROM, I/O, timer are separate. Designer can decide on the amount of RAM, ROM and I/O ports. Expensive Versatility general-purpose

MICROCONTROLLER
CPU, RAM, ROM, I/O and timer are all on a single chip. Fix amount of on chip ROM,RAM,I/O ports For applications in which cost, power and space are critical Single purpose.

3.2MICRO CONTROLLER 89C51 3.2.1 INTRODUCTION


A Micro controller consists of a powerful CPU tightly coupled with memory, various I/O interfaces such as serial port, parallel port timer or counter, interrupt controller, data acquisition interfaces-Analog to Digital converter, Digital to Analog converter, integrated on to a single silicon chip. If a system is developed with a microprocessor, the designer has to go for external memory such as RAM, ROM, EPROM and peripherals. But controller is provided all these facilities on a single chip. Development of a Micro controller reduces PCB size and cost of design. One of the major differences between a Microprocessor and a Micro controller is that a controller often deals with bits not bytes as in the real world application. Intel has introduced a family of Micro controllers called the MCS-51.

3.2.2 THE MAJOR FEATURES:


Compatible with MCS-51 products 4k Bytes of in-system Reprogrammable flash memory Fully static operation: 0HZ to 24MHZ 14

PRAGATI ENGINEERING COLLEGE

WIRELESS OPERATED WARFIELD LAND ROVER

Three level programmable clock 128 * 8 bit timer/counters Six interrupt sources Programmable serial channel Low power idle power-down modes

AT89C51 is 8-bit micro controller, which has 4 KB on chip flash memory, which is just sufficient for our application. The on-chip Flash ROM allows the program memory to be reprogrammed in system or by conventional non-volatile memory Programmer. Moreover ATMEL is the leader in flash technology in todays market place and hence using AT 89C51 is the optimal solution.

3.2.3 AT89C51 MICROCONTROLLER ARCHITECTURE


The 89C51 architecture consists of these specific features: Eight bit CPU with registers A (the accumulator) and B Sixteen-bit program counter (PC) and data pointer (DPTR) Eight- bit stack pointer (PSW) Eight-bit stack pointer (Sp) Internal ROM or EPROM (8751) of 0(8031) to 4K (89C51) Internal RAM of 128 bytes: Thirty two input/output pins arranged as four 8-bit ports:p0-p3 Two 16-bit timer/counters: T0 and T1 Full duplex serial data receiver/transmitter: SBUF Control registers: TCON, TMOD, SCON, PCON, IP, and IE Two external and three internal interrupts sources. Oscillator and clock circuits.

PRAGATI ENGINEERING COLLEGE

15

WIRELESS OPERATED WARFIELD LAND ROVER

Fig 3.1: Architecture of micro controller

3.2.4 TYPES OF MEMORY:


The 89C51 have three general types of memory. They are on-chip memory, external Code memory and external Ram. On-Chip memory refers to physically existing memory on the micro controller itself. External code memory is the code memory that resides off chip. This is often in the form of an external EPROM. External RAM is the Ram that resides off chip. This often is in the form of standard static RAM or flash RAM.

a) Code memory
Code memory is the memory that holds the actual 89C51 programs that is to be run. This memory is limited to 64K. Code memory may be found on-chip or off-chip. It is possible to have 4K of code memory on-chip and 60K off chip memory simultaneously. If only off-chip memory is available then there can be 64K of off chip ROM. This is controlled by pin provided as EA.

PRAGATI ENGINEERING COLLEGE

16

WIRELESS OPERATED WARFIELD LAND ROVER

b) Internal RAM
The 89C51 have a bank of 128 of internal RAM. The internal RAM is found on-chip. So it is the fastest Ram available. And also it is most flexible in terms of reading and writing. Internal Ram is volatile, so when 89C51 is reset, this memory is cleared. 128 bytes of internal memory are subdivided. The first 32 bytes are divided into 4 register banks. Each bank contains 8 registers. Internal RAM also contains 128 bits, which are addressed from 20h to 2Fh. These bits are bit addressed i.e. each individual bit of a byte can be addressed by the user. They are numbered 00h to 7Fh. The user may make use of these variables with commands such as SETB and CLR.

Flash memory is a nonvolatile memory using NOR technology, which allows the user to electrically program and erase information. Flash memory is used in digital cellular phones, digital cameras, LAN switches, PC Cards for notebook computers, digital set-up boxes, embedded controllers, and other devices.

Fig 3.2: - Pin diagram of AT89C51

PRAGATI ENGINEERING COLLEGE

17

WIRELESS OPERATED WARFIELD LAND ROVER

3.2.5 PIN DESCRIPTION:


VCC: Supply voltage. GND: Ground.

Port 0:
Port 0 is an 8-bit open-drain bi-directional I/O port. As an output port, each pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high impedance inputs. Port 0 may also be configured to be the multiplexed low order address/data bus during accesses to external program and data memory. In this mode P0 has internal pull-ups. Port 0 also receives the code bytes during Flash programming, and outputs the code bytes during program verification. External pull-ups are required during program verification.

Port 1:
Port 1 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 1 output buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups. Port 1 also receives the low-order address bytes during Flash programming and verification.

Port 2:
Port 2 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 2 output buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups.

Port 3:
Port 3 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 3 output buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will source current (IIL) because of the pull-ups.

PRAGATI ENGINEERING COLLEGE

18

WIRELESS OPERATED WARFIELD LAND ROVER

Port 3 also serves the functions of various special features of the AT89C51 as listed below:

Tab 1 Port pins and their alternate functions

RST:
Reset input. A high on this pin for two machine cycles while the oscillator is running resets the device.

ALE/PROG:
Address Latch Enable output pulse for latching the low byte of the address during accesses to external memory. This pin is also the program pulse input (PROG) during Flash programming. In normal operation ALE is emitted at a constant rate of 1/6the oscillator frequency, and may be used for external timing or clocking purposes. Note, however, that one ALE pulse is skipped during each access to external Data Memory. If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit has no effect if the micro controller is in external execution mode.

PSEN:
Program Store Enable is the read strobe to external program memory. When the AT89C51 is executing code from external program memory, PSEN is activated twice each machine cycle, except that two PSEN activations are skipped during each access to external data memory.

PRAGATI ENGINEERING COLLEGE

19

WIRELESS OPERATED WARFIELD LAND ROVER

EA/VPP:
External Access Enable. EA must be strapped to GND in order to enable the device to fetch code from external program memory locations starting at 0000H up to FFFFH. Note, however, that if lock bit 1 is programmed, EA will be internally latched on reset. EA should be strapped to VCC for internal program executions. This pin also receives the 12-volt programming enable voltage (VPP) during Flash programming, for parts that require 12-volt VPP.

XTAL1:
Input to the inverting oscillator amplifier and input to the internal clock operating circuit.

XTAL2:
Output from the inverting oscillator amplifier

OSCILLATOR CHARACTERISTICS:
XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier, which can be configured for use as an on-chip oscillator, as shown in Figs 6.1 Either a quartz crystal or ceramic resonator may be used. To drive the device from an external clock source, XTAL2 should be left unconnected while XTAL1 is driven as shown in Figure 6.2. There are no requirements on the duty cycle of the external clock signal, since the input to the internal clocking circuitry is through a divide-by-two flip-flop, but minimum and maximum voltage high and low time specifications must be observed.

Fig 3.3 Oscillator Connections

Fig 3.4 External clock drive Configuration

PRAGATI ENGINEERING COLLEGE

20

WIRELESS OPERATED WARFIELD LAND ROVER

3.2.6 REGISTERS:
In the CPU, registers are used to store information temporarily. data to be fetched. The vast majority of 8051 registers are 8bit registers. That . information could be a byte of data to be processed, or an address pointing to the

D7

D6

D5

D4

D3

D2

D1

D0

The most widely used registers of the 8051 are A (accumulator), B, R0, R1, R2, R3, R4, R5, R6, R7, DPTR (data pointer), and PC (program counter). All of the above registers are 8-bits, except DPTR and the program counter. accumulator, register A, is used for all arithmetic and logic instructions. The

SFRs (Special Function Registers):


In the 8051, registers A, B, PSW and DPTR are part of the group of registers commonly referred to as SFR (special function registers). The SFR can be accessed by the names (which is much easier) or by their addresses. For example, register A has address E0h, and register B has been ignited the address F0H, as shown in table. The following two points should note about the SFR addresses. 1.The Special function registers have addresses between 80H and FFH. These addresses are above 80H, since the addresses 00 to 7FH are addresses of RAM memory inside the 8051. 2.Not all the address space of 80H to FFH is used by the SFR. The unused locations 80H to FFH are reserved and must not be used by the 8051 programmer. Symbol ACC B PSW SP Name Accumulator B register Program status word Stack pointer Address 0E0H 0F0H 0D0H 81H

PRAGATI ENGINEERING COLLEGE

21

WIRELESS OPERATED WARFIELD LAND ROVER

DPTR DPL DPH P0 P1 P2 P3 IP IE TMOD TCON T2CON T2MOD TH0 TL0 TH1 TL1 TH2 TL2 RCAP2H RCAP2L SCON SBUF PCON

Data pointer 2 bytes Low byte High byte Port0 Port1 Port2 Port3 Interrupt priority control Interrupt enable control Timer/counter mode control Timer/counter control Timer/counter 2 control Timer/counter mode2 control Timer/counter 0high byte Timer/counter 0 low byte Timer/counter 1 high byte Timer/counter 1 low byte Timer/counter 2 high byte Timer/counter 2 low byte T/C 2 capture register high byte T/C 2 capture register low byte Serial control Serial data buffer Power control 82H 83H 80H 90H 0A0H 0B0H 0B8H 0A8H 89H 88H 0C8H 0C9H 8CH 8AH 8DH 8BH 0CDH 0CCH 0CBH 0CAH 98H 99H 87H

Table: 2 8051 Special function register Address


PRAGATI ENGINEERING COLLEGE

22

WIRELESS OPERATED WARFIELD LAND ROVER

ARegister(Accumulator):

This is a general-purpose register, which serves for storing intermediate results during operating. A number (an operand) should be added to the accumulator prior to execute an instruction upon it. Once an arithmetical operation is preformed by the ALU, the result is placed into the accumulator.

B REGISTER:
B register is used during multiply and divide operations which can be performed only upon numbers stored in the A and B registers. All other instructions in the program can use this register as a spare accumulator (A).

Registers (R0-R7)

Fig3.5: Memory organization of RAM

This is a common name for the total 8 general purpose registers (R0, R1, R2 ...R7). Even they are not true SFRs, they deserve to be discussed here because of their purpose. The bank is active when the R registers it includes are in use. Similar to the accumulator, they are used for temporary storing variables and intermediate results. Which of the banks will be active depends on two bits included in the PSW Register. These registers are stored in four banks in the scope of RAM.

PRAGATI ENGINEERING COLLEGE

23

WIRELESS OPERATED WARFIELD LAND ROVER

8051 REGISTER BANKS AND STACK:


RAM memory space allocation in the 8051 There are 128 bytes of RAM in the 8051. The 128 bytes of RAM inside the 8051 are assigned addresses 00 to7FH. These 128 bytes are divided into three different groups as follows: 1. A total of 32 bytes from locations 00 to 1FH hex are set aside for register

banks and the stack. 2. A total of 16 bytes from locations 20 to 2FH hex are set aside for bit-

addressable read/write memory. 3. A total of 80 bytes from locations 30H to 7FH are used for read and write

storage, or what is normally called Scratch pad. These 80 locations of RAM are widely used for the purpose of storing data and parameters nu 8051 programmers. Default register bank Register bank 0; that is, RAM locations 0, 1,2,3,4,5,6, and 7 are accessed with the names R0, R1, R2, R3, R4, R5, R6, and R7 when programming the 8051.

FIG 3.6: RAM Allocation in the 8051

PSW REGISTER (Program Status Word)

PRAGATI ENGINEERING COLLEGE

24

WIRELESS OPERATED WARFIELD LAND ROVER

This is one of the most important SFRs. The Program Status Word (PSW) contains several status bits that reflect the current state of the CPU. This register contains: Carry bit, Auxiliary Carry, two register bank select bits, Overflow flag, parity bit, and user-definable status flag. The ALU automatically changes some of registers bits, which is usually used in regulation of the program performing.

P - PARITY BIT:
If a number in accumulator is even then this bit will be automatically set (1), otherwise it will be cleared (0). It is mainly used during data transmission and receiving via serial communication.

OV OVERFLOW:
occurs when the result of arithmetical operation is greater than 255 (decimal), so that it cannot be stored in one register. In that case, this bit will be set (1). If there is no overflow, this bit will be cleared (0).

RS0, RS1 - REGISTER BANK SELECT BITS:


These two bits are used to select one of the four register banks in RAM. By writing zeroes and ones to these bits, a group of registers R0-R7 is stored in one of four banks in RAM. RS1 RS2 Space RAM Bank0 00h07h Bank1 08h0Fh Bank2 10h17h Bank3 18hin

1 1 Table3

0 1

PRAGATI ENGINEERING COLLEGE

25

WIRELESS OPERATED WARFIELD LAND ROVER

F0 - FLAG 0: This is a general-purpose bit available to the user.


AC - AUXILIARY CARRY FLAG: Ac is used for BCD operations only. CY - CARRY FLAG: CY is the (ninth) auxiliary bit used for all arithmetical operations and shift instructions.

DPTR REGISTER (Data Pointer):


These registers are not true ones because they do not physically exist. They consist of two separate registers: DPH (Data Pointer High) and (Data Pointer Low). Their 16 bits are used for external memory addressing. They may be handled as a 16-bit register or as two independent 8-bit registers. Besides, the DPTR Register is usually used for storing data and intermediate results, which have nothing to do with memory locations.

SP REGISTER (Stack Pointer):

The stack is a section of RAM used by the CPU to store information temporarily. This information could be data or an address. The CPU needs this storage area since there are only a limited number of registers.

PRAGATI ENGINEERING COLLEGE

26

WIRELESS OPERATED WARFIELD LAND ROVER

3.3 HOW STACKS ARE ACCESSED IN THE 8051:


If the stack is a section of RAM, there must be registers inside the CPU to point to it. The register used to access the stack is called the SP (Stack point) Register. The stack pointer in the 8051 is only 8 bits wide; which means that it can take values of 00 to FFH. When the 8051 is powered up, the SP register contains value 07. This means that RAM location 08 is the first location used for the stack by the 8051. The storing of a CPU register in the stack is called a PUSH, and pulling the contents off the stack back into a CPU register is called a POP. In other words, a register is pushed onto the stack to save it and popped off the stack to retrieve it. The job of the SP is very critical when push and pop actions are performed.

3.4 PROGRAM COUNTER:


The important register in the 8051 is the PC (Program counter). The program counter points to the address of the next instruction to be executed. As the CPU fetches the opcode from the program ROM, the program counter is incremented to point to the next instruction. The program counter in the 8051 is 16bits wide. This means that the 8051 can access program addresses 0000 to FFFFH, a total of 64k bytes of code. However, not all members of the 8051 have the entire 64K bytes of on-chip ROM installed, as we will see soon.

PRAGATI ENGINEERING COLLEGE

27

WIRELESS OPERATED WARFIELD LAND ROVER

CHAPTER 4

PRAGATI ENGINEERING COLLEGE

28

WIRELESS OPERATED WARFIELD LAND ROVER

4. ZIGBEE TECHNOLOGY

4.1 Zig-bee:

Fig 4.1 Zibee Zig-bee is a specification for a suite of high level communication protocols using small, low-power digital radios based on the IEEE 802.15.4,2006 standard for wireless personal area networks (WPANs), such as wireless headphones connecting with cell phones short-range radio. The technology defined by the Zig-bee specification is intended to be simpler and less expensive than other WPANs, such as Bluetooth. Zig-bee is targeted at radiofrequency (RF) applications that require a low data rate, long battery life, and secure networking. Zig-bee is a low data rate, two-way standard for home automation and data networks. The standard specification for up to 254 nodes including one master, managed from a single remote control. Real usage examples of Zig-bee includes home automation tasks such as turning lights on, setting the home security system, or starting the VCR. With Zig-bee all these tasks can be done from anywhere in the home at the touch of a button. Zig-bee also allows for dial-in access via the Internet for automation control. Zig-bee protocol is optimized for very long battery life measured in months to years from inexpensive, off-the-shelf non-rechargeable batteries, and can control lighting, air conditioning and heating, smoke and fire alarms, and other security devices. The standard supports 2.4 GHz (worldwide), 868 MHz (Europe) and 915 MHz (Americas) unlicensed radio bands with range up to 100 meters.
PRAGATI ENGINEERING COLLEGE

29

WIRELESS OPERATED WARFIELD LAND ROVER

IEEE 802.15.4
IEEE 802.15.4 is a standard which specifies the physical layer and medium access control for low-rate wireless personal area networks (LR-WPAN's).This standard was chartered to investigate a low data rate solution with multi-month to multi-year battery life and very low complexity. It is operating in an unlicensed, international frequency band. Potential applications are sensors, interactive toys, smart badges, remote controls, and home automation. 802.15.4 Is part of the 802.15 wireless personal-area network efforts at the IEEE? It is a simple packet-based radio protocol aimed at very low-cost, battery-operated widgets and sensors (whose batteries last years, not hours) that can intercommunicate and send low-bandwidth data to a centralized device. As of 2007, the current version of the standard is the 2006 revision. It is maintained by the IEEE 802.15 working group. It is the basis for the Zig-bee specification, which further attempts to offer a complete networking solution by developing the upper layers which are not covered by the standard.

802.15.4 Protocol
Data rates of 250 kbps with 10-100 meter range. Two addressing modes; 16-bit short and 64-bit IEEE addressing. CSMA-CA channel access. Power management to ensure low power consumption. 16 channels in the 2.4GHz ISM band. Low duty cycle - Provides long battery life. Low latency. Support for multiple network topologies: Static, dynamic, star and mesh. Up to 65,000 nodes on a network. Comparison with other technologies Zig-Bee enables broad-based deployment of wireless networks with low-cost, lowpower solutions. It provides the ability to run for years on inexpensive batteries for a host of monitoring applications: Lighting controls, AMR (Automatic Meter Reading),
PRAGATI ENGINEERING COLLEGE

30

WIRELESS OPERATED WARFIELD LAND ROVER

smoke and CO detectors, wireless telemetry, HVAC control, heating control, home security, Environmental controls and shade controls, etc. Why is Zigbee needed? There are a multitude of standards that address mid to high data rates for voice, PC LANs, video, etc. However, up till now there hasnt been a wireless network standard that meets the unique needs of sensors and control devices. Sensors and controls dont need high bandwidth but they do need low latency and very low energy consumption for long battery lives and for large device arrays. There are a multitude of proprietary wireless systems manufactured today to solve a multitude of problems that also dont require high data rates but do require low cost and very low current drain. These proprietary systems were designed because there were no standards that met their requirements. These legacy systems are creating significant interoperability problems with each other and with newer technologies.

4.2 Zigbee/IEEE 802.15.4 - General Characteristics


Dual PHY (2.4GHz and 868/915 MHz).

Data rates of 250 kbps (@2.4 GHz), 40 kbps (@ 915 MHz), and 20 kbps
(@868 MHz).

Optimized for low duty-cycle applications (<0.1%). CSMA-CA channel access.


Yields high throughput and low latency for low duty cycle devices like sensors

and controls.

Low power (battery life multi-month to years). Multiple topologies: star, peer-to-peer, mesh. Addressing space of up to:
18,450,000,000,000,000,000 devices (64 bit IEEE address) 65,535 network nodes.

Optional guaranteed time slot for applications requiring low latency. Fully hand-shaked protocol for transfer reliability. Range: 50m typical (5-500m based on environment).

PRAGATI ENGINEERING COLLEGE

31

WIRELESS OPERATED WARFIELD LAND ROVER

ZIGBEE NETWORK TOPOLOGY:

PAN

Star Topology

Peer to Peer topology Full function device Reduced Function Device

Cluster Tree Topology Communications flow

Fig 4.2 Zigbee network topology

Three devices in network: 1. Zigbee PAN coordinator (MASTER) 2. Zigbee router (full function device) 3. Zigbee end device (reduced function device)

PRAGATI ENGINEERING COLLEGE

32

WIRELESS OPERATED WARFIELD LAND ROVER

4.3 ZIGBEE PROTOCOL STACK

Fig 4.3 Zigbee protocol stack

PHYSICAL LAYER
The physical layer was designed to accommodate the need for a low cost yet allowing for high levels of integration. The use of direct sequence allows the analog circuitry to be very simple and The PHY provides two services: the PHY data service and PHY management service interfacing to the physical layer management entity (PLME). The PHY data service enables the transmission and reception of PHY protocol data units (PPDU) across the physical radio channel. The features of the PHY are activation and deactivation of the radio transceiver, energy detection(ED), link quality indication (LQI), channel selection, clear channel assessment (CCA) and transmitting as well as receiving packets across the physical medium.

PRAGATI ENGINEERING COLLEGE

33

WIRELESS OPERATED WARFIELD LAND ROVER

The standard offers two PHY options based on the frequency band. Both are based on direct sequence spread spectrum (DSSS). The data rate is 250kbps at 2.4GHz, 40kbps at 915MHz and 20kbps at 868MHz. The higher data rate at 2.4GHz is attributed to a higher-order modulation scheme. Lower frequencies provide longer range due to lower propagation losses. Low rate can be translated into better sensitivity and larger coverage area. Higher rate means higher throughput, Lower latency or lower duty cycle. There is a single channel between 868 and 868.6MHz, 10 channels between 902.0 and 928.0MHz, and 16 channels between 2.4 and 2.4835GHz.

MAC LAYER
The media access control (MAC) layer was designed to allow multiple topologies without complexity. The power management operation doesnt require multiple modes of operation. The MAC allows a reduced functionality device (RFD) that neednt have flash nor large amounts of ROM or RAM. The MAC was designed to handle large numbers of devices without requiring them to be parked. MAC Primitives:

MAC Data Service MCPS-DATA exchange data packets between MAC and PHY. MCPS-PURGE purge an MSDU from the transaction queue.

MAC Management Service MLME-ASSOCIATE/DISASSOCIATE network association. MLME-SYNC / SYNC-LOSS - device synchronization. MLME-SCAN - scan radio channels. MLME- COMM-STATUS communication status. MLME-GET / -SET retrieve/set MAC PIB parameters. MLME-START / BEACON-NOTIFY beacon management. MLME-POLL - beaconless synchronization. MLME-GTS - GTS management. 34

PRAGATI ENGINEERING COLLEGE

WIRELESS OPERATED WARFIELD LAND ROVER

MLME-RESET request for MLME to perform reset. MLME-ORPHAN - orphan device management. MLME-RX-ENABLE - enabling/disabling of radio system.

Network Layer
The responsibilities of the Zigbee NWK layer include:

Starting a network: The ability to successfully establish a new network. Joining and leaving a network: The ability to gain membership (join) or relinquish
membership (leave) a network.

Configuring a new device: The ability to sufficiently configure the stack for
operation as required.

Addressing: The ability of a Zigbee coordinator to assign addresses to devices


joining the network.

Synchronization within a network: The ability for a device to achieve


synchronization with another device either through tracking beacons or by polling.

Security: applying security to outgoing frames and removing security to


terminating frames

Routing: routing frames to their intended destinations. Network Routing Overview


Perhaps the most straightforward way to think of the Zigbee routing algorithm is as a hierarchical routing strategy with table-driven optimizations applied where possible. NWK uses an algorithm that allows stack implementers and application developers to balance unit cost, battery drain, and complexity in producing Zigbee solutions to meet the specific cost-performance profile of their application. Started with the well-studied public-domain algorithm AODV and Motorolas Cluster-Tree algorithm and folding in ideas from Ember Corporations GRAD.

PRAGATI ENGINEERING COLLEGE

35

WIRELESS OPERATED WARFIELD LAND ROVER

Network Summary
The network layer builds upon the IEEE 802.15.4 MACs features to allow extensibility of coverage. Additional clusters can be added; networks can be consolidated or split up.

Application layer
The Zigbee application layer consists of the APS sub-layer, the ZDO and the manufacturer-defined application objects. The responsibilities of the APS sub-layer include maintaining tables for binding, which is the ability to match two devices together based on their services and their needs, and forwarding messages between bound devices. Another responsibility of the APS sub-layer is discovery, which is the ability to determine which other devices are operating in the personal operating space of a device. The responsibilities of the ZDO include defining the role of the device within the network (e.g., Zigbee coordinator or end device), initiating and/or responding to binding requests and establishing a secure relationship between network devices. The manufacturer-defined application objects implement the actual applications according to the Zigbee-defined application descriptions

Zigbee Device Object

Defines the role of the device within the network (e.g., Zigbee coordinator or end device) Initiates and/or responds to binding requests Establishes a secure relationship between network devices selecting one of ZigBees security methods such as public key, symmetric key, etc.

Application Support Layer: This layer provides the following services:

Discovery: The ability to determine which other devices are operating in the personal operating space of a device. Binding: The ability to match two or more devices together based on their services and their needs and forwarding messages between bound devices.

PRAGATI ENGINEERING COLLEGE

36

WIRELESS OPERATED WARFIELD LAND ROVER

APPLICATIONS OF ZIGBEE TECHNOLOGY


Typical application areas include Home Entertainment and Control Smart lighting, advanced temperature control, safety and security, movies and music Home Awareness Water sensors, power sensors, energy monitoring, smoke and fire detectors, smart appliances and access sensors Mobile Services m-payment, m-monitoring and control, m-security and access control, m-healthcare and tele-assist Commercial Building Energy monitoring, HVAC, lighting, access control Industrial Plant Process control, asset management, environmental management, energy management, industrial device control, machine-tomachine (M2Mcommunication.

Zigbee vs. Bluetooth


Zigbee looks rather like Bluetooth but is simpler, has a lower data rate and spends most of its time snoozing. This characteristic means that a node on a Zigbee network should be able to run for six months to two years on just two AA batteries. The operational range of Zigbee is 10-75m compared to 10m for Bluetooth (without a power amplifier). Zigbee sits below Bluetooth in terms of data rate. The data rate of Zigbee is 250kbps at 2.4GHz, 40kbps at 915MHz and 20kbps at 868MHz whereas that of Bluetooth is 1Mbps. Zigbee uses a basic master-slave configuration suited to static star networks of many infrequently used devices that talk via small data packets. It allows up to 254 nodes. Bluetooths protocol is more complex since it is geared towards handling voice, images and file transfers in ad hoc networks. Bluetooth devices can support scatter nets of multiple smaller non-synchronized networks (piconets). It only allows up to 8 slave nodes in a basic master-slave piconet set-up. When Zigbee node is powered down, it can wake up and get a packet in around 15 msec whereas Bluetooth device would take around 3sec to wake up and respond.
PRAGATI ENGINEERING COLLEGE

37

WIRELESS OPERATED WARFIELD LAND ROVER

ZIGBEE MODULE:
Comparison with other technologies

Standard

Zigbee 802.15.4 1 100* 100 1,000 > 64,000 Monitoring & Control 4 32 20 250

Wi-Fi 802.11b 1 100 0.5 5.0 32 Web, Email, Video 1,000 11,000

Bluetooth 802.15.1 1 10 1-7 7 Cable Replacement 250 720

Transmission Range (meters) Battery Life (days) Network Size (# of nodes)

Application

Stack Size (KB) Throughput kb/s)

Zigbee-compliant products operate in unlicensed bands worldwide, including 2.4GHz (global), 902 to 928MHz (Americas), and 868MHz (Europe). Raw data throughput rates of 250Kbps can be achieved at 2.4GHz (16 channels), 40Kbps at 915MHz (10 channels), and 20Kbps at 868MHz (1 channel). The transmission distance is expected to range from 10 to 100m, depending on power output and environmental characteristics. Like Wi-Fi, Zigbee uses direct-sequence spread spectrum in the 2.4GHz band, with offset-quadrature phase-shift keying modulation. Channel width is 2MHz with 5MHz channel spacing. The 868 and 900MHz bands also use directsequence spread spectrum but with binary-phase-shift keying modulation.

ZIGBEE MODULE SPECIFICATION:


Performance: XBee Power output:: 1mW (+0 dBm) North American & International version

Indoor/Urban range: Up to 100 ft (30 m) Outdoor/RF line-of-sight range: Up to 300 ft (90 m) 38

PRAGATI ENGINEERING COLLEGE

WIRELESS OPERATED WARFIELD LAND ROVER

RF data rate: 250 Kbps Interface data rate: Up to 115.2 Kbps Operating frequency: 2.4 GHz Receiver sensitivity: -92 dBm

Performance: XBee-PRO Power output:


63 mW (+18 dBm) North American version 10 mW (+10 dBm) International version

Indoor/Urban range: Up to 300 ft (90 m) Outdoor/RF line-of-sight range: Up to 1 mile (1.6 km) RF LOS RF data rate: 250 Kbps Interface data rate: Up to 115.2 Kbps Operating frequency: 2.4 GHz Receiver sensitivity: -100 dBm (all variants)

Networking

Spread Spectrum type: DSSS (Direct Sequence Spread Spectrum) Networking topology: Point-to-point, point-to-multipoint, & peer-to-peer Error handling: Retries & acknowledgements Filtration options: PAN ID, Channel, and 64-bit addresses Channel capacity:

XBee: 16 Channels XBee-PRO: 12 Channels

Addressing: 65,000 network addresses available for each channel Power

Supply voltage:

XBee: 2.8 - 3.4 VDC XBee-PRO: 2.8 - 3.4 VDC XBee Footprint Recommendation: 3.0 - 3.4 VDC

PRAGATI ENGINEERING COLLEGE

39

WIRELESS OPERATED WARFIELD LAND ROVER

Transmit current:

XBee: 45 mA (@ 3.3 V) boost mode 35 mA (@ 3.3 V) normal mode XBee-PRO: 215 mA (@ 3.3 V)

Receive current:

XBee: 50 mA (@ 3.3 V) XBee-PRO: 55 mA (@ 3.3 V)

Power-down sleep current:


XBee: <10 A at 25 C XBee-PRO: <10 A at 25 C

General

Frequency band: 2.4000 - 2.4835 GHz Interface options: 3V CMOS UART

Physical Properties

Size:

XBee: 0.960 in x 1.087 in (2.438 cm x 2.761 cm) XBee-PRO: 0.960 in x 1.297 in (2.438 cm x 3.294 cm)

Weight: 0.10 oz (3g) Antenna options: U.FL, Reverse Polarity SMA (RPSMA), chip antenna or wired whip antenna Operating temperature: -40 C to 85 C (industrial)

PRAGATI ENGINEERING COLLEGE

40

WIRELESS OPERATED WARFIELD LAND ROVER

CHAPTER 5

PRAGATI ENGINEERING COLLEGE

41

WIRELESS OPERATED WARFIELD LAND ROVER

5. WORKING FLOW OF THE PROJECT


5.1 BLOCK DIAGRAM:

CONTROL SECTION:

PERSONAL COMPUTER

ZIGBEE TRANSCEIVER

RF RECEIVER

Fig 5.1 Control Section

ROBOT SECTION:
POWER SUPPLY

ZIGBEE TRANSCEIVER

CAMERA

MAX 232

8051 MICRO CONTOLLER

HBRIDGE

ULTRA SONIC SENSOR MOTORS METAL DETECTING SENSOR

BUZZER

LCD

Fig 5.2 Robot Section


PRAGATI ENGINEERING COLLEGE

42

WIRELESS OPERATED WARFIELD LAND ROVER

CIRCUIT DISCRIPTION:
In this project, there are two sections (control section & robot section) as shown in the block diagrams. The instructions such as Left, Right etc are processed and are given by the person by operating PC. So based upon input of PC the following output will be seen i.e. left or right. In control Section, the instructions are delivered to Zigbee transceiver from which is connected to the PC. processed and is sent to the receiver section via wireless. The signals from the control section are received by the Zigbee transceiver, in the Robot section and are sent to the controller as input. Controller processes this data and controls the Robot direction according to the instruction given at the control section. It has a camera which records audio and video of the surrounding environment and it transmits those signals to control section via wireless. So we can monitor the robot and basing upon that, we can give instructions from control section. Then the Robot will move in a particular direction for the given instruction. Similarly if any metal is detected, the buzzer will make a beep sound which is audible at control section using RF receiver. This robot section also has a ultrasonic sensor which is used to detect any obstacles. If it detects any obstacle, it gives output to microcontroller, then that micro-controller processes that signal and automatically rotates the robot right. This information is

5.2 POWER SUPPLY


The input to the circuit is applied from the regulated power supply. The a.c. input i.e., 230V from the mains supply is step down by the transformer to 12V and is fed to a rectifier. The output obtained from the rectifier is a pulsating d.c voltage. So in order to get a pure d.c voltage, the output voltage from the rectifier is fed to a filter to remove any a.c components present even after rectification. Now, this voltage is given to a voltage regulator to obtain a pure constant dc voltage.

PRAGATI ENGINEERING COLLEGE

43

WIRELESS OPERATED WARFIELD LAND ROVER

5.2.1 BLOCK DIAGRAM:


230V AC 50Hz D.C Output

Step down transformer

Bridge rectifier

Filter

Regulator

Fig 5.2.1: Block diagram

THE POWER SUPPLY MAINLY CONSISTS OF THREE PARTS: Step down transformer. Full wave rectifier (Bridge rectifier). Regulator LM 7805.

Entire circuit works on a supply of +5v.Transformer 12-0-12 volts/1amp rating is used. Bridge rectifier for 7805 power regulator is used. it is a three pin package .first pin for input ,second pin for ground, third pin for output. First pin is connected to 1000uf/25v capacitor positive terminal. Second pin is connected to ground terminal. Third pin is connected to output pin to provide 5v supply for micro controller board.

5.2.2 STEP DOWN TRANSFORMER:


A transformer is an electrical device which is used to convert electrical power from one electrical circuit to another without change in frequency.

Transformers convert AC electricity from one voltage to another with little loss of power. Transformers work only with AC and this is one of the reasons why mains electricity is AC. Step-up transformers increase in output voltage, stepPRAGATI ENGINEERING COLLEGE

44

WIRELESS OPERATED WARFIELD LAND ROVER

down transformers decrease in output voltage. Most power supplies use a stepdown transformer to reduce the dangerously high mains voltage to a safer low voltage. The input coil is called the primary and the output coil is called the secondary. There is no electrical connection between the two coils; instead they are linked by an alternating magnetic field created in the soft-iron core of the transformer. The two lines in the middle of the circuit symbol represent the core. Transformers waste very little power so the power out is (almost) equal to the power in. Note that as voltage is stepped down current is stepped up. The ratio of the number of turns on each coil, called the turns ratio, determines the ratio of the voltages. A step-down transformer has a large number of turns on its primary (input) coil which is connected to the high voltage mains supply, and a small number of turns on its secondary (output) coil to give a low output voltage.

Fig 5.2.2: An Electrical Transformer

Turns ratio = Vp/ VS = Np/NS Power Out= Power In VS X IS=VP X IP Vp = primary (input) voltage Np = number of turns on primary coil Ip = primary (input) current

5.2.3 RECTIFIER:
A circuit, which is used to convert a.c to dc, is known as RECTIFIER. The process of conversion a.c to d.c is called rectification.

PRAGATI ENGINEERING COLLEGE

45

WIRELESS OPERATED WARFIELD LAND ROVER

TYPES OF RECTIFIERS:
Half wave Rectifier Full wave rectifier

1. Center-tap full wave rectifier. 2. Bridge-type full bridge rectifier.

BRIDGE RECTIFIER:
Most of electronic device and circuits need a DC source for the operation. So it is necessary to convert AC to DC. The process of converting AC to DC is called rectification. This can be achieved with a rectifier, filter and voltage regulator. A rectifier is defined as an electronic device used for converting AC voltage current into unidirectional voltage and current. The rectifiers are classified in two types: 1. Half wave rectifier. 2. Full wave rectifier.

5.2.4 FILTER:
Capacitive filter is used in this project. It removes the ripples from the output of rectifier and smoothens the D.C. Output received from this filter is constant until the mains voltage and load is maintained constant. However, if either of the two is varied, D.C. voltage received at this point changes. Therefore a regulator is applied at the output stage.

CAPACITOR FILTER:
We have seen that the ripple content in the rectified output of half wave rectifier is 121% or that of full-wave or bridge rectifier or bridge rectifier is 48% such high percentages of ripples is not acceptable for most of the applications. Ripples can be removed by one of the following methods of filtering:

PRAGATI ENGINEERING COLLEGE

46

WIRELESS OPERATED WARFIELD LAND ROVER

(a) A capacitor, in parallel to the load, provides an easier by pass for the ripples voltage though it due to low impedance. At ripple frequency and leave the d.c.to appears the load. (b) An inductor, in series with the load, prevents the passage of the ripple current (due to high impedance at ripple frequency) while allowing the d.c (due to low resistance to d.c) (c) Various combinations of capacitor and inductor, such as L-section filter section filter, multiple section filter etc. which make use of both the properties mentioned in (a) and (b) above. Two cases of capacitor filter, one applied on half wave rectifier and another with full wave rectifier. Filtering is performed by a large value electrolytic capacitor connected across the DC supply to act as a reservoir, supplying current to the output when the varying DC voltage from the rectifier is falling. The capacitor charges quickly near the peak of the varying DC, and then discharges as it supplies current to the output. Filtering significantly increases the average DC voltage to almost the peak value (1.4 RMS value). To calculate the value of capacitor(C), C = *3*f*r*Rl Where, f = supply frequency, r = ripple factor, Rl = load resistance Note: In our circuit we are using 1000 microfarads.

5.2.5 VOLTAGE REGULATOR:


Voltage regulator ICs is available with fixed (typically 5, 12 and 15V) or variable output voltages. The maximum current they can pass also rates them. Negative voltage regulators are available, mainly for use in dual supplies. Most regulators include some automatic protection from excessive current ('overload protection') and overheating ('thermal protection'). Many of the fixed voltage regulators ICs has 3 leads and look like power transistors, such as the 7805 +5V
PRAGATI ENGINEERING COLLEGE

47

WIRELESS OPERATED WARFIELD LAND ROVER

1A regulator shown on the right. The LM7805 is simple to use. You simply connect the positive lead of your unregulated DC power supply (anything from 9VDC to 24VDC) to the Input pin, connect the negative lead to the Common pin and then when you turn on the power, you get a 5 volt supply from the output pin.

Fig 5.2.3: A Three Terminal Voltage Regulator

78XX:
The Bay Linear LM78XX is integrated linear positive regulator with three terminals. The LM78XX offer several fixed output voltages making them useful in wide range of applications. When used as a zener diode/resistor combination replacement, the LM78XX usually results in an effective output impedance improvement of two orders of magnitude, lower quiescent current. The LM78XX is available in the TO-252, TO-220 & TO-263packages,

FEATURES:
Output Current of 1.5A Output Voltage Tolerance of 5% Internal thermal overload protection Internal Short-Circuit Limited No External Component Output Voltage 5.0V, 6V, 8V, 9V, 10V, 12V, 15V, 18V, 24V Offer in plastic TO-252, TO-220 & TO-263 Direct Replacement for LM78XX

PRAGATI ENGINEERING COLLEGE

48

WIRELESS OPERATED WARFIELD LAND ROVER

5.3 MAX 232:

5.3.1 RS-232 232 WAVEFORM

Fig 5.3.1:TTL/CMOS Serial Logic Waveform The diagram above shows the expected waveform from the UART when using the common 8N1 format. 8N1 signifies 8 Data bits, No Parity and 1 Stop Bit. The RS-232 line, when hen idle is in the Mark State (Logic 1). A transmission starts with a start bit which is (Logic 0). Then each bit is sent down the line, one at a time. The LSB (Least Significant Bit) is sent first. A Stop Bit (Logic 1) is then appended to the signal to make ke up the transmission. The data sent using this method, is said to be framed. . That is the data is framed between a Start and Stop Bit.

RS-232 232 Voltage levels


+3 to +25 volts to signify a "Space" (Logic 0) -3 to -25 25 volts for a "Mark" (logic 1). Any voltage in between these regions (i.e. between +3 and -3 3 Volts) is undefined.
PRAGATI ENGINEERING COLLEGE

49

WIRELESS OPERATED WARFIELD LAND ROVER

The data byte is always transmitted least-significant-bit first. The bits are transmitted at specific time intervals determined by the baud rate of the serial signal. This is the signal present on the RS-232 RS 232 Port of your computer, shown below.

Fig 5.3.2: RS-232 Logic Waveform

5.3.2 RS-232 232 LEVEL CONVERTER CONVERTE


Standard serial interfacing of microcontroller (TTL) with PC or any RS232C Standard device, requires TTL to RS232 Level converter . A MAX232 is used for this purpose. It provides 2-channel channel RS232C port and requires external 10uF capacitors. The driver requires a single supply of +5V.

Fig 5.3.3 MAX 232 IC Configurations

PRAGATI ENGINEERING COLLEGE

50

WIRELESS OPERATED WARFIELD LAND ROVER

MAX-232 includes a Charge Pump, which generates +10V and -10V from a single 5v supply.

5.3.3 Serial communication


When a processor communicates with the outside world, it provides data in byte sized chunks. Computers transfer data in two ways: parallel and serial. In parallel data transfers, often more lines are used to transfer data to a device and 8 bit data path is expensive. The serial communication transfer uses only a single data line instead of the 8 bit data line of parallel communication which makes the data transfer not only cheaper but also makes it possible for two computers located in two different cities to communicate over telephone. Serial data communication uses two methods, asynchronous and synchronous. The synchronous method transfers data at a time while the asynchronous transfers a single byte at a time. There are some special IC chips made by many manufacturers for data communications. These chips are commonly referred to as UART (universal asynchronous receiver-transmitter) and USART (universal synchronous asynchronous receiver transmitter). The AT89C51 chip has a built in UART. In asynchronous method, each character is placed between start and stop bits. This is called framing. In data framing of asynchronous communications, the data, such as ASCII characters, are packed in between a start and stop bit. We have a total of 10 bits for a character: 8 bits for the ASCII code and 1 bit each for the start and stop bits. The rate of serial data transfer communication is stated in bps or it can be called as baud rate. To allow the compatibility among data communication equipment made by various manufacturers, and interfacing standard called RS232 was set by the Electronics industries Association in 1960. Today RS232 is the most widely used I/O interfacing standard. This standard is used in PCs and numerous types of equipment. However, since the standard was set long before the advent of the TTL logic family, its input and output voltage levels are not TTL compatible. In RS232, a 1 bit is represented by -3 to -25V, while a 0 bit is represented +3 to +25 V, making -3 to +3 undefined. For this reason, to connect any RS232 to a microcontroller system we must
PRAGATI ENGINEERING COLLEGE

51

WIRELESS OPERATED WARFIELD LAND ROVER

use voltage converters such as MAX232 to connect the TTL logic levels to RS232 voltage levels and vice versa. MAX232 ICs are commonly referred to as line drivers.

Fig 5.3.4: Serial communication process The RS232 cables are generally referred to as DB-9 connector. In labeling, DB-9P refers to the plug connector (male) and DB-9S is for the socket connector (female). The simplest connection between a PC and microcontroller requires a minimum of three pin, TXD, RXD, and ground. Many of the pins of the RS232 connector are used for handshaking signals. They are bypassed since they are not supported by the UART chip. IBM PC/ compatible computers based on x86(8086, 80286, 386, 486 and Pentium) microprocessors normally have two COM ports. Both COM ports have RS232 type connectors. Many PCs use one each of the DB-25 and DB-9 RS232 connectors. The COM ports are designated as COM1 and COM2. We can connect the serial port to the COM 2 port of a PC for serial communication experiments. We use a DB9 connector in our arrangement.

PRAGATI ENGINEERING COLLEGE

52

WIRELESS OPERATED WARFIELD LAND ROVER

5.4 H-BRIDGE:
DC motors are typically controlled by using a transistor configuration called an "H-bridge". This consists of a minimum of four mechanical or solid-state switches, such as two NPN and two PNP transistors. One NPN and one PNP transistor are activated at a time. Both NPN and PNP transistors can be activated to cause a short across the motor terminals, which can be useful for slowing down the motor from the back EMF it creates. Basic Theory: H-bridge. Sometimes called a "full bridge" the H-bridge is so named because it has four switching elements at the "corners" of the H and the motor forms the cross bar. The key fact to note is that there are, in theory, four switching elements within the bridge. These four elements are often called, high side left, high side right, low side right, and low side left (when traversing in clockwise order). The switches are turned on in pairs, either high left and lower right, or lower left and high right, but never both switches on the same "side" of the bridge. If both switches on one side of a bridge are turned on it creates a short circuit between the battery plus and battery minus terminals. If the bridge is sufficiently powerful it will absorb that load and your batteries will simply drain quickly. Usually however the switches in question melt. To power the motor, you turn on two switches that are diagonally opposed. In the picture to the right, imagine that the high side left and low side right switches are turned on. The current flows and the motor begins to turn in a "positive" direction. Turn on the high side right and low side left switches, then Current flows the other direction through the motor and the motor turns in the opposite direction. Actually it is just that simple, the tricky part comes in when you decide what to use for switches. Anything that can carry a current will work, from four SPST
PRAGATI ENGINEERING COLLEGE

53

WIRELESS OPERATED WARFIELD LAND ROVER

switches, one DPDT switch, relays, transistors, to enhancement mode power MOSFETs. One more topic in the basic theory section, quadrants. If each switch can be controlled independently then you can do some interesting things with the bridge, some folks call such a bridge a "four quadrant device" (4QD get it?). If you built it out of a single DPDT relay, you can really only control forward or reverse. You can build a small truth table that tells you for each of the switch's states, what the bridge will do. As each switch has one of two states, and there are four switches, there are 16 possible states. However, since any state that turns both switches on one side on is "bad" (smoke issues forth: P), there are in fact only four useful states (the four quadrants) where the transistors are turned on.

High Side Left High Side Right Low Side Left Low Side Right Quadrant Description On Off On Off Off On On Off Off On Off On On Off Off On Forward Running Backward Running Braking Braking

Table 5.4.1 The last two rows describe a maneuver where you "short circuit" the motor which causes the motors generator effect to work against itself. The turning motor generates a voltage which tries to force the motor to turn the opposite direction. This causes the motor to rapidly stop spinning and is called "braking" on a lot of H-bridge designs. Of course there is also the state where all the transistors are turned off. In this case the motor coasts freely if it was spinning and does nothing if it was doing nothing.

PRAGATI ENGINEERING COLLEGE

54

WIRELESS OPERATED WARFIELD LAND ROVER

5.4.1 Implementation of H-bridge


1. Using Relays: A simple implementation of an H Bridge using four SPST relays is shown. Terminal A is High Side Left, Terminal B is High Side Right, Terminal C is Low Side Left and Terminal D is Low Side Right. The logic followed is according to the table above. Warning: Never turn on A and C or B and D at the same time. This will lead to a short circuit of the battery and will lead to failure of the relays due to the large current.

Fig 5.4.1: Implementation using relalys 2.Using Transistors: We can better control our motor by using transistors or Field Effect Transistors (FETs). Most of what we have discussed about the relays H-Bridge is true of these circuits. See the diagram showing how they are connected. You
PRAGATI ENGINEERING COLLEGE

55

WIRELESS OPERATED WARFIELD LAND ROVER

should add diodes across the transistors to catch the back voltage that is generated by the motor's coil when the power is switched on and off. This fly back voltage can be many times higher than the supply voltage! Warning: If you don't use diodes, you could burn out your transistors. Also the same warning as in the diode case. Don't turn on A and C or B and D at the same time.

Fig 5.4.2: Implementation using transistors Transistors, being a semiconductor device, will have some resistance, which causes them to get hot when conducting much current. This is called not being able to sink or source very much power, i.e.: Not able to provide much current from ground or from plus voltage. Mosfets are much more efficient, they can provide much more current and not get as hot. They usually have the fly back diodes built in so you don't need the diodes anymore. This helps guard against fly back voltage frying your ICs. To use Mosfets in an H-Bridge, you need P-Channel Mosfets on top because they can "source" power, and N-Channel Mosfets on the bottom because then can "sink" power. It is important that the four quadrants of the H-Bridge circuits be turned on and off properly. When there is a path between the positive and ground side of the H-Bridge, other than through the motor, a condition exists
PRAGATI ENGINEERING COLLEGE

56

WIRELESS OPERATED WARFIELD LAND ROVER

called "shoot through". This is basically a direct short of the power supply and can cause semiconductors to become ballistic, in circuits with large currents flowing. There are H-bridge chips available that are much easier, and safer, to use than designing your own H-Bridge circuit. 3.Using H-Bridge Devices: The L293 has 2 H-Bridges (actually 4 Half H-Bridges), can provide about 1 amp to each and occasional peak loads to 2 amps. The L298 has 2 h-bridges on board, can handle 1amp and peak current draws to about 3amps. The LMD18200 has one h-bridge on board, can handle about 2 or 3 amps and can handle a peak of about 6 amps. There are several more commercially designed H-Bridge chips as well. Once a Half H-bridge is enabled, it truth table is as follows: INPUT OUTPUT A L H Y L H

Table5.4.2

So you just give a High level when you want to turn the Half HBridge on and Low level when you want to turn it off. When the Half HBridge is on, the voltage at the output is equal to Vcc2.If you want to make a Full H-Bridge, you connect the motor (or the load) between the outputs of two Half H-Bridges and the inputs will be the two inputs of the Half H-Bridges. Suppose we have connected Half H-Bridges 1 and 2 to form a Full HBridge. Now the truth table is as follows:

PRAGATI ENGINEERING COLLEGE

57

WIRELESS OPERATED WARFIELD LAND ROVER

INPUT 1A

INPUT 2A

OUTPUT 1Y

OUTPUT 2Y

Description

Braking (both terminals of motor are Gnd) Forward Running Backward Running Braking (both terminals of motor at Vcc2

L H

H L

L H

H L

Table 5.4.3

5.4.2 L293D Motor Driver IC:


Since two motors are used to drive The back wheels of the robot independently, there is a need for Two H-bridges. Instead of implementing the above H-bridge controlCircuit twice, an alternative is to use an integrated circuit (IC), which Provides more than one H-bridges. One such IC is L293D, which has 2 H-Bridges in it. It can supply 600Ma continuous and 1.2A peak Currents. It is suitable for switching applications up to 5 kHz. These Features make it ideal for our application. Another option is to use IC L298, which can drive 2A continually and 3A peak currents. The Diagram of L293D is shown in Figure. It can be observed from the figure that L293D has a similar configuration to the circuit in h bridge.

PRAGATI ENGINEERING COLLEGE

58

WIRELESS OPERATED WARFIELD LAND ROVER

Fig 5.4.3 L293 Motor Driver IC

Motor Driver Connections: The motor driver requires 2 control inputs for each motor. Since we drive 2 motors, we need 4 controls Inputs from the microcontroller. Since it has many pins which can be configured as outputs, there are many options for implementation.For example, in our robot the last 4 bits of Port B (RB4, RB5, RB6,RB7 - Pins 37 to 40) are used to control the rotation direction of the motors . The enable pins of the motor driver are connected to the PWM outputs of the microcontroller (Pins 16and 17). This is because, as was mentioned above, by changing the width of the pulse (implying changing the enable time of the driver) one can change the speed of the motor. The truth table for motor driver is as shown in Table II, where H = high, L = low, and Z =high output impedance state. Since the motors are reverse aligned, in order to have the robot Move forward they must be configured such that one of them turns forward and the other one turns
PRAGATI ENGINEERING COLLEGE

59

WIRELESS OPERATED WARFIELD LAND ROVER

backward. In case of any requirement for the robot to move backward, it is sufficient to just reverse the THE TRUTH TABLE OF THE MOTOR DRIVER input H L H L enable H H L L Table 5.4.4 DRIVER CONTROL INPUTS Direction Forward Backward Input 1 H L Input 2 L H Table 5.4.5 Outputs of the control pins. For example, in our robot while moving forward, inputs of the motor driver have states shown in the first row Of Table III, whereas for backward movement, the states shown in the second row of Table III is applied. Input 3 L H Input 4 H L output H L z z

PRAGATI ENGINEERING COLLEGE

60

WIRELESS OPERATED WARFIELD LAND ROVER

5.5 DC MOTORS
DC motors are configured in many types and sizes, including brush less, servo, and gear motor types. A motor consists of a rotor and a permanent magnetic field stator. The magnetic field is maintained using either permanent magnets or electromagnetic windings. DC motors are most commonly used in variable speed and torque. Motion and controls cover a wide range of components that in some way are used to generate and/or control motion. Areas within this category include bearings and bushings, clutches and brakes, controls and drives, drive components, encoders and resolves, Integrated motion control, limit switches, linear actuators, linear and rotary motion components, linear position sensing, motors (both AC and DC motors), orientation position sensing, pneumatics and pneumatic components, positioning stages, slides and guides, power transmission (mechanical), seals, slip rings, solenoids, springs. Motors are the devices that provide the actual speed and torque in a drive system. This family includes AC motor types (single and multiphase motors, universal, servo motors, induction, synchronous, and gear motor) and DC motors (brush less, servo motor, and gear motor) as well as linear, stepper and air motors, and motor contactors and starters. In any electric motor, operation is based on simple electromagnetism. A current-carrying conductor generates a magnetic field; when this is then placed in an external magnetic field, it will experience a force proportional to the current in the conductor, and to the strength of the external magnetic field. As you are well aware of from playing with magnets as a kid, opposite (North and South) polarities attract, while like polarities (North and North, South and South) repel. The internal configuration of a DC motor is designed to harness the magnetic interaction between a current-carrying conductor and an external magnetic field to generate rotational motion. Let's start by looking at a simple 2-pole DC electric motor (here red represents a magnet or winding with a "North" polarization, while green represents a magnet or winding with a "South" polarization).
PRAGATI ENGINEERING COLLEGE

61

WIRELESS OPERATED WARFIELD LAND ROVER

Fig 5.5.1: Block Diagram of the DC motor Every DC motor has six basic parts -- axle, rotor (a.k.a., armature), stator, commutator, field magnet(s), and brushes. In most common DC motors (and all that Beamers will see), the external magnetic field is produced by high-strength permanent magnets1. The stator is the stationary part of the motor -- this includes the motor casing, as well as two or more permanent magnet pole pieces. The rotor (together with the axle and attached commutator) rotates with respect to the stator. The rotor consists of windings (generally on a core), the windings being electrically connected to the commutator. The above diagram shows a common motor layout -- with the rotor inside the stator (field) magnets The geometry of the brushes, commutator contacts, and rotor windings are such that when power is applied, the polarities of the energized winding and the stator magnet(s) are misaligned, and the rotor will rotate until it is almost aligned with the stator's field magnets. As the rotor reaches alignment, the brushes move to the next commutator contacts, and energize the next winding. Given our example two-pole motor, the rotation reverses the direction of current through the rotor winding, leading to a "flip" of the rotor's magnetic field, and driving it to continue rotating. In real life, though, DC motors will always have more than two poles (three is a very common number). In particular, this avoids "dead spots" in the commutator. You can imagine how with our example two-pole motor, if the rotor is exactly at the middle of its rotation (perfectly aligned with the field magnets), it will get "stuck" there. Meanwhile, with a two-pole motor, there is a moment where the commutator shorts out the power supply (i.e., both brushes touch both commutator contacts simultaneously). This would be bad for the power supply, waste energy, and damage motor components as well. Yet another disadvantage of such a simple motor

PRAGATI ENGINEERING COLLEGE

62

WIRELESS OPERATED WARFIELD LAND ROVER

is that it would exhibit a high amount of torque ripple" (the amount of torque it could produce is cyclic with the position of the rotor).

Fig 5.5.2: : Block Diagram of the DC motor having two poles only

So since most small DC motors are of a three-pole three pole design, let's tinker with the workings of one via an in interactive animation (JavaScript required):

Fig 5.5.3: : Block Diagram of the DC motor having Three poles You'll notice a few things from this -- namely, one pole is fully energized at a time (but two others are "partially" energized). As each brush transitions from one commutator contact to the next, one coil's field will rapidly collapse, as the next coil's field will rapidly charge up (this occurs within a few microsecond). We'll see more about the effects of this later, but in the meantime you can see that this is a direct result of the coil windings' series wiring:
PRAGATI ENGINEERING COLLEGE

63

WIRELESS OPERATED WARFIELD LAND ROVER

Fig 5.5.4: : Internal Block Diagram of the the Three pole DC motor

There's probably no better way to see how an average dc motor is put together, than by just opening one up. Unfortunately this is tedious work, as well as requiring the destruction of a perfectly good motor. This is a b basic 3-pole pole dc motor, with 2 brushes and three commutator contacts.

5.6 LIQUID CRYSTAL DISPLAY


Liquid crystal display is a type of display which is used in digital watches and many portable computers.LCD display utilize two sheets of polarizing material with a liquid crystal solution between them. An electric current passed through the liquid causes the crystal solution between them. An electric current passed through the liquid causes the crystal so that light cannot cannot pass through the liquid causes the crystal to align so that light cannot pass through them. Each crystal, therefore, is like a shutter, either allowing light to pass through or blocking the light. The light crystals can be manipulated through an applied applied electric voltage so that light is allowed to pass or is blocked. By carefully controlling where and what wavelength of light is allowed to pass, the LCD monitor is able to display images. A back light provides LCD monitors brightness.

PRAGATI ENGINEERING COLLEGE

64

WIRELESS OPERATED WARFIELD LAND ROVER

Other advances have allowed LCDs to greatly reduce liquid crystal cell response times. Response time is the amount of time it takes for a pixel to change colors:. In reality response time is the amount of time it takes a liquid crystal cell to go from being active to inactive. They make complicated equipment easier to operate.LCD s come in many shapes and sizes but the most common is the 16 character x 14 line (16x4) display with no backlight. It requires only 11 connections eights bits for data (which can be reduced to four if necessary) and three control lines (we have only use two here). It runs off a 5V DC supply and only needs about 1mA of current. The display contrast can be varied by changing the voltage into pin 3 of the display.

Fig 5.6.1: LCD ADVANTAGES: LCD is finding widespread use replacing leds. the advantages using an LCD are: The declining prices of LCD. The ability to display characters, graphics, and numbers. This is in contrast to

LEDs, which are limited to numbers and a few characters. An intelligent LCD displays two lines, 20 characters per line, which is interfaced to the 8051. Ease of programming for characters and graphics. Incorporation of a refreshing controller into the LCD, thereby relieving the

CPU of the task of refreshing the LCD.


PRAGATI ENGINEERING COLLEGE

65

WIRELESS OPERATED WARFIELD LAND ROVER

Control lines: The three control lines are referred to as EN, RS and RW.

EN:
The EN line is called enable. This control line is used to tell the LCD that you are sending it data. To send data to the LCD, your program should first set this line high (1) and then set the other two control lines and/or put data on the data bus. When the other lines are completely ready, bring EN low (0) again. The 1-0 transition tells the 44780 to take the data currently found on the other control lines and on the data bus and to treat it as a command.

RS:
The RS line is the Register Select line. When RS is low(0),the data is to be treated as a command or special instruction (such as clear screen, position cursor, etc). When RS is high (1), the data that is sent is a text data which should be displayed on the screen. For example, to display the letter T on the screen you would set RS high.

RW:
The RW line is the Read/Write control line. When RW is low (0), the information on the data bus is being written to the LCD. When RW is high (1), the program is effectively querying (or reading) the LCD. Only one instruction (Get LCD status) is a read command. All others are write commands, so RW will almost be low. Finally the data bus consists of 4 or 8 lines (depending on the mode of operations selected by the user).In the case of an 8 bit data bus, the lines are referred tt0 as DB0, DB1, DB2, DB3, DB4, DB5, DB6,and DB7. The ASIIC code to be displayed is eight bits long and is sent to the LCD either four or eight bits at a time. If four bit mode is used ,two nibbles of data (sent high four bits and then low four bits with an E clock pulse with each nibble) are sent to make up a full eight bit transfer .The E clock is used to initiate the data transfer within the LCD. Depending on how to send the data to the LCD is most critical decision to be made for an LCD interface application.

PRAGATI ENGINEERING COLLEGE

66

WIRELESS OPERATED WARFIELD LAND ROVER

Eight bit mode is best used when speed is required in an application and at least ten I/O pins are available. The R/S bit is used to select whether data or an instruction is being transferred between the micro controller and the LCD. If the Bit is set, then the byte at the current LCD cursor position can be written.

5.7 ULTRASONIC SENSOR

Fig 5.7.1: Ultra sonic sensor

Ultrasonic sensors (also known as transceivers when they both send and receive) work on a principle similar to radar or sonar which evaluate attributes of a target by interpreting the echoes from radio or sound waves respectively. Ultrasonic sensors generate high frequency sound waves and evaluate the echo which is received back by the sensor. Sensors calculate the time interval between sending the signal and receiving the echo to determine the distance to an object. This technology can be used for measuring wind speed and direction, tank or channel level, and speed through air or water. For measuring speed or direction a device uses multiple detectors and calculates the speed from the relative distances to particulates in the air or water. To measure tank or channel level, the sensor measures the distance to the surface of the fluid. Further applications include: humidifiers, sonar, medical ultrasonography, burglar alarms and nondestructive testing.

PRAGATI ENGINEERING COLLEGE

67

WIRELESS OPERATED WARFIELD LAND ROVER

Systems typically use a transducer which generates sound waves in the ultrasonic range, above 18,000 hertz, by turning electrical energy into sound, then upon receiving the echo turn the sound waves into electrical energy which can be measured and displayed.The technology is limited by the shapes of surfaces and the density or consistency of the material. Foam, in particular, can distort surface level readings.In this project we used this sensor for automatic obstacle avoidance.

5.8 METAL DETECTOR SENSOR


A metal detector is a device which responds to metal that may not be readily apparent.The simplest form of a metal detector consists of an oscillator producing an alternating current that passes through a coil producing an alternating magnetic field. If a piece of electrically conductive metal is close to the coil ,eddy currents will be induced in the metal, and this produces a magnetic field of its own. If another coil is used to measure the magnetic field (acting as amagnetometer), the change in the magnetic field due to the metallic object can be detected. The first industrial metal detectors were developed in the 1960s and were used extensively for mining and other industrial applications. Uses include de-mining(the detection of land mines), the detection of weapons such as knives and guns (especially in airport security), geophysical prospecting, archaeology and treasure hunting. Metal detectors are also used to detect foreign bodies in food, and in the construction industry to detect steel reinforcing bars in concrete and pipes and wires buried in walls and floors.

Fig 5.7.1 Proximity sensor

PRAGATI ENGINEERING COLLEGE

68

WIRELESS OPERATED WARFIELD LAND ROVER

CHAPTER 6

PRAGATI ENGINEERING COLLEGE

69

WIRELESS OPERATED WARFIELD LAND ROVER

6. SOFTWARE TOOLS
6.1 EMBEDDED C About embedded C High-level language programming has long been in use for embeddedsystems development. However, assembly programming still prevails, particularly for digital-signal processor (DSP) based systems. DSPs are often programmed in assembly language by programmers who know the processor architecture inside out. The key motivation for this practice is performance, despite the disadvantages of assembly programming when compared to high-level language programming. Performance is key to signal-processing applications because it directly translates into end-user features. A 10-percent lower clock speed generally results in a corresponding reduction in power consumption. With more effective code generation, an application needs less processing cycles and thus a lower clock speed, which results in less EMI, longer battery life, and less heat generation. If the video decoding takes 80 percent of the CPU-cycle budget instead of 90 percent, for instance, there are twice as many cycles available for audio processing. This coupling of performance to end-user features is characteristic of many of the real-time applications in which DSP processors are applied. Embedded C is not part of the C language as such. Rather, it is a C language extension that is the subject of a technical report by the ISO working group named "Extensions for the Programming Language C to Support Embedded Processors" [3]. It aims to provide portability and access to common performance-increasing features of processors used in the domain of DSP and embedded processing. The Embedded C specification for fixed-point, named address spaces, and named registers gives the programmer direct access to features in the target processor, thereby significantly improving the performance of applications. The hardware I/O extension is a portability feature of Embedded C. Its goal is to allow easy porting of device-driver code between systems. In this article, we focus on the performance-improving features of Embedded C.

PRAGATI ENGINEERING COLLEGE

70

WIRELESS OPERATED WARFIELD LAND ROVER

DSPs have a highly specialized architecture to achieve the performance requirements for signal processing applications within the limits of cost and power consumption set for consumer applications. Unlike a conventional Load-Store (RISC) architecture, DSPs have a data path with memory-access units that directly feed into the arithmetic units. Address registers are taken out of the generalpurpose register file and placed next to the memory units in a separate register file A further specialization of the data path is the coupling of multiplication and addition to form a single cycle Multiply-accumulate unit (MAC). It is combined with special-purpose accumulator registers, which are separate from the generalpurpose registers. Data memory is segmented and placed close to the MAC to achieve the high bandwidths required to keep up with the streamlined data path. Limits are often placed on the extent of memory-addressing operations. The localization of resources in the data path saves many data movements that typically take place in a Load-Store architecture. The most important, common arithmetic extension to DSP architectures is the handling of saturated fixed-point operations by the arithmetic unit. Fixed-point arithmetic can be implemented with little additional cost over integer arithmetic. Automatic saturation (or clipping) significantly reduces the number of controlflow instructions needed for checking overflow explicitly in the program. DSP architectures are not easy to program optimally, either by hand or with compilers. Manual assembly programming is awkward because of the none orthogonally of the architecture and arbitrary restrictions that can be in place. Modern compilers can deal with none orthogonally reasonably well, but are not good at exploiting the special features that DSP processors have in place. Current state-of-the-art embedded applications (mobile phones, for example) are implemented using two processors. One processor is a low-power RISC processor that takes care of all control processing, user interaction, and display management. It is programmed in a high-level language using an SDK that includes a compiler. The other processor is a DSP, which takes care of all of the signal processing. The signal-processing algorithms are typically hand-coded in assembly.

PRAGATI ENGINEERING COLLEGE

71

WIRELESS OPERATED WARFIELD LAND ROVER

Changes in technological and economic requirements make it more expensive to continue programming DSPs in assembly. Staying with the mobile phone as an example, the signal-processing algorithms required become increasingly complex. Features such as stronger error correction and encryption must be added. Communication protocols become more sophisticated and require much more code to implement. In certain markets, multiple protocol stacks are implemented to be compatible with multiple service providers. In addition, backward compatibility with older protocols is needed to stay synchronized with provider networks that are in a slow process of upgrading.

DESCRIPTION Embedded C is designed to bridge the performance mismatch between Standard C and the embedded hardware and application architecture. It extends the C language with the primitives that are needed by signal-processing applications and that are commonly provided by DSP processors. The design of the support for fixed-point data types and named address spaces in Embedded C is based on DSP-C. DSP-C [1] is an industry-designed extension of C with which experience was gained since 1998 by various DSP manufacturers in their compilers. For the development of DSP-C by ACE (the company three of us work for), cooperation was sought with embedded-application designers and DSP manufacturers. The Embedded C specification extends the C language to support freestanding embedded processors in exploiting the multiple address space functionality, user-defined named address spaces, and direct access to processor and I/O registers. These features are common for the small, embedded processors used in most consumer products. Previously, it was common practice that each of the tool providers supported these features using functionally similar, but syntactically different, implementations. For the Embedded C specifications, the functionality from the various tool providers was used and a common, extensible syntax was defined. Specific embedded-systems deficiencies in C have been addressed to reduce application dependence on assembly code. Embedded C makes life easier for application programmers. The primitives provided are the primitives that fit the conceptual model of the application. The
PRAGATI ENGINEERING COLLEGE

72

WIRELESS OPERATED WARFIELD LAND ROVER

Embedded C extensions to C unlock the high-performance features of embedded processors for C programmers. The Embedded C specification brings back the roots of C to embedded systems as primarily a high-level language means of accessing the processor. Assembly programming is no longer required for a vast body of performancecritical code. Maintainability and portability of code are the key winners in this process. Embedded C Features The features introduced by Embedded C are fixed-point and saturated arithmetic, segmented memory spaces, and hardware I/O addressing. The description we present here addresses the extensions from a language-design perspective, as opposed to the programmer or processor architecture perspective. Multiple Address Spaces Embedded C supports the multiple address spaces found in most embedded systems. It provides a formal mechanism for C applications to directly access (or map onto) those individual processor instructions that are designed for optimal memory access. Named address spaces use a single, simple approach to grouping memory locations into functional groups to support MAC buffers in DSP applications, physical separate memory spaces, direct access to processor registers, and user-defined address spaces. The Embedded C extension supports defining both the natural multiple address space built into a processor's architecture and the application-specific address space that can help define the solution to a problem. Embedded C uses address space qualifiers to identify specific memory spaces in variable declarations. There are no predefined keywords for this, as the actual memory segmentation is left to the implementation. As an example, assume that X and Y are memory qualifiers. The definition: X int a[25]; Means that a is an array of 25 integers, which is located in the X memory. Similarly (but less common): X int * Y p ;

PRAGATI ENGINEERING COLLEGE

73

WIRELESS OPERATED WARFIELD LAND ROVER

Means that the pointer p is stored in the Y memory. This pointer points to integer data that is located in the X memory. If no memory qualifiers are used, the data is stored into unqualified memory. For proper integration with the C language, a memory structure is specified, where the unqualified memory encompasses all other memories. All unqualified pointers are pointers into this unqualified memory. The unqualified memory abstraction is needed to keep the compatibility of the void * type, the NULL pointer, and to avoid duplication of all library code that accesses memory through pointers that are passed as parameters. Each address space other than the generic one has a unique name in the form of an identifier. Address space names are ordinary identifiers, sharing the same name space as variables and typedef names. Address space identifiers follow the same rules for scope as other identifiers. A compiler implementation may provide an implementation-defined set of intrinsic address spaces. The names of intrinsic address spaces are reserved identifiers beginning with an underscore and an uppercase letter or with two underscores. A compiler implementation may also support a means for new address space names to be defined within applications.

Named Registers Embedded C allows direct access to processor registers that are not addressable in any of the machine's address spaces. The processor registers are defined by the compiler-specific, named-register, storage class for each supported processor. The processor registers are declared and used like conventional C variables (in many cases volatile variables). Developers using Embedded C can now develop their applications, including direct access to the condition code register and other processor-specific status flags, in a high-level language, instead of inline assembly code. Named address spaces and full processor access reduces application dependency on assembly code and shifts the responsibility for computing data types, array and structure offsets, and all those things that C compilers routinely and easily do from developers to compilers.

PRAGATI ENGINEERING COLLEGE

74

WIRELESS OPERATED WARFIELD LAND ROVER

I/O Hardware Addressing The motivation to include primitives for I/O hardware addressing in Embedded C is to improve the portability of device-driver code. In principle, a hardware device driver should only be concerned with the device itself. The driver operates on the device through device registers, which are device specific. However, the method to access these registers can be very different on different systems, even though it is the same device that is connected. The I/O hardware access primitives aim to create a layer that abstracts the system-specific access method from the device that is accessed. The ultimate goal is to allow source-code portability of device drivers between different systems. In the design of the I/O hardware-addressing interface, three requirements needed to be fulfilled:

The device-drive source code must be portable. The interface must not prevent implementations from producing machine code

that is as efficient as other methods.

The design should permit encapsulation of the system-dependent access

method. The design is based on a small collection of functions that are specified in the <iohw.h> include file. These interfaces are divided into two groups; one group provides access to the device, and the second group maintains the access method abstraction itself. To access the device, the following functions are defined by Embedded C: unsigned int iord(ioreg designator); void iowr(ioreg designator,unsigned int value); void ioor(ioreg designator,unsigned int value); void ioand(ioreg designator,unsigned int value); void ioand(ioreg designator,unsigned int value); These interfaces provide read/write access to device registers, as well as typical methods for setting/resetting individual bits. Variants of these functions are defined (with buf appended to the names) to access arrays of registers. Variants are also defined (with l appended) to operate with long values.

PRAGATI ENGINEERING COLLEGE

75

WIRELESS OPERATED WARFIELD LAND ROVER

All of these interfaces take an I/O register designator ioreg_designator as one of the arguments. These register designators are an abstraction of the real registers provided by the system implementation and hide the access method from the driver source code. Three functions are defined for managing the I/O register designators. Although these are abstract entities for the device driver, the driver does have the obligation to initialize and release the access methods. These functions do not access or initialize the device itself because that is the task of the driver. They allow, for example, the operating system to provide a memory mapping of the device in the user address space. void iogroup acquire(iogrp designator); void iogroup release(iogrp designator); void iogroup map(iogrp designator,iogrp designator); The iogrp_designator specifies a logical group of I/O register designators; typically this will be all the registers of one device. Like the I/O register designator, the I/O group designator is an identifier or macro that is provided by the system implementation. The map variant allows cloning of an access method when one device driver is to be used to access multiple identical devices. Embedded C Portability By design, a number of properties in Embedded C are left implementation defined. This implies that the portability of Embedded C programs is not always guaranteed. Embedded C provides access to the performance features of DSPs. As not all processors are equal, not all Embedded C implementations can be equal. For example, suppose an application requires 24-bit fixed-point arithmetic and an Embedded C implementation provides only 16 bits because that is the native size of the processor. When the algorithm is expressed in Embedded C, it will not produce outputs of the right precision. In such a case, there is a mismatch between the requirements of the application and the capabilities of the processor. Under no circumstances, including the use of assembly, will the algorithm run efficiently on such a processor. Embedded C cannot overcome such discrepancies. Yet, Embedded C provides a great improvement in the portability and software engineering of embedded applications. Despite many differences
PRAGATI ENGINEERING COLLEGE

76

WIRELESS OPERATED WARFIELD LAND ROVER

between performance-specific processors, there is a remarkable similarity in the special-purpose features that they provide to speed up applications. The contribution of Embedded C is that it standardizes the notation to access these features. By adding this to the C language, it is now feasible to write highperformance code for embedded and DSP processors in a high-level language. Using Embedded C, it is possible to map C code to almost any machine instruction; this "assembler in C" capability was not a goal but reflects the effectiveness of the extensions. The responsibility of programmers to do the laborious resource-planning tasks that assembly language programming requires is taken away. Writing C code with the low-level processor-specific support may at first appear to have many of the portability problems usually associated with assembly code. In the limited experience with porting applications that use Embedded C extensions, an automotive engine controller application (about 8000 lines of source) was ported from the eTPU, a 24-bit special-purpose processor, to a general-purpose 8-bit Freescale 68S08 with about a screen full of definitions put into a single header file. The porting process was much easier than expected. For example, variables that had been implemented on the processor registers were ported to unqualified memory in the general-purpose microprocessor by changing the definitions in the header definition and without any actual code modifications. The exercise was to identify the porting issues and it is clear that the performance of the special-purpose processor is significantly higher than the general-purpose target. C++ Compatibility C++ compatibility was a topic of debate in the design of Embedded C. Preferably; the extension should be expressed in such a way that it can be implemented as C++ classes. It implies that the extension should not depend on the use of type qualifiers. This, however, is against the "spirit of C" and leads to a long list of types that result when all combinations of qualifiers are expanded. While this would be feasible for the fixed-point types, it would still not provide a solution for the named address space qualifiers. Hence the current design that follows standard C practice. In the case code must be written that is to be accepted by both a C and C++ compiler, you need to define macros such as
PRAGATI ENGINEERING COLLEGE

77

WIRELESS OPERATED WARFIELD LAND ROVER

unsigned_long_accum, which should then expand into the right pattern for the specific compiler. For named address spaces, there is no similar solution yet because these do not commonly appear in C++ compilers.

6.2 KEIL SOFTWARE


Keil Software is the leading vendor for 8/16-bit development tools (ranked at first position in the 2004 Embedded Market Study of the Embedded Systems and EE Times magazine). Keil Software is represented world-wide in more than 40 countries. Since the market introduction in 1988, the Keil C51 Compiler is the de facto industry standard and supports more than 500 current 8051 device variants. Now, Keil Software offers development tools for ARM. Keil Software makes C compilers, macro assemblers, real-time kernels, debuggers, simulators, integrated environments, and evaluation boards for the 8051, 251, ARM, and XC16x/C16x/ST10 microcontroller families. Keil Software is pleased to announce simulation support for the Atmel AT91 ARM family of microcontrollers. The Keil Vision Debugger simulates the complete ARM instruction-set as well as the on-chip peripherals for each device in the AT91 ARM/Thumb microcontroller family. The integrated simulator provides complete peripheral simulation. Other new features in the Vision Debugger include: An integrated Software Logic Analyzer that measures I/O signals as well as

program variables and helps developers create complex signal processing algorithms. An Execution Profiler that measures time spent in each function, source line,

and assembler instruction. Now developers can find exactly where programs spend the most time. "Using nothing more than the provided simulation support and debug scripts, developers can create a high-fidelity simulation of their actual target hardware and environment. No extra hardware or test equipment is required. The Logic Analyzer and Execution Profiler will help developers when it comes time to develop and tune signaling algorithms." said Jon Ward, President of Keil Software USA, Inc.
PRAGATI ENGINEERING COLLEGE

78

WIRELESS OPERATED WARFIELD LAND ROVER

6.3 Atmel Programmer Uc Flash

Fig 6.3 Uc flash Programmer

The c Flash USB Programmer is an affordable, reliable, and fast programmer for MCS51/AVR Microcontrollers and 24Cxx I2C EEPROMs. The programmer is designed to operate with the Intel Pentium-based IBM-compatible desktop computers. The menu-driven software interface makes it easy to operate. It is used to dump the software code into the micro controller IC.

Hardware Features

Single 40 Pin ZIF for 8 to 40 Pin Devices USB Interface Programmer firmware update through computer ISP programming supported

Software Features

Works on Win Xp Operating System User-friendly interfaces with pull-down menus, pop-up dialogue box and help Device insertion test Support all operations, such as read, blank check, erase, program, secure, &

verify
PRAGATI ENGINEERING COLLEGE

79

WIRELESS OPERATED WARFIELD LAND ROVER

Easy to use integrated HEX Editor on main software window Supports Intel (linear & segmented) HEX (INHX8M) Auto Batch Program function for faster programming i.e. Mass Production

mode

Automatic device identification before programming Support for programming only a selected memory in the microcontroller e.g.

Data memory or Fuse Bits

PRAGATI ENGINEERING COLLEGE

80

WIRELESS OPERATED WARFIELD LAND ROVER

CONCLUSION
The project WIRELESS OPERATED WAR-FIELD LAND ROVER has been successfully designed and tested. It has been developed by integrating features of all hardware components used. Presence of every module has been reasoned out and placed carefully, thus contributing to the best working of the unit. Secondly, using highly advanced ICs and with the help of growing technology, the project has been successfully implemented.

PRAGATI ENGINEERING COLLEGE

81

WIRELESS OPERATED WARFIELD LAND ROVER

BIBILIOGRAPHY & REFERENCES


1. The 8051 Microcontroller and Embedded Systems Muhammad Ali Mazidi Janice Gillispie Mazidi Kenneth J Ayala B Ram Ramesh S Gaonkar

2. The 8051 Microcontroller Architecture, Programming and Applications 3. Fundamentals of Microprocessors and Microcontrollers 4. Microprocessor Architecture, Programming and Applications

References on the WEB: www.google.com www.ehow.com www.8051.com www.howthestuffworks.com www.robots-and-androids.com www.freelancer.com

PRAGATI ENGINEERING COLLEGE

82

WIRELESS OPERATED WARFIELD LAND ROVER

APPENDIX
SOURCE CODE: Main program:
#include <REGX51.H> #include <serial.H> #include <lcd.H> #define ldr P3_6 #define ultra P3_7 #define fan P0_7 #define M1_P P1_7 #define M1_N P1_6 #define M2_P P1_5 #define M2_N P1_4 unsigned char int_ch='\0'; void uart_interrup() interrupt 4 { if(RI) { int_ch=SBUF; RI=0; } } void motor_start() { M1_P=1; M1_N=0; M2_P=1; M2_N=0; } void motor_back() {
PRAGATI ENGINEERING COLLEGE

83

WIRELESS OPERATED WARFIELD LAND ROVER

M1_P=0; M1_N=1; M2_P=0; M2_N=1; } void motor_stop() { M1_P=0; M1_N=0; M2_P=0; M2_N=0; } void motor_right() { M1_P=1; M1_N=0; M2_P=0; M2_N=1; } void motor_left() { M1_P=0; M1_N=1; M2_P=1; M2_N=0; } void delaym() { unsigned int i; for(i=0;i<3300;i++); } void main() {
PRAGATI ENGINEERING COLLEGE

84

WIRELESS OPERATED WARFIELD LAND ROVER

bit flag_T=0,flag_L=0,flag_C=0,flag_S=0,flag_B=0,flag_auto=0; motor_stop(); ldr=1; ultra=1; lcd_init(); uart_init(); lcd_string_loc(0x80,"....RECEIVER..."); lcd_string_loc(0xC0,"......UNIT......"); delay(30); IE=0X90; while(1) { IE=0X90; if(int_ch=='F') { motor_start(); lcd_cmd(0x01); lcd_string_loc(0x80,"G0 forward.........."); int_ch='\0'; } if(int_ch=='B') { motor_back(); lcd_cmd(0x01); lcd_string_loc(0x80,"G0 back.........."); int_ch='\0'; } if(int_ch=='S') { motor_stop(); lcd_cmd(0x01);
PRAGATI ENGINEERING COLLEGE

85

WIRELESS OPERATED WARFIELD LAND ROVER

lcd_string_loc(0x80,"STOP.............."); int_ch='\0'; } if(int_ch=='R') { motor_right(); lcd_cmd(0x01); lcd_string_loc(0x80,"G0 right.........."); int_ch='\0'; } if(int_ch=='L') { motor_left(); lcd_cmd(0x01); lcd_string_loc(0x80,"G0 left..........."); int_ch='\0'; } } }

PRAGATI ENGINEERING COLLEGE

86

You might also like