Top Banner
4 9 ABSTRACT Robots are moving out of the realm of science fiction and into real-life applications, with the usage of robots in industry, food service and health care. Robots have long been used in assembling machines, but reliability was a problem as was the need to design products so that robots could assemble them. Now with better controls and sensors, and the use of complex programming, robots are being used in areas dangerous to humans, such as nuclear power plants. While robots have not proved successful in food service, where the interaction with humans and the tasks they must perform require robots more sophisticated than in industry, hospitals use Transition Research Corp's $60,000 Helpmate robot to deliver patient food trays and carry records and supplies. Robots may fulfill their potential in surgery, however, if they can be used to perform operations,
90

Micro Controller Based Rf Rbotic Car

Sep 09, 2014

Download

Documents

Pradeep Verma
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Micro Controller Based Rf Rbotic Car

49

ABSTRACT

Robots are moving out of the realm of science fiction and into real-life applications, with the usage of robots in industry, food service and health care. Robots have long been used in assembling machines, but reliability was a problem as was the need to design products so that robots could assemble them. Now with better controls and sensors, and the use of complex programming, robots are being used in areas dangerous to humans, such as nuclear power plants. While robots have not proved successful in food service, where the interaction with humans and the tasks they must perform require robots more sophisticated than in industry, hospitals use Transition Research Corp's $60,000 Helpmate robot to deliver patient food trays and carry records and supplies. Robots may fulfill their potential in surgery, however, if they can be used to perform operations, such as hip replacement, that require cuts more precise than any human could make. An obstacle to the successful use of robots is the need for complex rules of behavior in their programming.

Page 2: Micro Controller Based Rf Rbotic Car

49

This aim of this project is to drive a small toy car through Radio Frequency which is able to move at 3600 at a very constant speed.

Page 3: Micro Controller Based Rf Rbotic Car

49

INTRODUCTION

“CONCEPTUAL DESIGN DEVELOPMENT & DEMONSTRATION OF A

MICROCONTROLLER BASED RF ROBOTIC CAR ”

OBJECTIVES

To Design a circuit of an electronic intelligent robot car using DTMF frequency.

Develop new ideas to implement this circuit purposely.

To study the circuitry and different types of components & DTMF coder, DTMF decoder, FM transmitter, FM receiver and software in assembly language in the circuit.

Robotics technology has matured to a point where these have many research and industrial application. Robots have been used to replace people in production line and are ideally suited for repetitive work. The Robot Institute of America defines a robot as “a programmable multifunctional manipulator designed to move material, parts and tools of

Page 4: Micro Controller Based Rf Rbotic Car

49

specialized device through variable programmed of variety of tasks”

Many engineering colleges and hobbyists have fabricated robots to bring out the technique involved but almost all are cardboard or plywood model and generally are just static robot arms. The robot described in this article, which the author and his associate have fabricated, is a ‘mobile’ reprogram able robot

To understand the entire contraction, it is essential to know the main subsystem of the robot. Mechanical assembly is the actual working component of the robot. This robot has four degrees of freedom and for mobility it has a mobile platform (with four wheels); the rear wheels impart drive and front wheel impart steering.

The mechanical assembly is powered by a total of two gear motors, a use for left and right turn and one for the mobile platform. Gear motors have been selection because these function in precise steps based on the input pulses fed to them. These are ideally suited for the type of precision and accuracy involved. The desired actions of the robot are controlled with the help of microcontroller software, which actually decides the various gear motors. The output pulses from the 89C51 microcontroller are of at logic 0, while the

Page 5: Micro Controller Based Rf Rbotic Car

49

gear motors used in this project are either rated 3V DC and hence a power driver circuits per phase has been introduced. It is basically an electronic switch, which is triggered on with the pulses from the microcontroller.

Page 6: Micro Controller Based Rf Rbotic Car

49

THE BASIC OPERATION

The mechanical assembly is powered by a total of two auto gear motor for the robot ‘CAR’ and one for the mobile platform. Motors have been selected because these function in precise steps, based on the input pulses fed to them. These are ideally suited for the type of precision and accuracy involved. The desired actions of the robot car are controlled with the help of software, which actually decides the sequence of pulses to be fed to the various motor.

The output pulses from the 89c51 microcontroller are of at logic 0, while the motors used in this project are either rated and hence a power driver circuit per phase has been introduced. It is basically an electronic switch, which is triggered ‘on’ with the pulses from the microcontroller.

Page 7: Micro Controller Based Rf Rbotic Car

49

BLOCK DIAGRAM

Page 8: Micro Controller Based Rf Rbotic Car

49

CONSTRUCTION AND WORKING

POWER SUPPLY: This circuit has +5V output at about 500mA current. The circuit utilizes the voltage regulator IC 7805 for the constant power supply.LOGIC CONTROLLER: This section switches deferent frequency of DTMF coder with microcontroller.DTMF CODER SECTION: It section has a DTMF generator IC which generates the DTMF signal corresponding to the number entered from the transmitter keyboard.FM TRANSMITTER SECTION: The circuit presented here uses a simple principle of transmitting modulated FM frequency to DTMF.FM RECEIVER: The receiver unit consists of an FM receiver (these days simple and inexpensive FM kits are readily available in the market which work exceptionally well), a DTMF-to-BCD converter. The frequency modulated DTMF signals are received by the FM receiver and the outputs (DTMF tones) are fed to the dedicated IC UM91214 which is a DTMF-to-BCD converter.DTMF DECODER: It is fed to DTMF frequency, which gives the binary output corresponding to the signal received from the FM transmitter.MICROCONTROLLER: This section selected to drive relay according to binary output of DTMF decoder.

RELAY DRIVER: Its section controls the relay. Relay drives the dc motor. PNP transistor section drives the relay.

Page 9: Micro Controller Based Rf Rbotic Car

49

MECHANICAL ASSEMBLY: It is controlled by relay and dc Motor.

Page 10: Micro Controller Based Rf Rbotic Car

