Академический Документы
Профессиональный Документы
Культура Документы
BUGGY
Page. 1
ECE PATH FOLLOWING
BUGGY
INDEX
CONTENTS
1. Abbreviations
2. Figures locations
3. Abstract
4. Introduction
5. Block Diagram
7. Schematic
8. Schematic Description
9. Hardware Components
Embedded ‘C’
15. Bibliography
Page. 2
ECE PATH FOLLOWING
BUGGY
CHAPTER -1
INTRODUCTION
EMBEDDED SYSTEM
An embedded system is not always a separate block - very often it is physically built-in to
the device it is controlling.
The software written for embedded systems is often called firmware, and is stored in
read-only memory or flash convector chips rather than a disk drive. It often runs with limited
computer hardware resources: small or no keyboard, screen, and little memory.
ROBOTICS
Robotics is the science and technology of robots, their design, manufacture, and
application. Robotics requires a working knowledge of electronics, mechanics and software, and
is usually accompanied by a large working knowledge of many subjects. A person working in the
field is a robotics.
Although the appearance and capabilities of robots vary vastly, all robots share the
features of a mechanical, movable structure under some form of autonomous control. The
structure of a robot is usually mostly mechanical and can be called a kinematic chain (its
functionality being akin to the skeleton of the human body).
Page. 3
ECE PATH FOLLOWING
BUGGY
The chain is formed of links (its bones), actuators (its muscles) and joints which can
allow one or more degrees of freedom. Most contemporary robots use open serial chains in
which each link connects the one before to the one after it. These robots are called serial robots
and often resemble the human arm. Some robots, such as the Stewart platform, use closed
parallel kinematic chains. Other structures, such as those that mimic the mechanical structure of
humans, various animals and insects, are comparatively rare. However, the development and use
of such structures in robots is an active area of research (e.g. biomechanics). Robots used as
manipulators have an end effector mounted on the last link. This end effector can be anything
from a welding device to a mechanical hand used to manipulate the environment.
Page. 4
ECE PATH FOLLOWING
BUGGY
CHAPTER – 2
BLOCK DIAGRAM
Battery
MICRO H-BRIDGE M1
CONTROLLER
SENSORS
M2
H-BRIDGE
Page. 5
ECE PATH FOLLOWING
BUGGY
I n t h i s s e c t i o n w e w i l l b e
d i s c u s s i n g a b o u t c o m p e t e
b l o c k d i a g r a m a n d i t s
f u n c t i o n a l d e s c r i p t i o n o f
o u r p r o j e c t . A n d a l s o b r i e f
d e s c r i p t i o n a b o u t e a c h b l o c k
o f t h e b l o c k d i a g r a m
POWER SUPPLY
In this system we are using 5V power supply for microcontroller of Transmitter section
as well as receiver section. We use rectifiers for converting the A.C. into D.C and a step down
transformer to step down the voltage. The full description of the Power supply section is given in
this documentation in the following sections i.e. hardware components.
Page. 6
ECE PATH FOLLOWING
BUGGY
Description
A variable regulated power supply, also called a variable bench power supply, is one
where you can continuously adjust the output voltage to your requirements. Varying the output
of the power supply is the recommended way to test a project after having double checked parts
placement against circuit drawings and the parts placement guide.
This type of regulation is ideal for having a simple variable bench power supply. Actually
this is quite important because one of the first projects a hobbyist should undertake is the
construction of a variable regulated power supply. While a dedicated supply
TRANSFORMER
Transformers convert AC electricity from one voltage to another with little loss of power.
Transformers work only with AC and this is one of the reasons why mains electricity is AC.
Step-up transformers increase voltage, step-down transformers reduce voltage. Most power
supplies use a step-down transformer to reduce the dangerously high mains voltage to a safer low
voltage. The input coil is called the primary and the output coil is called the secondary. There is
no electrical connection between the two coils, instead they are linked by an alternating magnetic
field created in the soft-iron core of the transformer. The two lines in the middle of the circuit
symbol represent the core. Transformers waste very little power so the power out is (almost)
equal to the power in. Note that as voltage is stepped down current is stepped up. The ratio of
Page. 7
ECE PATH FOLLOWING
BUGGY
the number of turns on each coil, called the turns ratio, determines the ratio of the voltages. A
step-down transformer has a large number of turns on its primary (input) coil which is connected
to the high voltage mains supply, and a small number of turns on its secondary (output) coil to
give a low output voltage.
Full wave rectifier circuit is shown below. the transformer secondary has a
centre-tap and each half give voltage of Vm. In each half there is one diode i.e. D1 and D2.the
load resistance Rl is common to both halvesThis can be seen to comprise of two half-wave
circuits. on the positive half cycle, when the point is +ve w.r.tB,theDiode D1 conducts and
current i1 flows through Rl. During this half cycle, the point C is -ve w.r.t.point B and hence the
diode D2 does not conduct. Therefore i2=0.
Page. 8
ECE PATH FOLLOWING
BUGGY
On the negative half cycle the point C is +ve w.r.t. point B. hence the diode D2 conducts
and current i2 flows through RL. During this half cycle. The point A is –ve w.r.t.point B and
hence the diode D1 does not conduct. Therefore i1=0
Fig.(b) and (c) shows the waveforms of currents i1 and i2 .since both i1 and i2 flow
through the load RL, the current i through RL is i= i1+i2, which is obtained by adding the two
waveform and is shown in fig(d)
D1
A
i1
Vm
Ac supply B
E
RL
Vm
C i2
D2
Fig2 (a) Full wave rectifier circuit
Page. 9
ECE PATH FOLLOWING
BUGGY
CAPACITIVE FILTER
We have seen that the ripple content in the rectified output of half wave rectifier is 121% or
that of full-wave or bridge rectifier or bridge rectifier is 48% such high percentages of ripples is
not acceptable for most of the applications. Ripples can be removed by one of the following
methods of filtering:
(a) A capacitor, in parallel to the load, provides a easier by –pass for the ripples voltage though
it due to low impedance
(b) An inductor, in series with the load, prevents the passage of the ripple current (due to high
impedance at ripple frequency) while allowing the d.c (due to low resistance to d.c)
(c) various combinations of capacitor and inductor, such as L-section filter section filter,
multiple section filter etc. which make use of both the properties mentioned in (a) and(b) Above.
Two cases of capacitor filter, one applied on half wave rectifier and another with full wave
rectifier.
Page. 10
ECE PATH FOLLOWING
BUGGY
Fig 4(a) shows the circuit diagram, with a full wave rectifier comprising of a center-tapped
secondary winding and two diodes. All the analysis given in this section are also valid for a
bridge rectifier, which also gives full-wave rectification. The filter capacitor C is connected in
parallel with load resistance RL.
In a manner similar to half-wave circuit with capacitor filter, in this circuit also the capacitor
C will get charged during short periods and thereafter, discharge through the load resistance RL.
One notable difference here is that the discharge duration is shorter, whereas in half-wave case
the duration was longer due to the missing half –waves in between. As a result, the average value
of output voltage is higher.
Bridge Rectifier A bridge rectifier makes use of four diodes in a bridge arrangement to achieve
full-wave rectification. This is a widely used configuration, both with individual diodes wired as
shown and with single component bridges where the diode bridge is wired internally.
.
Page. 12
ECE PATH FOLLOWING
BUGGY
SMOOTHING:
REGULATOR
Most digital logic circuits and processors need a 5-volt power supply. To use these parts we need to build
a regulated 5-volt source. Usually you start with an unregulated power supply ranging from 9 volts to 24
volts DC (A 12 volt power supply is included with the beginner kit and the Microcontroller. To make a 5
volt power supply, we use a LM7805 voltage regulator IC (Integrated Circuit). The IC is shown below.
Page. 13
ECE PATH FOLLOWING
BUGGY
FIG 7.1
The LM7805 is simple to use. You simply connect the positive lead of your unregulated DC power
supply (anything from 9VDC to 24VDC) to the Input pin, connect the negative lead to the Common pin
and then when you turn on the power, you get a 5 volt supply from the Output pin.
Circuit features
Brief description of operation: Gives out well regulated +5V output, output current capability of
100 mA
Circuit protection: Built-in overheating protection shuts down output when regulator IC gets too hot
Availability of components: Easy to get, uses only very common basic components
Design testing: Based on datasheet example circuit, I have used this circuit successfully as part of many
electronics projects
Page. 14
ECE PATH FOLLOWING
BUGGY
LM787777777777XX7898
78XX:
The Bay Linear LM78XX is integrated linear positive regulator with three terminals. The
LM78XX offer several fixed output voltages making them useful in wide range of applications. When
used as a zener diode/resistor combination replacement, the LM78XX usually results in an effective
output impedance improvement of two orders of magnitude, lower quiescent current.
Page. 15
ECE PATH FOLLOWING
BUGGY
Features:
• No External Component
• Output Voltage 5.0V, 6V, 8V, 9V, 10V,12V, 15V, 18V, 24V
Applications:
IR-SENSOR
Infrared (IR) radiation is part of the electromagnetic spectrum, which includes radio
waves, microwaves, visible light, and ultraviolet light, as well as gamma rays and X-rays.
The IR range falls between the visible portion of the spectrum and radio waves. IR
wavelengths are usually expressed in microns, with the lR spectrum extending from 0.7
to 1000microns.
Using advanced optic systems and detectors, non-contact IR thermometers can focus on
nearly any portion of the0.7-14 micron band. Because every object (with the exception of
a blackbody) emits an optimum amount of IR energy at a specific point along the IR
band, each process may require unique sensor models with specific optics and detector
types.
Page. 16
ECE PATH FOLLOWING
BUGGY
. IR remote controls use wavelengths between 850 - 950nm. At this short wavelength,
the light is invisible to the human eye, but a domestic camcorder can actually view this
portion of the electromagnetic spectrum. Viewed with a camcorder, an IR LED appears
to change brightness.
All remote controls use an encoded series of pulses, of which there are thousands of
combinations. The light output intensity varies with each remote control, remotes working at
4.5V dc generally will provide a stronger light output than a 3V dc control. Also, as the
photodiode in this project has a peak light response at 850nm, it will receive a stronger signal
from controls operating closer to this wavelength. The photodiode will actually respond to IR
wavelengths from 400nm to 1100nm,so all remote controls should be compatible.
Page. 17
ECE PATH FOLLOWING
BUGGY
In theory, when the sensor is working perfectly, the output signal of a sensor is exactly
proportional to the value of the property it is meant to measure. The gain is then defined as the
ratio between output signal and measured property. For example, if a sensor measures
temperature and has an actual voltage output, the gain is a constant with the unit.
When the sensor is not perfect, various deviations can occur, including gain error, long term
drift, and noise. These and other deviations can be classified as systematic, or random, errors.
Systematic deviations may be compensated for by means of some kind of calibration strategy.
Noise is an example of a random error that can be reduced by signal processing, such as
filtering, usually at the expense of the dynamic behavior of the sensor.
Technical specification
Supply: 5 V
Page. 19
ECE PATH FOLLOWING
BUGGY
The origin of this posting was the question what to do with an old TV. I suggested to use the
infrared remote control as an input keyboard for a micro controller board and mentioned a piece of
code I had written for the 89S51 micro controller. I was asked by some people to share my information
about remote controls, so here it is:
There are at least two international standards, which are used by remote controls to
encode the commands, the RC5 and RECS 80 code. The RECS 80 code uses pulse length
modulation. Each bit to be transmitted is encoded by a high level of the duration T followed by a
low level of duration 2T representing a logical '0' or 3T representing a logical '1'. T 2T T 3T T
2T
_ _ _
|| || ||
_| |__| |___| |__
0 1 0
Notice that a '1' takes more time to be transmitted than a '0'. The RC 5 code instead has a uniform
duration of all bits. A transition in the middle of the time interval assigned to each bit encodes the
logical value. A '0' is encoded by a high to low transition and a '1' by a low to high transition. Therefore
we need additional transitions at the beginning of each bit to set the proper start level if a series of
equal bits is sent. We don't need this additional transition if the next bit has a different value. This is also
called a 'bi phase' code.
|1.Bit|2.Bit|3.Bit|4.Bit|
__ __ __ __
| | | | | |
|__| |_____| |__|
0 0 1 1
Page. 20
ECE PATH FOLLOWING
BUGGY
Instead of being fed direct into the IR emitter, most remote controls modulate a 20-30 kHz carrier with
this signal. Logic one is represented by a burst of oscillations.
______/\/\/\/\_______/\/\/\/\________
0 1 0 1 0
The reason is, that you can use a filter tuned to the carrier frequency to distinguish the signal from noise
in the ambient light. Fluorescent lamps are the main source of such noise. Photodiodes behind an
optical filter, which transmits infrared light but blocks visible light, are used as detectors. The signal from
the photodiode is fed through a filter tuned to the carrier frequency and then amplified. The amplified
signal is demodulated just like the carrier is demodulated in any AM radio receiver.
It can be a lot of pain to design a sensitive receiver that doesn’t start to oscillate. It is also necessary to
have some automatic gain control to avoid overload of the amplifier at close distance to the emitter. It is
easier to use some integrated circuit that does all of the job. The best i have ever seen (and used) is the
TSOP.
If you don't know which code your remote control is transmitting you can identify it by viewing
the output of your receiver with an oscilloscope. The RECS 80 code uses high pulses of uniform
length while the low pulses differ in length. If there are high and low pulses of two different
lengths it might be RC5 code. Note that your receiver may invert the levels.
How are commands like volume control or channel selction encoded? In the case of the RC5
code there is an international standard. Every command is encoded by 14 bits. The first two bits
S are startbits to allow the receiver to adjust the automatic gain control and to synchronize. Next
a bit T follows, that toggles with every new keystroke. Next is the address A of the device which
shall respond to the command. At last the command itself follows.
| S | S | T | A4 | A3 | A2 | A1 | A0 | C5 | C4 | C3 | C2 | C1 | C0 |
Page. 21
ECE PATH FOLLOWING
BUGGY
IR RECEIVER (TSOP)
Description
The TSOP17.. – Series are miniaturized receivers for infrared remote control systems. PIN
diode and preamplifier are assembled on lead frame, the epoxy package is designed as IR filter. The
demodulated output signal can directly be decoded by a microprocessor. TSOP17.. is the standard IR
remote control receiver series, supporting all major transmission codes.
Features
Page. 22
ECE PATH FOLLOWING
BUGGY
Page. 23
ECE PATH FOLLOWING
BUGGY
The circuit of the TSOP17.. is designed in that way that unexpected output pulses due to noise
or disturbance signals are avoided. A bandpassfilter, an integrator stage and an automatic gain control
are used to suppress such disturbances. The distinguishing mark between data signal and disturbance
signal are carrier frequency, burst length and duty cycle. The data signal should fulfill the following
condition• Carrier frequency should be close to center frequency of the band pass (e.g. 38 kHz). Burst
length should be 10 cycles/burst or longer. • After each burst which is between 10 cycles and 70cycles a
gap time of at least 14 cycles is necessary. For each burst, which is longer than 1.8ms, a corresponding
gap time is necessary at some time in
the data stream. This gap time should have at least same length as the burst. • Up to 1400 short bursts
per second can be received continuously. Some examples for suitable data format are: NEC Code,
Toshiba Micom Format, Sharp Code, RC5 Code, RC6 Code, R–2000 Code, Sony Format (SIRCS).When a
disturbance signal is applied to the TSOP17..
it can still receive the data signal. However the sensitivity is reduced to that level that no unexpected
pulses will occur. Some examples for such disturbance signals which
are suppressed by the TSOP17.. are: • DC light (e.g. from tungsten bulb or sunlight)
• Continuous signal at 38kHz or at any other frequency Signals from fluorescent lamps with electronic
ballast.
Page. 24
ECE PATH FOLLOWING
BUGGY
Microcontroller:
In this project the microcontroller plays a major role in taking the data from the sensors
and gives corresponding directions to the motors. Based on sensor output direction of motors are
controlled by microcontroller.
H-Bridge:
Each H-Bridge having two inputs. Micro controller gives input to H-Bridge to control the
direction of the robot. Based on the given inputs to the H-Bridge, the motor will be rotates either
in clock-wise or in anti-clock wise direction. So that the movement of the robot will be
controlled.
DC Motor
DC motors are configured in many types and sizes, including brush less, servo, and gear
motor types. A motor consists of a rotor and a permanent magnetic field stator. The magnetic field is
maintained using either permanent magnets or electromagnetic windings. DC motors are most
commonly used in variable speed and torque.
Motion and controls cover a wide range of components that in some way are used to
generate and/or control motion. Areas within this category include bearings and bushings, clutches and
brakes, controls and drives, drive components, encoders and resolves, Integrated motion control, limit
switches, linear actuators, linear and rotary motion components, linear position sensing, motors (both
AC and DC motors), orientation position sensing, pneumatics and pneumatic components, positioning
stages, slides and guides, power transmission (mechanical), seals, slip rings, solenoids, springs.
Motors are the devices that provide the actual speed and torque in a drive system. This
family includes AC motor types (single and multiphase motors, universal, servo motors, induction,
synchronous, and gear motor) and DC motors (brush less, servo motor, and gear motor) as well as linear,
stepper and air motors, and motor contactors and starters.
Page. 25
ECE PATH FOLLOWING
BUGGY
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).
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 magnets 1. 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
Page. 26
ECE PATH FOLLOWING
BUGGY
misaligned, and the rotor will rotate until it is almost aligned with the stator's field magnets. As
the rotor reaches alignment, the brushes move to the next commutator contacts, and energize the
next winding. Given our example two-pole motor, the rotation reverses the direction of current
through the rotor winding, leading to a "flip" of the rotor's magnetic field, and driving it to
continue rotating.
In real life, though, DC motors will always have more than two poles (three is a very
common number). In particular, this avoids "dead spots" in the commutator. You can imagine how with
our example two-pole motor, if the rotor is exactly at the middle of its rotation (perfectly aligned with
the field magnets), it will get "stuck" there. Meanwhile, with a two-pole motor, there is a moment
where the commutator shorts out the power supply (i.e., both brushes touch both commutator contacts
simultaneously). This would be bad for the power supply, waste energy, and damage motor components
as well. Yet another disadvantage of such a simple motor 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):
Page. 27
ECE PATH FOLLOWING
BUGGY
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. 28
ECE PATH FOLLOWING
BUGGY
There's probably no better way to see how an average dc motor is put together, than by just
opening one up. Unfortunately this is tedious work, as well as requiring the destruction of a perfectly
good motor. This is a basic 3-pole dc motor, with 2 brushes and three commutator contacts.
Page. 29
ECE PATH FOLLOWING
BUGGY
CHAPTER – 3
Schematic Explanation
Firstly, the required operating voltage for Microcontroller 89C51 is 5V. Hence the 5V
D.C. power supply is needed by the same.
To get the 5v power supply we are using 9v battery and it is given to the 7805 regulator
and we 5v d.c as output voltage.The rectified; filtered and regulated voltage is again filtered for
ripples using an electrolytic capacitor 100μF. Now the output from the first section is fed to 40 th
pin of 89c51 microcontroller to supply operating voltage and from other power supply to
circuitry.
The microcontroller 89C51 with Pull up resistors at Port0 and crystal oscillator of
11.0592 MHz crystal in conjunction with couple of capacitors of is placed at 18 th & 19th pins of
89C51 to make it work (execute) properly
P1.0-P1.3 pins are connected to two H-Bridge’s and p2.,p2.3 pins are connected to ULN
2003 14,13 pins and 1,2 input pins are connected two photodiode’s.
Page. 30
ECE PATH FOLLOWING
BUGGY
20th pin-Gnd
SCHEMATIC DAIGRAM
Page. 31
ECE PATH FOLLOWING
BUGGY
CHAPTER -4
Introduction
Page. 32
ECE PATH FOLLOWING
BUGGY
A Micro controller consists of a powerful CPU tightly coupled with memory, various I/O
interfaces such as serial port, parallel port timer or counter, interrupt controller, data acquisition
interfaces-Analog to Digital converter, Digital to Analog converter, integrated on to a single
silicon chip.
If a system is developed with a microprocessor, the designer has to go for external
memory such as RAM, ROM, EPROM and peripherals. But controller is provided all these
facilities on a single chip. Development of a Micro controller reduces PCB size and cost of
design.
One of the major differences between a Microprocessor and a Micro controller is that a
controller often deals with bits not bytes as in the real world application.
Intel has introduced a family of Micro controllers called the MCS-51.
Features:
Description
The AT89S51 is a low-power, high-performance CMOS 8-bit microcontroller with 4K bytes of in-
system programmable Flash memory. The device is manufactured using Atmel’s high-density
nonvolatile memory technology and is compatible with the industry- standard 80C51 instruction set
and pinout. The on-chip Flash allows the program memory to be reprogrammed in-system or by a
conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with in-system
programmable Flash on a monolithic chip, the Atmel AT89S51 is a powerful microcontroller which
provides a highly-flexible and cost-effective solution to many embedded control applications.
Page. 34
ECE PATH FOLLOWING
BUGGY
Block diagram:
Pin diagram:
Page. 35
ECE PATH FOLLOWING
BUGGY
Pin Description
Page. 36
ECE PATH FOLLOWING
BUGGY
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.
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.
Port 2:
Page. 37
ECE PATH FOLLOWING
BUGGY
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 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
AT89S51, as shown in the following table.
RST:
Page. 38
ECE PATH FOLLOWING
BUGGY
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 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:
Page. 39
ECE PATH FOLLOWING
BUGGY
Input to the inverting oscillator amplifier and input to the internal clock operating circuit.
XTAL2:
Oscillator Characteristics:
XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier
which can be configured for use as an on-chip oscillator, as shown in Figs 6.2.3. Either a quartz
crystal or ceramic resonator may be used. To drive the device from an external clock source,
XTAL2 should be left unconnected while XTAL1 is driven as shown in Figure 6.2.4.There are
no requirements on the duty cycle of the external clock signal, since the input to the internal
clocking circuitry is through a divide-by-two flip-flop, but minimum and maximum voltage high
and low time specifications must be observed.
Fig 6.2.3 Oscillator Connections Fig 6.2.4 External Clock Drive Configuration
SOFTWARE Components
Page. 40
ECE PATH FOLLOWING
BUGGY
ABOUT SOFTWARE
KEIL µVision3
µVision3 adds many new features to the Editor like Text Templates, Quick Function Navigation,
and Syntax Coloring with brace high lighting Configuration Wizard for dialog based startup and debugger
setup. µVision3 is fully compatible to µVision2 and can be used in parallel with µVision2.
What is µVision3?
µVision3 is an IDE (Integrated Development Environment) that helps you write, compile, and
debug embedded programs. It encapsulates the following components:
A project manager.
A make facility.
Tool configuration.
Editor.
A powerful debugger.
Express PCB
Express PCB is a Circuit Design Software and PCB manufacturing service. One can learn almost
everything you need to know about Express PCB from the help topics included with the programs given.
Details:
Page. 41
ECE PATH FOLLOWING
BUGGY
Express SCH
The Express SCH schematic design program is very easy to use. This software enables the user to
draw the Schematics with drag and drop options.
A Quick Start Guide is provided by which the user can learn how to use it.
Details:
EMBEDDED C:
The programming Language used here in this project is an Embedded C Language. This
Embedded C Language is different from the generic C language in few things like
a) Data types
b) Access over the architecture addresses.
The Embedded C Programming Language forms the user friendly language with access over Port
addresses, SFR Register addresses etc.
Page. 42
ECE PATH FOLLOWING
BUGGY
Signed char:
CHAPTER - 5
SOFTWARE REQUIRMENT
Page. 43
ECE PATH FOLLOWING
BUGGY
µVision3
µVision3 is an IDE (Integrated Development Environment) that helps you write, compile, and
debug embedded programs. It encapsulates the following components:
A project manager.
A make facility.
Tool configuration.
Editor.
A powerful debugger.
To help you get started, several example programs (located in the \C51\Examples,
\C251\Examples, \C166\Examples, and \ARM\...\Examples) are provided.
HELLO is a simple program that prints the string "Hello World" using the Serial
Interface.
Page. 44
ECE PATH FOLLOWING
BUGGY
5. Select Project - Targets, Groups, Files, Add/Files, select Source Group1, and add the
source files to the project.
6. Select Project - Options and set the tool options. Note when you select the target device
from the Device Database™ all special options are set automatically. You typically only
need to configure the memory map of your target hardware. Default memory model
settings are optimal for most applications.
7. Select Project - Rebuild all target files or Build target.
µVision2 is a standard Windows application and started by clicking on the program icon.
To create a new project file select from the µVision2 menu
Project – New Project…. This opens a standard Windows dialog that asks you for the new
project file name.
We suggest that you use a separate folder for each project. You can simply use the icon
Create New Folder in this dialog to get a new empty folder. Then select this folder and enter the
file name for the new project, i.e. Project1.
µVision2 creates a new project file with the name PROJECT1.UV2 which contains a
default target and file group name. You can see these names in the Project
Window – Files.
Page. 45
ECE PATH FOLLOWING
BUGGY
Now use from the menu Project – Select Device for Target and select a CPU for your
project. The Select Device dialog box shows the µVision2 device database. Just select the
microcontroller you use. We are using for our examples the Philips 80C51RD+ CPU. This
selection sets necessary tool options for the 80C51RD+ device and simplifies in this way the tool
Configuration
Typical, the tool settings under Options – Target are all you need to start a new
application. You may translate all source files and line the application with a click on the Build
Target toolbar icon. When you build an application with syntax errors, µVision2 will display
errors and warning messages in the Output
Window – Build page. A double click on a message line opens the source file on the correct
location in a µVision2 editor window.
Once you have successfully generated your application you can start debugging.
After you have tested your application, it is required to create an Intel HEX file to
download the software into an EPROM programmer or simulator. µVision2 creates HEX files
with each build process when Create HEX files under Options for Target – Output is enabled.
You may start your PROM programming utility after the make process when you specify the
program under the option Run User Program #1.
CPU Simulation
Page. 46
ECE PATH FOLLOWING
BUGGY
µVision2 simulates up to 16 Mbytes of memory from which areas can be mapped for
read, write, or code execution access. The µVision2 simulator traps and reports illegal memory
accesses being done.
In addition to memory mapping, the simulator also provides support for the integrated
peripherals of the various 8051 derivatives. The on-chip peripherals of the CPU you have
selected are configured from the Device
Database selection
You have made when you create your project target. Refer to page 58 for more
Information about selecting a device. You may select and display the on-chip peripheral
components using the Debug menu. You can also change the aspects of each peripheral using the
controls in the dialog boxes.
Start Debugging
You start the debug mode of µVision2 with the Debug – Start/Stop Debug Session
command. Depending on the Options for Target – Debug Configuration, µVision2 will load the
application program and run the startup code µVision2 saves the editor screen layout and
restores the screen layout of the last debug session. If the program execution stops, µVision2
opens an editor window with the source text or shows CPU instructions in the disassembly
window. The next executable statement is marked with a yellow arrow. During debugging, most
editor features are still available.
For example, you can use the find command or correct program errors. Program source
text of your application is shown in the same windows. The µVision2 debug mode differs from
the edit mode in the following aspects:
_ The “Debug Menu and Debug Commands” described on page 28 are Available. The additional
debug windows are discussed in the following.
Page. 47
ECE PATH FOLLOWING
BUGGY
_ The project structure or tool parameters cannot be modified. All build Commands are disabled.
Disassembly Window
The Disassembly window shows your target program as mixed source and assembly
program or just assembly code. A trace history of previously executed instructions may be
displayed with Debug – View Trace Records. To enable the trace history, set Debug –
Enable/Disable Trace Recording.
If you select the Disassembly Window as the active window all program step commands work
on CPU instruction level rather than program source lines. You can select a text line and set or
modify code breakpoints using toolbar buttons or the context menu commands.
You may use the dialog Debug – Inline Assembly… to modify the CPU instructions.
That allows you to correct mistakes or to make temporary changes to the target program you are
debugging.
CHAPTER -6
WORKING DISCRIPTION
Page. 48
ECE PATH FOLLOWING
BUGGY
Page. 49
ECE PATH FOLLOWING
BUGGY
CHAPTER - 7
SOURCE CODE
Page. 50
ECE PATH FOLLOWING
BUGGY
5. Save the Project by typing suitable project name with no extension in u r own folder
sited in either C:\ or D:\
Page. 51
ECE PATH FOLLOWING
BUGGY
Page. 52
ECE PATH FOLLOWING
BUGGY
15. Click on the file option from menu bar and select “new”
Page. 53
ECE PATH FOLLOWING
BUGGY
16. The next screen will be as shown in next page, and just maximize it by double
clicking on its blue boarder.
Page. 54
ECE PATH FOLLOWING
BUGGY
19. Now right click on Source group 1 and click on “Add files to Group Source”
20. Now you will get another window, on which by default “C” files will appear.
Page. 55
ECE PATH FOLLOWING
BUGGY
21. Now select as per your file extension given while saving the file
22. Click only one time on option “ADD”
23. Now Press function key F7 to compile. Any error will appear if so happen.
Page. 56
ECE PATH FOLLOWING
BUGGY
27. Now Click on the Peripherals from menu bar, and check your required port as shown
in fig below
28. Drag the port a side and click in the program file.
Page. 57
ECE PATH FOLLOWING
BUGGY
29. Now keep Pressing function key “F11” slowly and observe.
30. You are running your program successfully
CHAPTER – 8
APPLICATIONS
Page. 58
ECE PATH FOLLOWING
BUGGY
CHAPTER – 9
CONCLUSION
Page. 59
ECE PATH FOLLOWING
BUGGY
The project “PATH FOLLOWING BUGGY” has been successfully designed and tested.
Integrating features of all the hardware components used have developed it. Presence of every module has
been reasoned out and placed carefully thus contributing to the best working of the unit.
Secondly, using highly advanced IC’s and with the help of growing technology the project has
been successfully implemented.
CHAPTER – 10
FEATURE ACCEPTS
CHAPTER – 11
SUMMARY
This section gives an overview of the whole circuitry and hardware involved in the
project. The aim of this project is to design a system for path tracking buggy.
According to this project, a robot is designed which is made to move all the time. Apart
from this, the system also embedded with IR sensors used to detect the track during which the
direction of the robot is changed. All the devices such as IR sensors, motor by which robot is
made to move are being interfaced to microcontroller which forms the control unit of the project.
In the standby mode the robot is moved here and there. Whenever any track is being
detected by the IR sensor, the same is sensed and is intimated to the microcontroller. Now the
micro controller changes the direction of the robot by driving the motors in a respective
direction.
Page. 60
ECE PATH FOLLOWING
BUGGY
This project finds its place in places where one wants to make the unmanned system with
some intelligence.
CHAPTER – 12
FIGURE LOCATIONS
CHAPTER – 13
ABREVATIONS
Microcontroller:
Symbol Name
ACC Accumulator
B B register
SP Stack pointer
P0 Port0
P1 Port1
P2 Port2
Page. 61
ECE PATH FOLLOWING
BUGGY
P3 Port3
CHAPTER - 14
BIBLIOGRAPHY
NAME OF THE SITES
1. WWW.MITEL.DATABOOK.COM
2. WWW.ATMEL.DATABOOK.COM
Page. 62
ECE PATH FOLLOWING
BUGGY
3. WWW.FRANKLIN.COM
4. WWW.KEIL.COM
REFERENCES
-Kenneth J.Ayala
-Ramesh S.Gaonkar
Page. 63
ECE PATH FOLLOWING
BUGGY
Page. 64