Vous êtes sur la page 1sur 50

CHAPTER-1

INTRODUCTION
The global focus on terrorism and security may have geared up following the 9/11 attacks in the USA. The risk of terrorist attack can perhaps never be eliminated, but sensible steps can be taken to reduce the risk. The issue here is how seriously do the governments take the threat of terrorismPost-Limburg, we cannot continue to hope for the best and ignore the lessons. Our Prime Minister Manmohan Singh also mentioned in a speech last year that Indian soldiers will soon have robots assisting them to counter terrorist attack. We are yet to hear more on that thought. The word robot was first used in a 1921 play titled R.U.R.: Rossums Universal Robots, by Czechoslovakian writer Karel Capek. Robot is a Czech word meaning worker. Merriam-Webster defines robot as a machine that looks like a human being and perform various complex acts; a device that automatically performs complicated, often repetitive tasks; a mechanism guided by automatic controls. ISO describes 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. Yet, all these definition do give us a rough idea about what comprises a robot, which needs to sense the outside world and act accordingly. There are motors, pulleys, gears, gearbox, levers, chains, and many more mechanical systems, enabling locomotion. There are sound, light, magnetic field and other sensors that help the robot collect information about its environment. There are microcontrollers powered by powerful software that help the robot make sense environmental data captured and tell it what to do next. There are microphones, speakers, displays, etc that help the robot interact with humans.

1.1 Objectives The main objectives of using robot are mentioned below 1. Where man dares not venture: Robots have traditionally been put to use in environments that are too hazardous for man. 1

2. To rescue, pronto! : Robots also work under precarious conditions, for search and rescue after disasters. A host of robots built by the University of South Floridas Centre for robot assisted search and rescue were in action at the world trade centre site within hours after the disaster to delve into the rubble and rescue survivors. Similarly, robots are also put to work in underground mines. A lot of research today is focused on improving rescue functions of robots. One notable development is the invention of new locomotion system for robots developed at Virginia tech can propel themselves using their outer surface. Since they do not have unwieldy wheels or legs sticking out of their structure, these robots can easily move in narrow space or low cavities under debris, etc.

3. We even make them go to war: The faithful bots do not hesitate to tread even the dreaded terrain of battlefields. Their use in Afghanistan and Iraq wars make us wonder if robots have indeed become intelligent! Battle bots of various shapes and sizes were deployed to defuse landmines, search for criminals hiding in caves, search for bombs under cars and in building, for espionage and what not! To describe their work is master enough for another article, but the role they played is obvious from that these bots were even awarded medals! These robots were controlled by humans. But following the war, a contest was launched in Singapore to design autonomous urban warriors that can search buildings, detect and defuse bombs, etc autonomously even in crowded urban localities. Singapores Defence and Technology Agency (DSTA) have offered one million Singapore dollars as prize money for whoever can develop such a robot.

4. We aim to develop a model which will be efficiently used to minimize terrorist causality.

Being able to achieve reliable long distance communication is an important open area of research to robotics as well as other technology areas. As interest in robotics continues to grow, robots are increasingly being integrated into everyday life. The results of this integration are end-users possessing less and less technical knowledge of the technology. For example, consider the application of mobile robots in the health care industry, where the intended end users are patients themselves. In this case, the need for simplified, reliable, and user-friendly robot designs is of utmost importance. Currently, the primary mode for robot communication uses RF (radio frequency). RF is an obvious choice for communication since it allows more information to be transferred at high speed and over long distance. However, creating RF network of long range for many simple applications is an impractical solution. This project explores the use of readymade RF networks for communication and device control. This eliminates the need of a new infrastructure and detailed technical research.

CHAPTER-2 ATMEL-AT89S52
2.1-General Description The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with 8K bytes of in-system programmable Flash memory. The device is manufactured using Atmels high-density non-volatile memory technology and is compatible with the industry- standard 80C51 instruction set and pin out. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional non-volatile memory programmer. By combining a versatile 8-bit CPU with in-system programmable Flash on a monolithic chip, the Atmel AT89S52 is a powerful microcontroller which provides a highly-flexible and cost-effective solution to many embedded control applications. The AT89S52 provides the following standard features: 8K bytes of Flash, 256 bytes of RAM, 32 I/O lines, Watchdog timer, two data pointers, three 16-bit timer/counters, a six-vector twolevel interrupt architecture, a full duplex serial port, on-chip oscillator, and clock circuitry. In addition, the AT89S52 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port, and interrupt system to continue functioning. The Power-down mode saves the RAM contents but freezes the oscillator, disabling all other chip functions until the next interrupt or hardware reset.