49

CIRCUIT DIAGRAMS

TRANSMITTER

Page 11: Micro Controller Based Rf Rbotic Car

49

RECEIVER

Page 12: Micro Controller Based Rf Rbotic Car

49

PROJECT SPECIFICATIONS

RF TRANSMITTER

Here is a circuit of a remote control unit which makes use of the radio frequency signals to control various any appliances. This remote control unit has 4 channels which can be easily extended to 12. This circuit differs from similar circuit published earlier in EFY in view of its simplicity and a totally different concept of generating the control signals.

This circuit is design and implementation of data transmission through radio frequency signal. This is an electronic FM transmitter device which is transmitted voice & data. The FM transmitter has better sound quality than AM transmitter. So an FM transmitter circuit has been made with T1, L1 and some external components. The FM transmitter described is to be used as a cordless microphone. Transmitted frequency is FM modulated so one can listen to the voice & data through a standard FM radio receiver (88-108MHz). Transmitted frequency is about 96 MHz.

Page 13: Micro Controller Based Rf Rbotic Car

49

It is worked as a voice transmission at FM radio receiver. It is used as a cordless microphone and used in walkie-talkie for voice transmission. The FM transmitter has better sound quality than AM transmitter.

The R.F. signal has evolved into a system of significantly greater importance and use. Throughout the world, it is now being used to transmit voice, television and data signals as R.F. waves. Its advantages as compared with conventional coaxial cable or twisted wire pairs are manifold. As a result, millions of dollars are being spent to put this R.F. wave communication system into operation.

One of the most interesting developments in recent years in the field of telecommunication is the use of R.F. signal to carry information over large wireless distances. It has been proved in the past decades that signal transmission through R.F. is superior to that achieved through wireless links. Typically, R.F. signal has a much lower transmission loss per unit length (0.15-5db/km) and is not susceptible to electromagnetic interference. Economically also, it serves our purpose. The ever increasing cost and the lack of space available in the congested

Page 14: Micro Controller Based Rf Rbotic Car

49

metropolitan cities asks for advent of a less costly system.

WORKINGFrequency modulation of the carrier at the

receiver unit, these frequency modulated signals are intercepted to obtain DTMF tones at the speaker terminals. This DTMF signal is connected to a DTMF-to-BCD converter usually remote control circuits make use of infrared light to transmit control signals. Their use is thus limited to a very confined area and line-of-sight. However, this circuit makes use of radio frequency to transmit the control signals and hence it can be used for control form almost anywhere in the house. Here we make use of DTMF signals (used in telephones to dial the digits) as the control codes. The DTMF tones are used for whose BCD output is used

Page 15: Micro Controller Based Rf Rbotic Car

49

to switch-on and switch –off various any appliances (4 in this case).

The remote control transmitter consists of DTMF generator and an FM transmitter circuit. For generating the DTMF frequencies, a dedicated IC UM91214B (which is used as a dialer IC in telephone instruments) is used here. This IC in telephone instruments) is used here. This IC requires #volts for its operation. This is provided by a simple zener diode voltage regulator which converts 9V into 3V for use by this IC. For its time base, it requires a quartz crystal of 3.58 MHz. This is easily available from electronic component shops. Pins1 and 2 are used as, chip select and DTMF mode select pins respectively. When the row and column pins (12 and 15) are shorted to each other, DTMF tones corresponding to digit 1 are output form its pin 7. Similarly, pins 13, 16 and 17 are additionally required to dial digits 2, 4 and 8. Rest of the pins of this IC may be left as they are.

In the next section of an FM transmitter, the output of IC 1 is given to the input of this transmitter circuit which effectively frequency modulates the carrier and transmits it in the air. The carrier frequency is determined by coil L1 and trimmer capacitor VC 1. an antenna be sufficient of provide adequate range the antenna is also necessary be use

Page 16: Micro Controller Based Rf Rbotic Car

49

the transmitter unit has to be used in a metallic cabinet to protect the frequency drift caused due to stray EM fields. Four key switches (DPST push- to- on spring loaded) are required to transmit the desired DTMF tones. The switches when pressed generate the specific tone pairs as well as provide power to the transmitter circuit simultaneously. This way when the transmitter unit is not in use it consumes no power at all and the battery lasts much longer.

The receiver unit consists of an FM receiver (these days simple and inexpensive FM kits are readily available in the market which work exceptionally well), a DTMF-to-BCD converter and a flip-flop toggling latch section. The frequency modulated DTMF signals are received by the FM receiver and the output (DTMF tones) is fed to the dedicated IC 8870 which is a DTMF-to-BCD converter. This IC when fed with the DTMF tones gives corresponding BCD output; for example, when digit 1 is pressed, the output is 0001 and when digit 4 is pressed the output is 0100. This IC also requires a 3.8 MHz. Crystal for its operation. The tone input is connected to its pin 2 and the BCD outputs are taken form pins 11 to 14 respectively. These

Page 17: Micro Controller Based Rf Rbotic Car

49

outputs are fed to microcontroller witch control to relay with transistor.

Page 18: Micro Controller Based Rf Rbotic Car

49

TRANSMITTER CIRCUIT DIAGRAM

Page 19: Micro Controller Based Rf Rbotic Car

49

BASIC ELEMENTS OF R.F. SYSTEM

Radio frequency (R.F.) or high frequency (H.F.) alternating voltages and currents have frequencies greater than about 30 kHz. They are important in radio, television and other branches of telecommunications and are grouped roughly into bands(see Table)

CLASSIFICATION OF FREQUENCY BAND

FREQUENCY BAND CLASSIFICATION

30 kHz - 300 kHzLow frequency

(L.F.)

300 kHz – 3 MHzMedium

frequency (M.F.)

3 MHz. – 30 MHzHigh frequency

(H.F.)

30 MHz – 300 MHzVery high

frequency (V.H.F.)

300MHz – 3 GHzUltra high

frequency (U.H.F)

Above 3 GHzSuper high frequency

We will not consider them.

Page 20: Micro Controller Based Rf Rbotic Car

49

Oscillator, both A.F. and R.F., are

generators of alternating voltage and current and are basically amplifiers which supply their own input using positive Radio frequency amplifiers are similar in many ways to audio frequency amplifiers. They must have a load in their output circuit (to convert changing currents to changing voltages) and need to be correctly biased (for linear operation). However, they are only required to amplify a narrow band of frequencies and so have to be selective. Also, their design, especially for higher frequency work, has to allow for certain capacitance effects that can be neglected at audio frequencies.

High-power R.F. amplifiers which produce up to hundreds of kilowatts o power use thermionic valves since present-day transistor cannot cope with the heat that has to be dissipated for such powers. They are employed mainly in radio and television transmitters’ feedback.

Two circuits that are important in the operation of R.F. amplifiers and oscillators will be discussed first.

Page 21: Micro Controller Based Rf Rbotic Car

49

Page 22: Micro Controller Based Rf Rbotic Car

49

POWER SUPPLY

Perhaps all of you are aware that a power supply is a primary requirement for the test bench of a home experimenter’s mini lab. A battery eliminator can eliminate or replace the batteries of solid-state electronic equipment and 220V A.C. mains instead of the batteries or dry cells thus can operate the equipment. Nowadays, the sued of commercial battery eliminator or power supply unit have become increasingly popular as power source for household appliances like transceiver,

record player, clock etc.

SUMMARY OF POWER SUPPLY CIRCUIT FEATURES:-

Brief description of operation: gives out well regulated +8V output, output current capability of 500mA.

Circuit protection: Built –in overheating protection shuts down output when regulator IC gets too hot.

Circuit complexity: Simple and easy to build.

Page 23: Micro Controller Based Rf Rbotic Car

49

Circuit performance: Stable +5V output voltage, reliable Operation.

Availability of components: Easy to get, uses only common basic components.

Design testing: Based on datasheet example circuit, I have used this circuit successfully as part of other electronics projects.

Applications: part of electronics devices, small laboratory power supply.

Power supply voltage: unregulated 8-18V-power supply.

Power supply current: needed output current 500 mA.

Components cost: Few rupees for the electronic components plus the cost of input transformer.

Page 24: Micro Controller Based Rf Rbotic Car

49

Pin Diagram of 7805 Regulator IC

Pin 1: Unregulated voltage inputPin 2: Ground Pin3: Regulated voltage output

Component list used at various pins:

1. 7805 regulator IC2. 9V DC Battery. 3. 0.01uf. Capacitor, at least 25V

voltage rating.

Page 25: Micro Controller Based Rf Rbotic Car

49

DESCRITION OF POWER SUPPLY

This circuit is a small + 8 volts power supply. This is useful when experimenting with digital electronics. Small inexpensive battery with variable output voltage are available, but usually their voltage regulation is very poor, which makes them not very usable for digital circuit experimenter unless a better regulation can be achieved in some way. The following circuit is the answer to the problem.

This circuit can give +8V & +5V output at about 500mA current. The circuit has overload and terminal protection.

Page 26: Micro Controller Based Rf Rbotic Car

49

Page 27: Micro Controller Based Rf Rbotic Car

49

CIRCUIT DESCRIPTION:This system is divided into two sections

1: Remote Section

2: Local Control Section

REMOTE SECTION:

           This unit consists of the DTMF encoder which resembles the mobile phone set. It uses DTMF encoder integrated circuit, Chip UM 91214B. This IC produces DTMF signals. It contains four row frequencies & three column frequencies. The pins of IC 91214 B from 12 to 14 produces high frequency column group and pins from 15 to 18 produces the low frequency row group. By pressing any key in the keyboard corresponding DTMF signal is available in its output pin at pin no.7. For producing the appropriate signals it is necessary that a crystal oscillator of 3.58MHz is connected across its pins 3 & 4 so that it makes a part of its internal oscillator.

Page 28: Micro Controller Based Rf Rbotic Car

49

Figure. Circuit Diagram Of The DTMF Encoder

 This encoder IC requires a voltage of 3V. For that IC is wired around 4.5V battery. And 3V backup VCC for this IC is supplied by using 3.2v zener diode.

The row and column frequency of this IC is as on the fig. "B". By pressing the number 5 in the key pad the output tone is produced which is the resultant of addition of two frequencies, at pin no. 13 & pin no.16 of the IC and respective tone which represents number '5' in key pad is produced at pin no.7 of the IC. This signal is sent to the local control system through telephone line via exchange.

Page 29: Micro Controller Based Rf Rbotic Car

49

RF RECEIVER

LOCAL CONTROL SECTION:

This is a control unit through which you can control your DC motor. Local Control Section consists of a DTMF decoder, and relay driver circuits. Before going into detail of the circuit, we will take a brief description about integrated circuits used in local control section.

MT 8870 DTMF Decoder:

IC MT8870/KT3170 serves as DTMF decoder. This IC takes DTMF signal coming via mobile phone and converts that signal into respective BCD number. It uses same oscillator frequency used in the remote section so same crystal oscillator with frequency of 3.85M Hz is used in this IC.

WORKING OF IC   MT 8870:

The MT-8870 is a full DTMF Receiver that integrates both band split filter and decoder functions into a single 18-pin DIP. Its filter section uses switched capacitor technology for both the high and low group

Page 30: Micro Controller Based Rf Rbotic Car

49

filters and for dial tone rejection. Its decoder uses digital counting techniques to detect and decode all 16 DTMF tone pairs into a 4-bit code. External component count is minimized by provision of an on-chip differential input amplifier, clock generator, and latched tri-state interface bus. Minimal external components required include a low-cost 3.579545 MHz crystal, a timing resistor, and a timing capacitor. The MT-8870-02 can also inhibit the decoding of fourth column digits.