2.1.1 Features Compatible with MCS-51 Products 8K Bytes of In-System Programmable (ISP) Flash Memory Endurance: 1000 Write/Erase Cycles 4.0V to 5.5V Operating Range Fully Static Operation: 0 Hz to 33 MHz Three-level Program Memory Lock 256 x 8-bit Internal RAM 32 Programmable I/O Lines Three 16-bit Timer/Counters Eight Interrupt Sources Full Duplex UART Serial Channel Low-power Idle and Power-down Modes Interrupt Recovery from Power-down Mode Watchdog Timer Dual Data Pointer Power-off Flag

2.2 Block Diagram

Fig 2.1AT89S25 Block diagram

2.3 Pin Configuration

Fig 2.2 -PIDP40 Pin Configuration 2.4 Pin Description

VCC: Supply voltage. GND: Ground.

Port 0: Port 0 is an 8-bit open drain bidirectional 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 can 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 bidirectional 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.

Table 2.1- Pin description ofAT89S52

Port 2: Port 2 is an 8-bit bidirectional 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 2 emits the high-order address byte during fetches from external program memory and during accesses to external data memory that uses 16-bit addresses (MOVX @ DPTR). In this application, Port 2 uses strong internal pull-ups when emitting 1s. During accesses to external data memory that uses 8-bit addresses (MOVX @ RI), Port 2 emits the contents of the P2 Special Function Register. Port 2 also receives the high-order address bits and some control signals during Flash programming and verification.

Port 3: Port 3 is an 8-bit bidirectional 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. Port 3 receives some control signals for Flash programming and verification. Port 3 also serves the functions of various special features of the AT89S52, as shown in the following table. Table 2.2- Special features of port 3 in AT89S52

RST: Reset input. A high on this pin for two machine cycles while the oscillator is running resets the device. This pin drives High for 98 oscillator periods after the Watchdog times out. The DISRTO bit in SFR AUXR (address 8EH) can be used to disable this feature. In the default state of bit DISRTO, the RESET HIGH out feature is enabled.

ALE/PROG: Address Latch Enable (ALE) is an 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/6 the 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 9

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 microcontroller is in external execution mode.

PSEN: Program Store Enable (PSEN) is the read strobe to external program memory. When the AT89S51 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.

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.

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

2.5 Special Function Registers A map of the on-chip memory area called the Special Function Register (SFR) space is shown in Table 1. Note that not all of the addresses are occupied, and unoccupied addresses may not be implemented on the chip. Read accesses to these addresses will in general return random data, and write accesses will have an indeterminate effect. 2.5.1 Interrupt Registers The individual interrupt enable bits are in the IE register. Two priorities can be set for each of the five interrupt sources in the IP register. 10

Table 2.3- AUXR: Auxiliary Register

2.5.2 Dual Data Pointer Registers To facilitate accessing both internal and external data memory, two banks of 16bit Data Pointer Registers are provided: DP0 at SFR address locations 82H-83H and DP1 at 84H-85H. Bit DPS = 0 in SFR AUXR1 selects DP0 and DPS = 1 selects DP1. The user should always initialize the DPS bit to the appropriate value before accessing the respective Data Pointer Register.

2.6 Power off Flag The Power off Flag (POF) is located at bit 4 (PCON.4) in the PCON SFR. POF is set to 1 during power up. It can be set and rest under software control and is not affected by reset.

11

Table 2.4- AUXR1: Auxiliary Register 1.

2.7 Memory Organization MCS-51 devices have a separate address space for Program and Data Memory. Up to 64Kbytes each of external Program and Data Memory can be addressed. 2.8 Program Memory If the EA pin is connected to GND, all program fetches are directed to external memory. On the AT89S52, if EA is connected to VCC, program fetches to addresses 0000H through FFFH are directed to internal memory and fetches to addresses 1000H through FFFFH are directed to external memory. 2.9 Data Memory The AT89S52 implements 256 bytes of on-chip RAM. The 128 bytes are accessible via direct and indirect addressing modes. Stack operations are examples of indirect addressing, so the 256 bytes of data RAM are available as stack space.

12

2.10 Watchdog Timer (One-time enabled with reset-out) The WDT is intended as a recovery method in situations where the CPU may be subjected to software upsets. The WDT consists of a 14-bit counter and the Watchdog Timer Reset (WDTRST) SFR. The WDT is defaulted to disable from exiting reset. To enable the WDT, a user must write 01EH and 0E1H in sequence to the WDTRST register (SFR location 0A6H). When the WDT is enabled, it will increment every machine cycle while the oscillator is running. The WDT timeout period is dependent on the external clock frequency. When WDT overflows, it will drive an output RESET HIGH pulse at the RST pin. 2.10.1 Using the WDT To enable the WDT, a user must write 01EH and 0E1H in sequence to the WDTRST register (SFR location 0A6H). When the WDT is enabled, the user needs to service it by writing 01EH and 0E1H to WDTRST to avoid a WDT overflow. The 14-bit counter overflows when it reaches 16383 (3FFFH), and this will reset the device. When the WDT is enabled, it will increment every machine cycle while the oscillator is running. This means the user must reset the WDT at least every 16383 machine cycles. To reset the WDT the user must write 01EH and 0E1Hto WDTRST. WDTRST is a writeonly register. The WDT counter cannot be read or written. When WDT overflows, it will generate an output RESET pulse at the RST pin. The RESET pulse duration is 98xTOSC, where TOSC=1/FOSC. To make the best use of the WDT, it MCS-51 devices have a separate address space for Program and Data Memory. Up to 64K bytes each of external Program and Data Memory can be addressed.