MT-8870 operating functions include a band split filter that  separates the high and low tones of the received pair, and a digital decoder that verifies both the frequency and duration of the received tones before passing the resulting 4-bit code to the output bus. 

The low and high group tones are separated by applying the dual-tone signal to the inputs of two 6th order switched capacitor band pass filters with bandwidths that correspond to the bands enclosing the low and high group tones.

Page 31: Micro Controller Based Rf Rbotic Car

49

Figure. Block diagram of IC   MT8870

The filter also incorporates notches at 350 and 440 Hz, providing excellent dial tone rejection. Each filter output is followed by a single-order switched capacitor section that smoothes the signals prior to limiting. Signal limiting is performed by high gain comparators provided with hysteresis to prevent detection of unwanted low-level signals and noise. The MT-8870 decoder uses a digital counting technique to determine the frequencies of the limited tones and to verify that they correspond to standard DTMF frequencies. When the detector recognizes the simultaneous presence of two valid tones (known as

Page 32: Micro Controller Based Rf Rbotic Car

49

signal condition), it raises the Early Steering flag (ESt). Any subsequent loss of signal condition will cause ESt to fall. Before a decoded tone pair is registered, the receiver checks for valid signal duration (referred to as character- recognition-condition). This check is performed by an external RC time constant driven by ESt. A short delay to allow the output latch to settle, the delayed steering output flag (StD) goes high, signaling that a received tone pair has been registered. The contents of the output latch are made available on the 4-bit output bus by raising the three state control input (OE) to logic high. Inhibit mode is enabled by a logic high input to pin 5 (INH). It inhibits the detection of 1633 Hz.

The output code will remain the same as the previous detected code. On the M- 8870 models, this pin is tied to ground (logic low).

The input arrangement of the MT-8870 provides a differential input operational amplifier as well as a bias source (VREF) to bias the inputs at mid-rail. Provision is made for connection of a feedback resistor

Page 33: Micro Controller Based Rf Rbotic Car

49

to the op-amp output (GS) for gain adjustment.

The internal clock circuit is completed with the addition of a standard 3.579545 MHz crystal.

The input arrangement of the MT-8870 provides a differential input operational amplifier as well as a bias source (VREF) to bias the inputs at mid-rail. Provision is made for connection of a feedback resistor to the op-amp output (GS) for gain adjustment.

        The internal clock circuit is completed with the addition of a standard 3.579545 MHz crystal.

 

Page 34: Micro Controller Based Rf Rbotic Car

49

THE MICROCONTROLER8051

In our day to day life the role of micro-controllers has been immense. They are used in a variety of applications ranging from home appliances, FAX machines, Video games, Camera, Exercise equipment, Cellular phones musical Instruments to Computers, engine control, aeronautics, security systems and the list goes on.

EXTERNAL INTERRUPTS

MICROCONTROLLER BLOCK DIAGRAM

INTERRUPT CONTROL

ON-CHIP ROM FOR PROGRAM

CODE

ON-CHIP RAM

ETC.

TIMER 0

TIMER 1

SERIAL PORT

4 I/OPORTS

BUS CONTROLOSC

CPU

Page 35: Micro Controller Based Rf Rbotic Car

49

INTRODUCTION TO 8051

In 1981, Intel Corporation introduced an 8-bit microcontroller called the 8051. This microcontroller had 128 bytes of RAM, 4K bytes of on-chip ROM, two timers, one serial port, and four ports (8-bit) all on a single chip. The 8051 is an 8-bit processor, meaning the CPU can work on only 8- bit pieces to be processed by the CPU. The 8051 has a total of four I/O ports, each 8- bit wide. Although 8051 can have a maximum of 64K bytes of on-chip ROM, many manufacturers put only 4K bytes on the chip. The 8051 became widely popular after Intel allowed other manufacturers to make any flavor of the 8051 they please with the condition that they remain code compatible with the 8051. This has led to many versions of the 8051 with different speeds and amount of on-chip ROM marketed by more than half a dozen manufacturers. It is important to know that although there are different flavors of the 8051, they are all compatible with the original 8051 as far as the instructions are concerned. This means

Page 36: Micro Controller Based Rf Rbotic Car

49

that if you write your program for one, it will run on any one of them regardless of the manufacturer.

Page 37: Micro Controller Based Rf Rbotic Car

49

AT89C51 FROM ATMEL CORPORATION

This popular 8051 chip has on-chip ROM in the form of flash memory. This is ideal for fast development since flash memory can be erased in seconds compared to twenty minutes or more needed for the earlier versions of the 8051. To use the AT89C51 to develop a microcontroller-based system requires a ROM burner that supports flash memory: However, a ROM eraser is not needed. Notice that in flash memory you must erase the entire contents of ROM in order to program it again. The PROM burner does this erasing of flash itself and this is why a separate burner is not needed. To eliminate the need for a PROM burner Atmel is working on a version of the AT89C51 that can be programmed by the serial COM port of the PC.

FEATURES OF AT89C51

4K on-chip ROM 128 bytes internal RAM (8-bit)

Page 38: Micro Controller Based Rf Rbotic Car

49

32 I/O pins Two 16-bit timers Six Interrupts Serial programming facility 40 pin Dual-in-line Package

PIN DESCRIPTION

The 89C51 have a total of 40 pins that are dedicated for various functions such as I/O, RD, WR, address and interrupts. Out of 40 pins, a total of 32 pins are set aside for the four ports P0, P1, P2, and P3, where each port takes 8 pins. The rest of the pins are designated as VCC, GND, XTAL1, XTAL, RST, EA, and PSEN. All these pins except PSEN and ALE are used by all members of the 8051 and 8031 families. In other words, they must be connected in order for the system to work, regardless of whether the microcontroller is of the 8051 or the 8031 family. The other two pins, PSEN and ALE are used mainly in 8031 based systems.

VCC: Pin 40 provides supply voltage to the chip. The voltage source is +5 V.

GND: Pin 20 is the ground.