2.11 UART The UART in the AT89S52 operates the same way as the UART in the AT89S52. Timer 0 and 1: Timer 0 and Timer 1 in the AT89S52 operate the same way as Timer 0 and Timer 1 in the AT89S52.

13

2.12 Interrupts The AT89S52 has a total of five interrupt vectors: two external interrupts (INT0 and INT1), two timer interrupts (Timers 0 and 1), and the serial port interrupt. These interrupts are all shown in Figure 1. Each of these interrupt sources can be individually enabled or disabled by setting or clearing a bit in Special Function Register IE. IE also contains a global disable bit, EA, which disables all interrupts at once. Note that Table 4 shows that bit position IE.6 is unimplemented. In the AT89S52, bit position IE.5 is also unimplemented. User software should not write 1s to these bit positions, since they may be used in future AT89 products. The Timer 0 and Timer 1 flags, TF0 and TF1, are set at S5P2 of the cycle in which the timers overflow. The values are then polled by the circuitry in the next cycle. Table 2.5- Interrupt Enable (IE) Register

14

2.13 Oscillator Characteristics XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier that can be configured for use as an on-chip oscillator, as shown in Figure 2.2(i). 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 2.2(j). 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 flipflop, but minimum and maximum voltage high and low time specifications must be observed.

Fig 2.3- Oscillator Connections

Fig 2.4-External Clock Drive Mechanism 15

2.14 Idle Mode In idle mode, the CPU puts itself to sleep while all the on-chip peripherals remain active. The mode is invoked by software. The content of the on-chip RAM and all the special function registers remain unchanged during this mode. The idle mode can be terminated by any enabled interrupt or by a hardware reset. Note that when idle mode is terminated by a hardware reset, the device normally resumes program execution from where it left off, up to two machine cycles before the internal reset algorithm takes control. On-chip hardware inhibits access to internal RAM in this event, but access to the port pins is not inhibited. To eliminate the possibility of an unexpected write to a port pin when idle mode is terminated by a reset, the instruction following the one that invokes idle mode should not write to a port pin or to external memory. 2.15 Power-down Mode In the Power-down mode, the oscillator is stopped, and the instruction that invokes Power down is the last instruction executed. The on-chip RAM and Special Function Registers retain their values until the Power-down mode is terminated. Exit from Power-down mode can be initiated either by a hardware reset or by activation of an enabled external interrupt into INT0 or INT1. Reset redefines the SFRs but does not change the on-chip RAM. The reset should not be activated before VCC is restored to its normal operating level and must be held active long enough to allow the oscillator to restart and stabilize. Table 2.6- Status of External Pins during Idle and Power-down Modes.

16

2.16 Programming the Flash Serial Mode The Code memory array can be programmed using the serial ISP interface while RST is pulled to VCC. The serial interface consists of pins SCK, MOSI (input) and MISO (output). After RST is set high, the Programming Enable instruction needs to be executed first before other operations can be executed. Before a reprogramming sequence can occur, a Chip Erase operation is required. The Chip Erase operation turns the content of every memory location in the Code array into FFH. Either an external system clock can be supplied at pin XTAL1 or a crystal needs to be connected across pins XTAL1 and XTAL2 (Fig 2.2(k)). The maximum serial clock (SCK) frequency should be less than 1/16 of the crystal frequency. With a 33 MHz oscillator clock, the maximum SCK frequency is 2MHz. 2.17 Power Supply Section This section is used for supplying the required power to the system(fig-2.2(a)). The power supply section mainly consist of : 1. Step down transformer (12-0-12). 2. Electronic Rectifier. 3. Filter. 4. Regulator.

Fig 2.2(a) power supply section

Fig 2.5-Block Diagram of Power supply

17

The main building block of any electronic system is the power supply to provide required power for their operation. For the microcontroller, keyboard, LCD, RTC, GSM, +5V are required & for driving buzzer +12V is required. The power supply provides regulated output of +5V & non-regulated output of +12V. The 3 terminals IC7805 meets the requirement of +5V regulated. The secondary voltage from the main transformer is rectified by electronic rectifier & filtered by capacitor. This unregulated DC voltage is supplied to the input pin of regulator IC. The IC used are fixed regulator with internal short circuit current limiting & thermal shutdown capability.

18

CHAPTER -3 ENCODERS AND DECODERS