Page 39: Micro Controller Based Rf Rbotic Car

49

XTAL1 and XTAL2: The 8051 have an on-chip oscillator but requires external clock to run it. Most often a quartz crystal oscillator is connected to input XTAL1 (pin 19) and XTAL2 (pin 18). The quartz crystal oscillator connected to XTAL1 and XTAL2 also needs two capacitors of 30 pF value. One side of each capacitor is connected to the ground.

C2

XTAL2 C1

XTAL1

GND: It must be noted that there are various speeds of the 8051 family. Speed refers to the maximum oscillator frequency connected to the XTAL. For example, a 12 MHz chip must be connected to a crystal with 12 MHz frequency or less. Likewise, a 20 MHz microcontroller requires a crystal frequency of no more than 20 MHz. When

Page 40: Micro Controller Based Rf Rbotic Car

49

the 8051 is connected to a crystal oscillator and is powered up, we can observe the frequency on the XTAL2 pin using oscilloscope.

RST: Pin 9 is the reset pin. It is an input and is active high (normally low). Upon applying a high pulse to this pin, the microcontroller will reset and terminate all activities. This is often referred to as a power –on reset. Activating a power-on reset will cause all values in the registers to be lost. Notice that the value of Program Counter is 0000 upon reset, forcing the CPU to fetch the first code from ROM memory location 0000. This means that we must place the first line of source code in ROM location 0000 that is where the CPU wakes up and expects to find the first instruction. In order to RESET input to be effective, it must have a minimum duration of 2 machine cycles. In other words, the high pulse must be high for a minimum of 2 machine cycles before it is allowed to go low.

EA: All the 8051 family members come with on-chip ROM to store programs. In such cases, the EA pin is connected to the VCC. For family members such as 8031 and 8032 in which there is no on-chip ROM, code is

Page 41: Micro Controller Based Rf Rbotic Car

49

stored on an external ROM and is fetched by the 8031/32. Therefore for the 8031 the EA pin must be connected to ground to indicate that the code is stored externally. EA, which stands for “external access,” is pin number 31 in the DIP packages. It is input pin and must be connected to either VCC or GND. In other words, it cannot be left unconnected.

PSEN: This is an output pin. PSEN stands for “program store enable.” It is the read strobe to external program memory. When the microcontroller is executing from external memory, PSEN is activated twice each machine cycle.

ALE: ALE (Address latch enable) is an output pin and is active high. When connecting a microcontroller to external memory, port 0 provides both address and data. In other words the microcontroller multiplexes address and data through port 0 to save pins. The ALE pin is used for de-multiplexing the address and data by connecting to the G pin of the 74LS373 chip.

I/O PORT PINS AND THEIR FUNCTIONS

Page 42: Micro Controller Based Rf Rbotic Car

49

The four ports P0, P1, P2, and P3 each use 8 pins, making them 8-bit ports. All the ports upon RESET are configured as output, ready to be used as output ports. To use any of these as input port, it must be programmed.

PORT 0: Port 0 occupies a total of 8 pins (pins 32 to 39). It can be used for input or output. To use the pins of port 0 as both input and output ports, each pin must be connected externally to a 10K-ohm pull-up resistor. This is due to fact that port 0 is an open drain, unlike P1, P2 and P3. With external pull-up resistors connected upon reset, port 0 is configured as output port. In order to make port 0 an input, the port must be programmed by writing 1 to all the bits of it. Port 0 is also designated as AD0-AD7, allowing it to be used for both data and address. When connecting a microcontroller to an external memory, port 0 provides both address and data. The microcontroller multiplexes address and data through port 0 to save pins. ALE indicates if P0 has address or data. When ALE=0, it provides data D0-D7, but when ALE=1 it has address A0-A7. Therefore, ALE

Page 43: Micro Controller Based Rf Rbotic Car

49

is used for de-multiplexing address and data with the help of latch 74LS373.

PORT 1: Port 1 occupies a total of 8 pins (pins 1 to 8). It can be used as input or output. In contrast to port 0, this port does not require pull-up resistors since it has already pull-up resistors internally. Upon reset, port 1 is configures as an output port. Similar to port 0, port 1 can be used as an input port by writing 1 to all its bits.

PORT 2: Port 2 occupies a total of 8 pins (pins 21 to 28). It can be used as input or output. Just like P1, port 2 does not need any pull-up resistors since it has pull-up resistors internally. Upon reset port 2 is configured as output port. To make port 2 inputs, it must be programmed as such by writing 1s to it.

PORT 3: Port 3 occupies a total of 8 pins (pins 10 to 17). It can be used as input or output. P3 does not need any pull-up resistors, the same as P1 and P2 did not. Although port 3 is configured as output port upon reset, this is not the way it is most commonly used. Port 3 has an additional function of providing some extremely important signals such as interrupts. Some

Page 44: Micro Controller Based Rf Rbotic Car

49

of the alternate functions of P3 are listed below:

P3.0 RXD (Serial input)

P3.1 TXD (Serial output)

P3.2 INT0 (External interrupt 0)

P3.3 INT1 (External interrupt 1)

P3.4 T0 (Timer 0 external input)

P3.5 T1 (Timer 1 external input)

P3.6 WR (External memory write strobe)

P3.7 RD (External memory read strobe)

INSIDE THE 89C51

REGISTERS

In the CPU, registers are used to store information temporarily. That information could be a byte of data to be processed, or an address pointing to the data to be fetched. In the 8051 there us only one data type: 8 bits. With an 8- bit data type, any data larger than 8 bits has to be broken into 8-bit chunks before it is processed.

A

B

R0R1R2R3R4R5R6R7

Page 45: Micro Controller Based Rf Rbotic Car

49

DPTR PC

(B) Some 8051 16-bit registers

(a) SOME 8051 8-bit registers The most commonly 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 the above registers are 8-bit registers except DPTR and the program counter. The accumulator A is used for all arithmetic and logic instructions.

PROGRAM COUNTER AND DATA POINTER