3.1 Features of HT12D (Decoder) y y y y y y y y y y y y Operating voltage: 2.4V~12V Low power and high noise immunity CMOS technology Low standby current Capable of decoding 12 bits of information Binary address setting Received codes are checked 3 times Address/Data number combination HT12D: 8 address bits and 4 data bits Built-in oscillator needs only 5% resistor Valid transmission indicator Easy interface with an RF or an infrared transmission medium Minimal external components.

3.1.1 Description The decoders are a series of CMOS LSIs for remote control system applications. They are paired with Holteks 2 12 series of for proper operation, a pair of encoder/decoder with the same number of addresses and data format should be chosen. The decoders receive serial addresses and data from a programmed 2
12

series of encoders that are transmitted

by a carrier using an RF or an IR transmission medium. They compare the serial input data three times continuously with their local addresses. If no error or unmatched codes are found, the input data codes are decoded and then transferred to the output pins. The VT pin also goes high to indicate a valid transmission. The 2
12

series of decoders are

capable of decoding information that consists of N bits of address and 12_N bits of data. Of this series, the HT12D is arranged to provide 8 address bits and 4 data bits.

19

3.1.2-Block Diagram

Fig 3.1- Block diagram of HT12D (Decoder) 3.1.3-PIN Assignment 8-Address, 4-Data

Fig 3.2- HT12A-18 DIP 20

3.1.4 Pin Description Table3.1- Pin Description of HT12D (Decoder)

3.2 Functional Description 3.2.1 Operation The 2


12

series of decoders provides various combinations of addresses and data


12

pins in different packages so as to pair with the 2

series of encoders. The decoders

receive data that are transmitted by an encoder and interpret the first N bits of code period as addresses and the last 12_N bits as data, where N is the address code number. A signal on the DIN pin activates the oscillator which in turn decodes the incoming address and data. The decoders will then check the received address three times continuously. If the received address codes all match the contents of the decoders local address, the 12_N bits of data are decoded to activate the output pins and the VT pin is set high to indicate a valid transmission. This will last unless the address code is incorrect or no signal is received. The output of the VT pin is high only when the transmission is valid. Otherwise it is always low.

21

3.2.2 Output type Of the 2 12 series of decoders, the HT12F has no data output pin but its VT pin can be used as a momentary data output. The HT12D, on the other hand, provides 4 latch type data pins whose data remain unchanged until new data are received.

Fig 3.3- Decoder timing of HT12D

3.3-ENCODER 3.3.1 Features of HT12E (Encoder) y y y y y y y y y Operating voltage 2.4V~12V for the HT12E Low power and high noise immunity CMOS technology Low standby current: 0.1_A (typ.) at VDD=5V Minimum transmission word Four words for the HT12E Built-in oscillator needs only 5% resistor Data code has positive polarity Minimal external components HT12A/E: 18-pin DIP/20-pin SOP package.

3.3.2 General Description The 212 encoders are a series of CMOS LSIs for remote control system applications. They are capable of encoding information which consists of N address bits and 12_N data bits. Each address/ data input can be set to one of the two logic states. The 22

programmed addresses/data are transmitted together with the header bits via an RF or an infrared transmission medium upon receipt of a trigger signal. The capability to select a TE trigger on the HT12E or a DATA trigger on the HT12A further enhances the application flexibility of the 212 series of encoders. The HT12A additionally provides a 38 kHz carrier for infrared systems. 3.3.3 Block Diagram

Fig 3.4- Block diagram of HT12E (Encoder) 3.3.4-Pin Assignment

HT12E-18DIP Fig 3.5- Pin Configuration of HT12E (Encoder) 23

3.3.5 Pin Description

Table 3.2- Pin Description of HT12E( Encoder) 24

3.4 Functional Description

3.4.1 Operation The 212 series of encoders begin a 4-word transmission cycle upon receipt of a transmission enable (TE for the HT12E or D8~D11 for the HT12A, active low). This cycle will repeat itself as long as the transmission enable (TE or D8~D11) is held low. Once the transmission enables returns high the encoder output completes its final cycle and then stops as shown below.

Fig 3.6 Transmission timing for HT12E

3.4.2 Information word If L/MB=1 the device is in the latch mode (for use with the latch type of data decoders). When the transmission enable is removed during a transmission, the DOUT pin outputs a complete word and then stops. On the other hand, if L/MB=0 the device is in the momentary mode (for use with the momentary type of data decoders). When the transmission enable is removed during a transmission, the DOUT outputs a complete word and then adds 7 words all with the _1_ data code. An information word consists of 4 periods as illustrated below.

Fig 3.7 composition of information 25

3.4.3 Address/data waveform Each programmable address/data pin can be externally set to one of the following two logic states as shown below

Fig 3.8 Address/Data Bit wave form for HT12E

26

CHAPTER-4
RF-COMMUNICATION
Radio frequency (RF) is a rate of oscillation in the range of about 3 kHz to 300 GHz, which corresponds to the frequency of radio waves, and the alternating currents which carry radio signals. RF usually refers to electrical rather than mechanical oscillations, although mechanical RF systems do exist (see mechanical filter and RF MEMS). Special properties of RF current Electric currents that oscillate at radio frequencies have special properties not shared by direct current or alternating current of lower frequencies. The energy in an RF current can radiate off a conductor into space as electromagnetic waves (radio waves); this is the basis of radio technology. RF current does not penetrate deeply into electrical conductors but flows along their surfaces; this is known as the skin effect. For this reason, when the human body comes in contact with high power RF currents it can cause superficial but serious burns called RF burns. RF current can easily ionize air, creating a conductive path through it. This property is exploited by "high frequency" units used in electric arc welding, which use currents at higher frequencies than power distribution uses. Another property is the ability to appear to flow through paths that contain insulating material, like the dielectric insulator of a capacitor. When conducted by an ordinary electric cable, RF current has a tendency to reflect from discontinuities in the cable such as connectors and travel back down the cable toward the source, causing a condition called standing waves, so RF current must be carried by specialized types of cable called transmission line.

4.1 Radio communication In order to receive radio signals an antenna must be used. However, since the antenna will pick up thousands of radio signals at a time, a radio tuner is necessary to tune in to a particular frequency (or frequency range).[1] This is typically done via a resonator in its simplest form, a circuit with a capacitor and an inductor forming a tuned

27

circuit. The resonator amplifies oscillations within a particular frequency band, while reducing oscillations at other frequencies outside the band.

4.2 Frequencies Table 4.1- Different frequency ranges Frequency 300 - 3000 Hz 3 - 30 kHz Designation Voice frequency Very low frequency 30 - 300 kHz 300 kHz - 3 MHz 3 - 30 MHz 30 - 300 MHz Low frequency LF Abbreviation VF VLF

Medium frequency MF High frequency Very high frequency HF VHF

300 MHz - 3 GHz

Ultra high frequency

UHF

3 - 30 GHz

Super high frequency

SHF

30 - 300 GHz

Extra high frequency

EHF

4.3 RF module In many situations a communication link between to devices becomes essential. This communication can be wired or wireless. If two devices are close to each other (like a MCU and a Memory) a wired link is preferred. However in many situations two devices are reasonably far apart. In that case a wireless link is preferred. In our project RF communication is used to transmit the deflection information from the patient side module to other remote module.

28

Because of its usefulness RF is widely used, including Bluetooth, Radios, Cell phones, Satellite etc. It has Wide range, from few meters to millions of kilometers (Can be Used to control Robots in Mars). It does not requires two devices to be in line of sight and can cross many obstacles. A RF Module is a small circuit pre built and tested. They comes in Pair. One is RX or the receiver and other is a TX or Transmitter. They have reasonable range and works very good. Typical data rate is 1000 bits per seconds. The following figure shows the typical RF pair modules

Fig 4.1- Transmitter and Receiver The Pins description of TX and RX are mentioned below
y

TX 1. Antenna 2. Vcc (Positive Supply) 3. DATA (Data Input) 29

4. GND
y

RX 1. Antenna 2. GND 3. GND 4. Vcc (Positive Supply) 5. Vcc (Positive Supply) 6. DATA 7. DATA 8. GND

The working of RF module is as shown in figure

Fig 4.2: Working principle of RF module They can be directly interfaced to a microcontroller or can be used in remote control applications with the help of encoder/decoder ICs. The encoder IC takes in parallel data at the TX side packages it into serial format and then transmits it with the help of a RF transmitter module. At the RX end, the decoder IC receives the signal via the RF receiver module, decodes the serial data and reproduces the original data in the parallel format. HT12E and HT12D are 4 channel encoder/decoder ICs directly compatible with the specified RF module. The schematic is as shown below 30

4.4 Transmitter

Fig 4.3- Transmitter circuit Diagram

4.5 Receiver

Fig 4.4- Receiver Circuit Diagram

31