The program counter is a 16- bit register and it points to the address of the next instruction to be executed. As the CPU fetches op-code from the program ROM, the program counter is incremented to point to the next instruction. Since the PC is 16 bit wide, it can access program addresses 0000

DPH DPL

PROGRAM COUNTER

Page 46: Micro Controller Based Rf Rbotic Car

49

to FFFFH, a total of 64K bytes of code. However, not all the members of the 8051 have the entire 64K bytes of on-chip ROM installed.

The DPTR register is made up of two 8-bit registers, DPH and DPL, which are used to furnish memory addresses for internal and external data access. The DPTR is under the control of program instructions and can be specified by its name, DPTR. DPTR does not have a single internal address, DPH and DPL are assigned an address each.

FLAG BITS AND THE PSW REGISTER

Like any other microprocessor, the 8051 have a flag register to indicate arithmetic conditions such as the carry bit. The flag register in the 8051 is called the program status word (PSW) register.

The program status word (PSW) register is an 8-bit register. It is also referred as the flag register. Although the PSW register is 8-bit wide, only 6 bits of it are used by the microcontroller. The two unused bits are user definable flags. Four of the flags are conditional flags, meaning they indicate some conditions that resulted after an instruction was executed. These four are CY (carry), AC (auxiliary carry), P (parity), and

Page 47: Micro Controller Based Rf Rbotic Car

49

OV (overflow). The bits of the PSW register are shown below:

CY PSW.7 Carry flagAC PSW.6 Auxiliary carry flag-- PSW.5 Available to the user for

general purposeRS1 PSW.6 Register bank selector bit 1RS0 PSW.3 Register bank selector bit 0OV PSW.2 Overflow flagF0 PSW.1 User definable bitP PSW.0 Parity flag

CY, THE CARRY FLAG

This flag is set whenever there is a carry out from the d7 bit. This flag bit is affected after an 8-bit addition or subtraction. It can also be set to 1 or 0 directly by an instruction such as “SETB C” and “CLR C” where “SETB C” stands for set bit carry and “CLR C” for clear carry.

AC, THE AUXILIARY CARRY FLAG

If there is carry from D3 to D4 during an ADD or SUB operation, this bit is set:

CY AC F0 RS1 RS0 OV -- P

Page 48: Micro Controller Based Rf Rbotic Car

49

otherwise cleared. This flag is used by instructions that perform BCD arithmetic.

P, THE PARITY FLAG

The parity flag reflects the number of 1s in the accumulator register only. If the register A contains an odd number of 1s, then P=1. Therefore, P=0 if A has an even number of 1s.

OV, THE OVERFLOW FLAG

This flag is set whenever the result of a signed number operation is too large, causing the high order bit to overflow into the sign bit. In general the carry flag is used to detect errors in unsigned arithmetic operations.

MEMORY SPACE ALLOCATION

1. INTERNAL ROM

The 89C51 has 4K bytes of on-chip ROM. This 4K bytes ROM memory has memory addresses of 0000 to 0FFFh. Program addresses higher than 0FFFh, which exceed the internal ROM capacity will cause the microcontroller to automatically fetch code bytes from external memory. Code bytes can also be fetched exclusively

Page 49: Micro Controller Based Rf Rbotic Car

49

from an external memory, addresses 0000h to FFFFh, by connecting the external access pin to ground. The program counter doesn’t care where the code is: the circuit designer decides whether the code is found totally in internal ROM, totally in external ROM or in a combination of internal and external

ROM.

2. EXTERNAL RAM The 1289 bytes of RAM inside the 8051 are assigned addresses 00 to 7Fh. These 128 bytes can be divided into three different groups as follows:1. A total of 32 bytes from locations 00 to 1Fh are set aside for register banks and the stack.2. A total of 16 bytes from locations 20h to 2Fh are set aside for bit addressable read/write memory and instructions.3. A total of 80 bytes from locations 30h to 7Fh are used for read and write storage, or what is normally called a scratch pad. These 80 locations of RAM are widely used for the purpose of storing data and parameters by 8051 programmers.

Countdown timers can be con strutted using discrete digital ICs deluding up/down counters and /or 555 timers. If you wish to incorporate various facilities like setting the count, start,

Page 50: Micro Controller Based Rf Rbotic Car

49

stop, reset and display facilities, these circuits would require too many ICs.

Here is a simple design based on 40- AMEL AT89C51 microcontroller that performs count- down operation for up to LCD displays showing the actual time left. During the activity period, a relay is latched and a flashing led indicates countdown timing’s progress.

Four tactile, push-to-on switches are used to start /stop and to set the initial value for countdown operation. The timing value can also be changed while the counting is still in progress. Auto-repeat key logic also works, i.e., if you hold up or down key continuously, the timing as shown on L displays changes at a faster rate. The program code in hex is only 800 bytes long, while AT89C2051 microcontroller can take up to 2kb of code. This program can be ‘burnt’ into the chip using any universal programmer suitable for ATMEL AT 89C2051 chip.

Page 51: Micro Controller Based Rf Rbotic Car

49

TRANSFORMER

A transformer changes (transforms) an alternating voltage from one value to another. It consists of two coils, called the primary and secondary windings, which are not connected electrically. The windings are either one on top of the other or are side by side on an iron, iron-dust or air core.A transformer works by electromagnetic induction: AC. is supplied to the primary and produces a changing magnetic field, which passes through the secondary, thereby inducing a changing (alternating) voltage in the secondary. It is important that as much as possible of the magnetic field produced by the primary passes through the secondary. A practical arrangement designed to achieve this in an iron-cored transformer in which the secondary is wound on top of the primary. We should also notice that the induced voltage in the secondary is always of opposite polarity to the primary voltage.

Page 52: Micro Controller Based Rf Rbotic Car

49

SYMBOLS

TYPES OF TRANSFORMER