4.6 INFRARED IN ELECTRONICS Infra-Red is interesting, because it is easily generated and doesn't suffer electromagnetic interference, so it is nicely used to communication and control, but it is not perfect, some other light emissions could contains infrared as well, and that can interfere in this communication. The sun is an example, since it emits a wide spectrum or radiation. The adventure of using lots of infra-red in TV/VCR remote controls and other applications, brought infra-red diodes (emitter and receivers) at very low cost at the market. The red light means something to the receiver, the "on or off" radiation can transmit different meanings .Lots of things can generate infrared, anything that radiate heat do it, including out body, lamps, stove, oven, friction your hands together, even the hot water at the faucet. To allow a good communication using infra-red, and avoid those "fake" signals, it is imperative to use a "key" that can tell the receiver what is the real data transmitted and what is fake. As an analogy, looking eye naked to the night sky you can see hundreds of stars, but you can spot easily a far away airplane just by its flashing strobe light. That strobe light is the "key", the "coding" element that alerts us. Similar to the airplane at the night sky, our TV room may have hundreds of tinny IR sources, our body, and the lamps around, even the hot cup of tea. A way to avoid all those other sources, is generating a key, like the flashing airplane. So, remote controls use to pulsate its infrared in a certain frequency. The IR receiver module at the TV, VCR or stereo "tunes" to this certain frequency and ignores all other IR received. The best frequency for the job is between 30 and 60 kHz, the most used is around 36 kHz. So, remote controls use the 36 kHz (or around) to transmit information. Infrared light emitted by IR Diodes is pulsated at 36 thousand times per second, when transmitting logic level "1" and silence for "0".To generate a 36kHz pulsating infrared is quite easy, more difficult is to receive and identify this frequency. This is why some companies produce infrared receives, that contains the filters, decoding circuits and the output shaper, that delivers a square wave, meaning the existence or not of the 36kHz incoming pulsating infrared.

32

It means that those 3 dollars small units, have an output pin that goes high (+5V) when there is a pulsating 36kHz infrared in front of it, and zero volts when there is not this radiation. A square wave of approximately 27S (microseconds) injected at the base of a transistor, can drive an infrared LED to transmit this pulsating light wave. Upon its presence, the commercial receiver will switch its output to high level (+5V).

Fig 4.5 Squrare Wave Form of Infrared light If you can turn on and off this frequency at the transmitter, your receiver's output will indicate when the transmitter is on or off.

Fig 4.6: Receiver output given to the Transmitter Input 33

4.7 PULSE WIDTH MODULATION Pulse width modulation is used when a digital system needs to control a system that expects an analog signal of varying amplitude. A typical example is a 12 V motor: the speed of the rotor can be regulated by changing the voltage from low (0 V) to high (12 V). At 12V the motor will go at full speed. The alternative is to pass the rotor always 12V, but in discrete pulses, as shown in Fig. 1. If 20% of the time is filled by pulses (20% Duty cycle), then the motor will receive small kicks that keep it running at a low percentage of full speed. The motor runs smoothly because of the inertia of the rotor and because the frequency of the pulses can be adjusted.

Figure 4.7-A PWM signal and three different duty cycles

A PWM is, in some sense, a special purpose digital to analog converter. Most microcontrollers provide one or more PWM output lines. The advantage of controlling a motor with PWM instead of a real analog signal is that the full torque of the motor can be used. In DC motors, there is a linear relationship between the voltage supplied and the torque obtained from the motor: the higher the voltage, the higher the torque. Think of a small motor used for moving a loaded car. If the analog voltage is too low, the motor will not move, because of the load and friction 34

between the wheels and the floor. We have to start increasing the voltage until at some point the wheels move and the car goes away at great speed (because dynamical friction is lower than static friction). A PWM signal, on the other side, gives always a full kick to the motor. For a short period of time the motor rotates with its full torque. Speed control is done by spacing the pulses as needed, thst is, by adjusting the duty cycle of the signal. In this way, the speed of a car can be controlled in a much smoother way. The motor exerts always the same torque, but during a different percentage of time. PWM, or Pulse Width Modulation, refers to the method of applying a square wave signal to a fan that will vary its speed by changing the signal duty cycle:

Fig4.8: example of a PWM signal

T is the period in (s). F = 1/T is the frequency in (Hz). (Ton / T) is the Duty Cycle in (%). The frequency is always constant, what changes are the duty cycle: An 80% duty cycle indicates that the fan is ON 80% of the time and OFF 20% of the time. A 50% duty cycle signal indicates that the fan is ON 50% of the time and OFF 50% of the time (similar to a perfect square waveform signal). Using digital pulses to create some analog value other than just high and low signal levels. Many digital systems are powered by a 5-Volt power supply, so if you filter a signal that has a 50% duty cycle you get an average voltage of 2.5 Volts. Other duty cycles produce any voltage in the range of 0 to 100% of the high voltage, depending upon the PWM resolution. 35

The duty cycle is defined as the percentage of digital high to digital low signals present during a PWM period. The PWM resolution is defined as the maximum number of pulses that you can pack into a PWM period. The PWM period is an arbitrarily time period in which PWM takes place. It is chosen to give best results for your particular use.

Fig 4.9:Variation of PWM with Respect to Duty Cycle

4.7.1-Uses for PWM y To digitally create an analog output voltage level for control functions and power supplies. y To digitally create analog signals for arbitrary waveforms, sounds, music and speech. y Duty cycle in the PWM is given by the following relation

36

Fig 4.10: The Wave form at different % of Duty Cycle

4.8 DC Motors For the movement of our robot, we are using DC motors. It is operated by 12Volts DC power supply. 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) as shown in Figure.6

37

Fig 4.11: 2-Pole DC Electric 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 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, driving it to continue rotating as shown in Figure.7.

38

Fig 4.12: 2 pole DC motor showing Rotor movement In real life, though, DC motors will always have more than two poles (three is a very common number). In particular, this avoids "dead spots" in the commutator. You can imagine how with our example two-pole motor, if the rotor is exactly at the middle of its rotation (perfectly aligned with the field magnets), it will get "stuck" there. Meanwhile, with a two-pole motor, there is a moment where the commutator shorts out the power supply (i.e., both brushes touch both commutator contacts simultaneously). This would be bad for the power supply, waste energy, and damage motor components as well. Yet another disadvantage of such a simple motor is that it would exhibit a high amount of torque "ripple" (the amount of torque it could produce is cyclic with the position of the rotor). In small motors, an alternative design is often used which features a 'coreless' armature winding. This design depends upon the coil wire itself for structural integrity. As a result, the armature is hollow, and the permanent magnet can be mounted inside the rotor coil. Coreless DC motors have much lower armature inductance than iron-core motors of comparable size, extending brush and commutator life. The internal architecture of the small DC motor is as shown in Figure.8

39

Fig 4.13: Components of DC Motor The Physical diagram of DC motor what we are using DC motor in our robot is shown in Figure.9

Fig 4.14: DC Motor (Mabuchi RS-550) This is a Mabuchi RS-550 motor with a 3-pole balanced armature. This is the standard motor for our 42 mm series Gear motors. The Motor specification is mentioned below.

4.8.1Motor Specification

Table 4.2: List of operating properties of Motor Operating v Nominal v No Load RPM No Load A Stall Torque 6v - 14.4v 12v 19300 1.2A 70.55 oz-in 498.2 mN-m

40

Stall Current Kt Kv Efficiency RPM - Peak Eff Current - Peak Eff

85A 0.83 oz-in/A 5.9 mN-m/A 1608 rpm/V 70% 17250 10A

Physical Table 4.2: List of Physical Dimensions of Motor Weight Length - for motor Diameter (with flux ring) Diameter (no flux ring) Shaft Diameter Shaft Length Mounting Screws (2) 7.7 oz 2.24 in 1.52 in 1.41 in 0.12 in 0.3 in (218g) (57mm) (38.5mm) (35.8mm) (3.2mm) (7.6mm) M3

4.9.1 Description

The Device is a monolithic integrated high voltage, high current four channel driver designed to accept standard DTL or TTL logic levels and drive inductive loads (such as relays solenoids, DC and stepping motors) and switching power transistors. To simplify use as two bridges each pair of channels is equipped with an enable input. A separate supply input is provided for the logic, allowing operation at a lower voltage and internal clamp diodes are included. This device is suitable for use in switching applications at frequencies up to 5 kHz. The L293D is assembled in a 16 lead plastic package which has 4 center pins connected together and used for heat sinking.

41

4.9.2 Block Diagram

Fig 4.15: Block Diagram of L293D 4.9.3 PIN Connections

Fig 4.16: Pin Configuration of L293D The chip is designed to control 2 DC motors. There are 2 Input and 2 output pins for each motor. 42

The behavior of motor for various input are as follows

A Stop Clockwise Anti Clockwise Stop Low Low High High

B Low High Low High

4.10 Mini Wireless Monitoring Video Camera and Receiver Set - PAL

Fig4.17: Video Camera and Wireless Receiver Mini wireless monitoring video camera and wireless receiver set for home and small business surveillance.

How does this system work? Simply install the wireless camera in the room you want to monitor and set the wireless receiver in the next room (up to 15 meters away) and hook it up to a TV or DVR to watch the action or record the footage for your security records.

Wireless camera monitoring sets are popular for keeping an eye on your employees while 43

you're sitting in your office, watching what your children are doing while they are unattended, or install one looking out to the street to see who it is before you open your front door. Better still, the CMOS camera sensor and 2.4 GHz video stream creates full color imagery that is easy to view on even a small monitoring LCD while being wireless, meaning the camera and receiver are easy for DIY installation for almost anyone.

The CVD-310A802 comes at a budget price that makes this mini wireless video camera and receiver set a very economical way to meet your business or family security monitoring or light surveillance needs. It is available right now at great wholesale prices with no M.O.Q. (no minimum order quantity) from the leader in direct from China wholesale electronics, Chinavasion.

4.11 Manufacturer Specifications 4.11.1 Receiver Specification


          

Receiving Frequency: ISM 2400~2481Mhz Intermediate Frequency: 480Mhz Frequency Stabilization: +/-100Khz Demodulation Mode: FM Antenna: 50ohm SMA Receiving Sensitivity: <-85dBm Video Output: 1Vp-p@75, S/N>38dB Audio Output: 1Vp-P@600 Power: Wall power adapter Dimensions: 96mm x 79mm x 30mm (L x W x D) Channels: Four Channels (no interference from other devices) 44