1. MAINS: Mains transformers are used at AC. mains frequency (50 Hz in Britain), their primary coil being connected to the 240V a.c. supply. Their secondary windings may be step-up or step-down or they may have one or more of each. They have laminated iron cores and are used in power

Page 53: Micro Controller Based Rf Rbotic Car

49

supply units. Sometimes the secondary has a center-tap.Step-down toroidal types are becoming popular. They have virtually no external magnetic field and a screen between primary and secondary windings gives safety and electrostatic screening. Their pin connections are brought out to a 0.1 inch grid, which makes them ideal for printed circuit board (P.C.B.) mounting.Isolating transformers have a one-t-one turns ratio (i.e. ns/np = 1/1) and are safety devices for separating a piece of equipment from the mains supply. They do not change the voltage.

2. AUDIO FREQUENCY: Audio frequency transformer also has laminated iron cores and are used as output matching transformers to ensure the maximum transfer of power from the a.f. output stage to the loudspeaker in , for example, a radio set or amplifier.

3. RADIO FREQUENCY: Radio frequency transformers usually have adjustable iron-dust cores and form part of the tuning circuits in a radio. They are enclosed in a small aluminum ‘screening’ can to stop

Page 54: Micro Controller Based Rf Rbotic Car

49

them radiating energy to other parts of the circuit.

Page 55: Micro Controller Based Rf Rbotic Car

49

RELAY DRIVER CIRCUIT

To carry out the switching of any motion of robotic car we commonly use the relays. Since the output of the microcontroller is normally 0 or it is the voltage of logic low state. So we cannot use this output to run the device or appliances. Therefore here we use relays, which can handle a high voltage of 230V or more, and a high current in the rate of 10Amps to energize the electromagnetic coil of the relays +5V is sufficient. Here we use the transistors to energize the relay coil. The output of the 89c51 microcontroller is applied to the base of the transistor T1 – T4 via a resister. When the base voltage of the transistor is below 0.7V the emitter-base (EB) junction of the transistor reverse biased as a result transistor goes to saturation region it is nothing but the switching ON the transistor. This intern switches on the relay. By this the device is switches ON. When the output of microcontroller goes high the base voltage drops above 0.7V as a result the device also switches OFF.

Page 56: Micro Controller Based Rf Rbotic Car

49

RELAY

Relay is a common, application of application of electromagnetism. It uses an electromagnet made from an iron rod wound with hundreds of fine copper wire. When electricity is applied to the wire, the rod becomes magnetic. A movable contact arm above the rod is then pulled toward; a small spring pulls the contract arm away from the rod until it closes a second switch contact. By means of relay, a current circuit can be broken or closed in one circuit as a result of a current in another circuit. Relays can have several poles and contacts. The types of contacts could be normally open and normally closed. One closure of the relay can turn on the same normally open contacts; can turn off the other normally closed contacts

Page 57: Micro Controller Based Rf Rbotic Car

49

A relay is a switch worked by an electromagnet. It is useful if we want a small current in one circuit to control another circuit containing a device such as a lamp or electric motor which requires a large current, or if we wish several different switch contacts to be operated simultaneously.

The structure of relay and its symbol are shown in figure. When the controlling current flows through the coil, the soft iron core is magnetized and attracts the L-shaped soft iron armature. This rocks on its pivot and opens, closes or changes over, the electrical contacts in the circuit being controlled.

Page 58: Micro Controller Based Rf Rbotic Car

49

Page 59: Micro Controller Based Rf Rbotic Car

49

DC MOTORIn 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).

Page 60: Micro Controller Based Rf Rbotic Car

49

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

Page 61: Micro Controller Based Rf Rbotic Car

49

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.

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

Page 62: Micro Controller Based Rf Rbotic Car

49

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).So since most small DC motors are of a three-pole design, let's

tinker with the workings of one via an interactive animation (JavaScript required):

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:

Page 63: Micro Controller Based Rf Rbotic Car

49

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.Luckily for you, I've gone ahead and done this in your stead. The guts of a disassembled Mabuchi FF-030-PN motor (the same model that Solarbotics sells) are available for you to see here (on 10 lines / cm graph paper). This is a basic 3-pole DC motor, with 2 brushes and three commutator contacts.The use of an iron core armature (as in the Mabuchi, above) is quite common, and has a number of advantages2. First off, the iron core provides a strong, rigid support for the windings -- a particularly important consideration for high-torque motors. The core also conducts heat away from the rotor windings, allowing the motor to be driven harder than might otherwise be the

Page 64: Micro Controller Based Rf Rbotic Car

49

case. Iron core construction is also relatively inexpensive compared with other construction types.But iron core construction also has several disadvantages. The iron armature has a relatively high inertia which limits motor acceleration. This construction also results in high winding inductances which limit brush and commutator life.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.

Diagram courtesy of MicroMo

The coreless design also allows manufacturers to build smaller motors; meanwhile, due to the lack of iron in their rotors, coreless motors are somewhat prone to overheating. As a result, this design is generally used just in small, low-power

Page 65: Micro Controller Based Rf Rbotic Car

49

motors. BEAMers will most often see coreless DC motors in the form of pager motors.

Again, disassembling a coreless motor can be instructive -- in this case, my hapless victim was a cheap pager vibrator motor. The guts of this disassembled motor are available for you to see here (on 10 lines / cm graph paper). This is (or more accurately, was) a 3-pole coreless DC motor.

I disembowel 'em so you don't have to...To get the best from DC motors in BEAMbots, we'll need to take a closer look at DC motor behaviors -- both obvious and not.

Page 66: Micro Controller Based Rf Rbotic Car

49

FABRICATION METHOD

org 0000h DATAREADY EQU P2.3 mov p0,#0ffh mov p2,#0ffh CHECK:mov P0, #0ffh MOV A,P2 JNB DATAREADY,LEVEL2

SJMP CHECK LEVEL2:

MOV A,P2ACALL LOOKUPACALL DELAY1SJMP CHECK

LOOKUP:ACALL DELAY1XRL A,#0FFHANL A,#0F0HSWAP A