4.11.2 Camera Specification


                   

Image Device: 1/3 Inch Omni Vision CMOS TV system: PAL 628(H) x 568(V) Horizontal Definition: 380TV Line Angular Field of View: 45deg (f=6mm) Minimum Illumination: 0.1 Lux Built in 30 IR LED for 12M night vision range Synchronization System: Internal Scanning Freq(H): 15.625KHz PAL Scanning Freq(V): 50Hz PAL Backlight Compensation: Auto Electronic Shutter: 1/50(1/60)~1/100,000sec White Balance: Auto S/N Ratio: >48dB Gamma Correction: >0.45 Operation Temperature: -10~50 deg C Transmission Frequency: ISM 2,400~2483MHz Power: Wall power adapter Dimension: 44mm x 100mm (W x L) Built in Microphone Recommended Viewing Range for Objects at night: 1-12M. Max effective range 12M 45

Recommended Viewing Range for Objects at Day: 1-12M. Max effective range 17M

  

Transmission Range: 15 M without interference Manufacturer Ref: B5C3B175A5 Catalog Ref: Wireless covert video security, wireless video spy camera, spy cam

4.12 Package Contents for Model CVD-310A802-PAL


   

Wireless surveillance set (Camera and Receiver) 2x wall power adapter (1x transmitter, 1x receiver) Instructions - English AV cable

Fig4.18: Model CVD-310a802-PAL

46

4.13 Softwares y y y Embedded C using KEIL IDE software. The system program written in embedded C will be stored in Microcontroller . The following are some of the major reasons for writing programs in C instead of assembly It is easier and less time consuming to write in C than assembly. C is easier to modify and update. You can use code available in function libraries. C code is portable to other microcontrollers with little or no modification. y Keil development tools for the P89V51RD2 Microcontroller Architecture support every level of software developer from the professional applications engineer to the student just learning about embedded software development. y The industry-standard Keil C Compilers, Macro Assemblers, Debuggers, Realtime Kernels, Single-board Computers, and Emulators support all P89V51RD2 derivatives and help you get your projects completed on schedule. y The Keil P89V51RD2 Development Tools are designed to solve the complex problems facing embedded software developers. Is this possible if we use hard reset (Logic 1 Pulse with some delay) by using ISR and one Port Pin Connected to RESET Pin? so that Controller can RESET itself by Applying RESET signal by ISR. I mean Software cum Hardware RESET! y Flash magic is used to dump the code to microcontroller from PC

47

Scope of future work


The robot which is programmed can be further implemented with following features which makes the robot more reliable. i). Distance sensing and position logging & transmission helps in sensing long range and can easily transfer the data to long distances. ii). Use of solar power makes more comfortable for the long run of the robot in the enemy field with less power consumption. iii). Multiple sensors like thermal helps in detecting the fire and can give a alarm to avoid the fire accidents. iv). Radar Implementation is to determine the range, altitude, direction, or speed of both moving and fixed objects such as aircraft, ships, spacecraft, guided missiles, motor vehicles, weather formations, and terrain v). The Robot can be Equipped with Missiles to attack the enemies in the war field. vi). Night vision helps robot to move in night condition and to find out the enemies hiding place.

48

CONCLUSIONS A defence surveillance robot was designed in the project. Using the RF remote control for long range sensing and data transmission. And sensors to sense the path and obstacles. Controller program was designed so as to enable the microcontroller to control robot, using RF remote and movement of the robot and move when there is no obstacle in the following path. The program could also read data from sensors and produce the controlling actions respectively. The motor drivers are used to drive the motor. Obstacle sensors are used to change the movement of robot when the robot faces an obstacle on the path. Video Camera is interfaced with TV capture card to view the video of the path travelled by robot and collects the information about the enemies. The project has been accomplished with the help of KEIL C compiler and ATMEL programmer. The project has been tested successfully and it is running successfully to the defined program.

49

BIBLIOGRAPHY REFERENCE BOOKS [1] Muhammad Ali Mazidi , THE 8051 MICROCONTROLLER AND EMBEDDED SYSTEMS, Pearson education, [2] Ayala- INTRODUCTION TO 8051 MICROCONTROLLER SOFTWARES [3] Keil C51 compiler user guide (Keil Software V3.60) WEB LINKS

[1] http://www.8052.com [2] http://www.google.com [3] http://www.robotroom.com [4] http://www.roboticsindia.com [5] http://www.wekipedia.org [6] http://www.keil.com [7] http://www.datasheetarchive.com [8] http://www.atmel.com [9] http://www.8051projects.info [10] http://www.8051projects.net [11] http://www.rentron.com APPENDIX

Reference: http://www.seminarprojects.com/Thread-defense-surveillance-robot-fullreport#ixzz1PWTn90GS

50