SUBB A,#01HJZ ONE1SUBB A,#01HJZ TWO1SUBB A,#01HJZ THREE1SUBB A,#01HJZ FOUR1

Page 67: Micro Controller Based Rf Rbotic Car

49

ONE1 : LJMP ONETWO1 : LJMP TWOTHREE1 : LJMP THREEFOUR1 : LJMP FOUR

;-----device switching-------TWO:clr p0.1CLR P0.6acall delay1JB DATAREADY,LEVEL3sjmp TWOLEVEL3:setb p0.1SETB P0.6AJMP CHECKTHREE:clr p0.0clr p0.2acall delay1JB DATAREADY,LEVEL4sjmp THREELEVEL4:setb p0.0setb p0.2AJMP CHECKFOUR:clr p0.0clr p0.3acall delay1JB DATAREADY,LEVEL5sjmp FOUR

Page 68: Micro Controller Based Rf Rbotic Car

49

LEVEL5:setb p0.0setb p0.3AJMP CHECKONE:clr p0.0CLR P0.7acall delay1JB DATAREADY,LEVEL1sjmp ONELEVEL1:setb p0.0SETB P0.7AJMP CHECK delay1: mov r6,#255h22: mov r5,#255h33: djnz r5,h33

djnz r6,h22

retend

APPLICATIONS

After some major modifications in this project we can use this project in some major fields where human beings cannot easily move or are not able to accomplish

Page 69: Micro Controller Based Rf Rbotic Car

49

their works like in the scientist’s research fields on some other planet surfaces, or by the army personals at some hijack situations for knowing hijackers positions etc., these RF are also used for industry purposes.

Some basic applications of Robotics are given below:

Highway integrity management (crack sealing, pothole repair)

Highway signing management (sign and guide marker washing, roadway advisory)

Industrial laser cutting machines Highway landscaping management

(vegetation control, irrigation control) Power line maintenance Aircraft servicing Railways Nuclear industry Maintenance in nuclear reactors Robotic applications

- Robotic car- Robotic car with pick n place

Page 70: Micro Controller Based Rf Rbotic Car

49

FUTURE SCOPE

Using connection strength testing to alarm user when robot is about to go out of range.

Automatic “return home action” on SPOT getting disconnected from base station: ability of the robot to backtrack it’s path / use appropriate AI to come back into the range of the base station SPOT to reconnect to the server, when it runs out of range.

Using the live accelerometer data received from the SPOT in a variety of useful ways on the RoboControl Client:

Showing the path traced by the Robot on a whiteboard

3D Visualization of the robot’s orientation

Collision detection and warning the client about the same (audio as well as visual warning, for e.g., showing a bump on the path tracker, etc.)

Automatic speed adjustment of motors by detecting if robot is running on an

Page 71: Micro Controller Based Rf Rbotic Car

49

inclined plane (using accelerometer data)

Remote controlled task based automation – automated task designer on RoboControl client which allows a user to script automated tasks or visually design automated tasks using decision logic components and remotely deploying and running those tasks on the robot.

Extending the RoboControl Client and Server to be able to control multiple wireless robots.

Image Processing on the server to guide the robot automatically.

Sensor Plug-in Architecture: Ability to add more sensors to the robot and visualizing the sensor data using a plugin architecture.

Page 72: Micro Controller Based Rf Rbotic Car

49

CONCLUSION

Today we find most robots working for people in industries, factories, warehouses, and laboratories. Robots are useful in many ways. For instance, it boosts economy because businesses need to be efficient to keep up with the industry competition. Therefore, having robots helps business owners to be competitive, because robots can do jobs better and faster than humans can, e.g. robot can built, assemble a car. Yet robots cannot perform every job; today robots roles include assisting research and industry. Finally, as the technology improves, there will be new ways to use

Page 73: Micro Controller Based Rf Rbotic Car

49

robots which will bring new hopes and new potentials.

Our robot performed generally quite well. We even tested it in different sized arenas and it still worked reliably. It worked much more quickly and impressively in smaller arenas (this also helped with our lack of moving in a straight line!). The robot did turn out to be incredibly reliable. Although we ripped apart the robot completely several times and rebuilt it just in an attempt to solve little problems & the final structure of the robot was definitely the most robust design.

One of the main things we found was that anything the robot can do, it will whether you want it to or not and we spent a long time trying to figure out why it did it. We found the best way to deal with all of these things was to implement some code to deal with every conceivable action.

Page 74: Micro Controller Based Rf Rbotic Car

49

APPENDICES

BIBLIOGRAPGHY

1) BASIC ELECTRONIC CIRCUITS: MALVINO

& ZBAR.

2) MIT WEBSITE

3) SCIENCE REPORTER

4) WWW.ELECTROGUGS.COM

5) WWW.GOOGLE.COM

6) WWW.SOURCECODE.COM

7) WWW.WIKIPEDIA.COM

8) WWW.PCGUIDE.COM

9) WWW.HOWSTUFFWORKS.COM

10) EMBEDDED SYSTEMS, MAZIDI

Page 75: Micro Controller Based Rf Rbotic Car

49

COMPONENTS USED

78LM05 REGULATOR IC 8870 DECODER IC 4049 NOT GATE IC AT 89C51 ATMEL CORP.

MICROPROCESSOR CD 1619 FM RECEIVER IC RESISTORS:-

R1 TO R3, R9, R14 TO R17 = 10 K R4 = 330 K R5 TO R8 = 100 K R10 TO R13 = 1 K

CAPACITORS:- C1 = 100µF C2 TO C3 = 0.1µF C4 = 10µF C6 TO C7 = 33PF

CRYSTAL OSCILATORS:- OSC. 1 = 11.05 MHZ OSC. 2 , OSC. 3 = 3.57 MHZ

TRANSISTORS:- TI TO T4 = BC 558

SWITCH PUSH BUTTON S1 RELAYS RL1 TO RL4