You are on page 1of 34



Prepared By
Gaurav Arora Himanshu Manik
Ph- +919728084305 Ph- +919996903090

Aman Dua



This Project is the result of the dedication and encouragement of many individuals. My
sincere and heartfelt appreciation goes to all of them.

Firstly, I would like to thank Professor B.P. Arun , the most knowledgeable and
experienced person on the 8051 that I know. He is the one who introduced me to this
microcontroller and was always there, ready to discuss 8051 architecture and programming.

Also I would like to express my sincere thanks to Er. Manish who assist me althrough the
making of the robot.

-- Gaurav Arora

-- Himanshu Manik

-- Aman Dua


 Embedded design
 Robotics & automation
 Robot
 Fabrication of robot
 Major components of robot
 H-bridge
 Microcontroller
 Programming
 Input devices
 Output devices
 Power supply
 Comparision between human and robot
 Advantages of robot
 Application of robot
Project report

Embedded design

The majority of computer systems in use today are embedded in other machinery,
such as automobiles, telephones, appliances, and peripherals for computer systems.
These are called embedded systems. While some embedded systems are very
sophisticated, many have minimal requirements for memory and program length, with
no operating system, and low software complexity. Typical input and output devices
include switches, relays, solenoids, LEDs, small or custom LCD displays, radio
frequency devices, and sensors for data such as temperature, humidity, light level etc.
Embedded systems usually have no keyboard, screen, disks, printers, or other
recognizable I/O devices of a personal computer, and may lack human interaction
devices of any kind.

In general, an Embedded System:

 Is a system built to perform its duty, completely or partially independent of

human intervention.

 Is specially designed to perform a few tasks in the most efficient way.

 Interacts with physical elements in our environment, viz. controlling and

driving a motor, sensing temperature, etc.

An embedded system can be defined as a control system or computer system

designed to perform a specific task. Common examples of embedded systems include
MP3 players, navigation systems on aircraft and intruder alarm systems. An
embedded system can also be defined as a single purpose computer.

Most embedded systems are time critical applications meaning that the embedded
system is working in an environment where timing is very important: the results of an
operation are only relevant if they take place in a specific time frame. An autopilot in
an aircraft is a time critical embedded system. If the autopilot detects that the plane
for some reason is going into a stall then it should take steps to correct this within
milliseconds or there would be catastrophic results

Robotics & Automation

Automation & Robotics are two closely related technologies. In an, industrial context, we
can define automation as Technology that is concern with the use of mechanical
electronics & computer based system in the operation & control of products.

There are three broad classes of Industrial Automation:-

• Fixed Automation: If the volume of product is very high

• Programmable Automation: If the volume of production is less & verity of
products are more.
• Flexible Automation: It is a mixer of fixed & programmable.

Robotics is the science of dealing with the robotics and includes design, selection of
material of proper quality for the components. Fabrication, the study of various motors
( i.e. stepper or D.C. motors ) required for moving the components, design of electronic
circuits. Microcontroller/ computer & its programming & controls of Robots.
In other words Robotics involves various disciplines: Mechanical engineering, Material
sciences, Electronics , Computer sciences ,Computer engineering & control system.

What is robot?
Robot is a type of mechanical slave with great strength.
You can say it’s a reprogrammable, multifunctional, manipulator designed to move
material , parts ,tools or specialized . Devices through variable programmed motions for
the performance of a variety of task.

Let us look at the various component that constitute Robot:

When you visit in an industry you will find that the majority of work is done by Human
standing in a fixed location’ One point is to be noted that the human being performing the
task assigned to him with the help of five major parts of his body.

ARM: Made up of joints & links

GRIPPER: Made up of Palm & Fingers.

MUSCLE: To move the Arm, Palm & Fingers.

BRAIN: To control the movement of Arm,Palm & Finger.

SENSE ORGANS: Eye, Ear & Skin to provide valuable information to brain in
controlling the action of various parts
 Analogously the Robot can be define into five
major components :-

• The Manipulator :-
It is just like a human arm. There are several joints and links for the No. of degree of
freedom.for the rotaion of X-axis,Y-axis & Z-axis.
• . The Endeffector ( Gripper )
It is same like that , end of the human arm i.e. Palm & Finger used to pick &
place things.The gripper has motor at the joint to open & close the claw. Hence
various objects can be hold between the fingers of claw.

• The Locomotive device ( Motor):-
This one is like the human muscles”, The power source for the movement of
Manipulator & Endeffector ( Gripper )

How do we make a motor turn?

You take a battery; hook the positive side to one side of your DC motor. Then you
connect the negative side of the battery to the other motor lead. The motor spins forward.
If you swap the battery leads the motor spins in reverse.
Ok, that's basic. Now let’s say you want a Micro Controller Unit (MCU) to control the
motor, how would you do it? Well, for starters you get a device that would act like a solid
state switch, a transistor, and hook it up the motor. For this we use combination of
transistor switches known as H-BRIDGE.

An H-bridge is an electronic circuit which enables a voltage to be applied across a load in

either direction. These circuits are often used in robotics and other applications to
allow DC motors to run forwards and backwards. H-bridges are available as
integrated circuits, or can be built from discrete components.

Basic Theory:-
Let's start with the name, H-bridge. Sometimes called a "full bridge" the H-bridge is so
named because it has four switching elements at the "corners" of the H and the motor
forms the cross bar. The basic bridge is shown in the figure to the right.

Of course the letter H doesn't have the top and bottom joined together, but hopefully the
picture is clear.

The key fact to note is that there are, in theory, four switching elements within the bridge.
These four elements are often called, high side left, high side right, low side right, and
low side left (when traversing in clockwise order).

The switches are turned on in pairs, either high left and lower right, or lower left and high
right, but never both switches on the same "side" of the bridge. If both switches on one
side of a bridge are turned on it creates a short circuit between the battery plus and
battery minus terminals. This phenomena is called shoot through in the Switch-Mode
Power Supply (SMPS) literature. If the bridge is sufficiently powerful it will absorb that
load and your batteries will simply drain quickly. Usually however the switches in
question melt.

To power the motor, you turn on two switches that are diagonally opposed. In the picture
to the right, imagine that the high side left and low side right switches are turned on. The
current flow is shown in green.
The current flows and the motor begins to turn in a "positive" direction. What happens if
you turn on the high side right and low side left switches? You guessed it, current flows
the other direction through the motor and the motor turns in the opposite direction.

Actually it is just that simple, the tricky part comes in when you decide what to use for
switches. Anything that can carry a current will work, from four SPST switches, one
DPDT switch, relays, transistors, to enhancement mode power MOSFETs.

One more topic in the basic theory section, quadrants. If each switch can be controlled
independently then you can do some interesting things with the bridge, some folks call
such a bridge a "four quadrant device" (4QD get it?). If you built it out of a single DPDT
relay, you can really only control forward or reverse. You can build a small truth table
that tells you for each of the switch's states, what the bridge will do. As each switch has
one of two states, and there are four switches, there are 16 possible states. However, since
any state that turns both switches on one side on is "bad" (smoke issues forth), there are
in fact only four useful states (the four quadrants) where the transistors are turned on.
The last two rows describe a maneuver where you "short circuit" the motor which causes
the motors generator effect to work against itself. The turning motor generates a voltage
which tries to force the motor to turn the opposite direction. This causes the motor to
rapidly stop spinning and is called "braking" on a lot of H-bridge designs.
Of course there is also the state where all the transistors are turned off. In this case the
motor coasts if it was spinning and does nothing if it was doing nothing.

Semiconductor H-Bridges

We can better control our motor by using transistors or Field Effect Transistors (FETs).
Most of what we have discussed about the relays H-Bridge is true of these circuits. You
don't need diodes that were across the relay coils now. You should use diodes across your
transistors though. See the following diagram showing how they are connected.
These solid state circuits provide power and ground connections to the motor, as did the relay circuits. The
high side drivers need to be current "sources" which is what PNP transistors and P-channel FETs are good
at. The low side drivers need to be current "sinks" which is what NPN transistors and N-channel FETs are
good at.
If you turn on the two upper circuits, the motor resists turning, so you effectively have a breaking
mechanism. The same is true if you turn on both of the lower circuits. This is because the motor is a
generator and when it turns it generates a voltage. If the terminals of the motor are connected (shorted),
then the voltage generated counteracts the motors freedom to turn. It is as if you are applying a similar but
opposite voltage to the one generated by the motor being turned. Vis-ã-vis, it acts like a brake.
To be nice to your transistors, you should add diodes to catch the back voltage that is
generated by the motor's coil when the power is switched on and off. This flyback

voltage can be many times higher than the supply voltage! If you don't use diodes, you
could burn out your transistors.
Transistors, being a semiconductor device, will have some resistance, which causes them
to get hot when conducting much current. This is called not being able to sink or source
very much power, i.e.: Not able to provide much current from ground or from plus
Mosfets are much more efficient, they can provide much more current and not get as hot.
They usually have the flyback diodes built in so you don't need the diodes anymore. This
helps guard against flyback voltage frying your MCU.
To use Mosfets in an H-Bridge, you need P-Channel Mosfets on top because they can
"source" power, and N-Channel Mosfets on the bottom because then can "sink" power.
N-Channel Mosfets are much cheaper than P-Channel Mosfets, but N-Channel Mosfets
used to source power require about 7 volts more than the supply voltage, to turn on. As a
result, some people manage to use N-Channel Mosfets, on top of the H-Bridge, by using
cleaver circuits to overcome the breakdown voltage.
It is important that the four quadrants of the H-Bridgecircuits be turned on and off
properly. When there is a path between the positive and ground side of the H-Bridge,
other than through the motor, a condition exists called "shoot through". This is basically a
direct short of the power supply and can cause semiconductors to become ballistic, in
circuits with large currents flowing. There are H-bridge chips available that are much
easier, and safer, to use than designing your own H-Bridge circuit.
Circuit diagram:-

 H-bridge on PCB

1 2 3 4 5

1. Motor Supply (+12V / +24V)

2. Logic Supply (+5V)
3. Clockwise (Active Low)
4. Counter-Clockwise (Active Low)
5. Ground
6. Points to be soldered with DC motor
7. Power Transistor
8. Opto-Coupler Device to provide isolation

The above h-bridge thus can be used for moving motors.thus the ‘Differential
Mechanism’ using two DC Motors is shown below.



Figure 1 – Forward Motion



In the above figures, a simplifiedFigure

differential motor
2 – Right mechanism has been shown. Figure 1
shows the mechanism involved in Forward motion. Basically, in this both the shafts
rotate in the same direction (looking from the left, anti-clockwise). For backward motion,
just the direction of both the shafts is reversed (looking from the left, clockwise) and the
rest remains same.
Figure 2 shows the direction of rotation for the 2 motor shafts for taking a right turn. In
this, the motor on the right moves such that it makes a backward rotation (clockwise,
looking from left) while the motor on the left continues to rotate in the forward direction.
This makes the vehicle turn in the right. A similar effect can be achieved by stopping the
right motor, although that would be a bit unreliable and backward rotation while the right
motor makes the forward rotation

• The Controller :-

(Microprocessor, Microcontroller or PC)

It is just like a “ Human Brain” to controlling the action of Robotic components i.e.
Manipulator, Endeffector ( Gripper ) and locomotive ( Motor )
These can be programmed according to the task performed.

A microcontroller (also MCU or µC) is a functional computer system-on-a-chip. It
contains a processor core, memory, and programmable input/output peripherals.

Microcontrollers include an integrated CPU, memory (a small amount of RAM,

program memory, or both) and peripherals capable of input and output.

It emphasizes high integration, in contrast to a microprocessor which only contains a

CPU (the kind used in a PC). In addition to the usual arithmetic and logic elements of
a general purpose microprocessor, the microcontroller integrates additional elements
such as read-write memory for data storage, read-only memory for program storage,
Flash memory for permanent data storage, peripherals, and input/output interfaces. At
clock speeds of as little as 32KHz, microcontrollers often operate at very low speed
compared to microprocessors, but this is adequate for typical applications. They
consume relatively little power (milliwatts or even microwatts), and will generally
have the ability to retain functionality while waiting for an event such as a button
press or interrupt. Power consumption while sleeping (CPU clock and peripherals
disabled) may be just nanowatts, making them ideal for low power and long lasting
battery applications.

Microcontrollers are used in automatically controlled products and devices, such as

automobile engine control systems, remote controls, office machines, appliances,
power tools, and toys. By reducing the size, cost, and power consumption compared
to a design using a separate microprocessor, memory, and input/output devices,
microcontrollers make it economical to electronically control many more processes.

It is mandatory that microcontrollers provide real time response to events in the

embedded system they are controlling. When certain events occur, an interrupt
system can signal the processor to suspend processing the current instruction
sequence and to begin an interrupt service routine (ISR). The ISR will perform any
processing required based on the source of the interrupt before returning to the
original instruction sequence. Possible interrupt sources are device dependent, and
often include events such as an internal timer overflow, completing an analog to
digital conversion, a logic level change on an input such as from a button being
pressed, and data received on a communication link. Where power consumption is
important as in battery operated devices, interrupts may also wake a microcontroller
from a low power sleep state where the processor is halted until required to do
something by a peripheral event

Other microcontroller features

Since embedded processors are usually used to control devices, they sometimes need
to accept input from the device they are controlling. This is the purpose of the analog
to digital converter. Since processors are built to interpret and process digital data, i.e.
1s and 0s, they won't be able to do anything with the analog signals that may be being
sent to it by a device. So the analog to digital converter is used to convert the
incoming data into a form that the processor can recognize. There is also a digital to
analog converter that allows the processor to send data to the device it is controlling.

In addition to the converters, many embedded microprocessors include a variety of

timers as well. One of the most common types of timers is the Programmable
Interval Timer, or PIT for short. A PIT just counts down from some value to zero.
Once it reaches zero, it sends an interrupt to the processor indicating that it has
finished counting. This is useful for devices such as thermostats, which periodically
test the temperature around them to see if they need to turn the air conditioner on, the
heater on, etc.

Time Processing Unit or TPU for short. Is essentially just another timer, but more
sophisticated. In addition to counting down, the TPU can detect input events, generate
output events, and other useful operations.

Dedicated Pulse Width Modulation (PWM) block makes it possible for the CPU to
control power converters, resistive loads, motors etc.. without using lot's of CPU
resources in tight timer loops.
Universal Asynchronous Receiver/Transmitter (UART) block makes it possible to
receive and transmit data over a serial line with very little load on the CPU.

For those wanting ethernet one can use an external chip like Crystal Semiconductor
CS8900A, Realtek RTL8019, or Microchip ENC 28J60 (buggy). All of them
allows easy interfacing with low pin count.

Higher integration
In contrast to general-purpose CPUs, microcontrollers may not implement an external
address or data bus as they integrate RAM and non-volatile memory on the same chip
as the CPU. Using fewer pins, the chip can be placed in a much smaller, cheaper

Integrating the memory and other peripherals on a single chip and testing them as a
unit increases the cost of that chip, but often results in decreased net cost of the
embedded system as a whole. Even if the cost of a CPU that has integrated
peripherals is slightly more than the cost of a CPU + external peripherals, having
fewer chips typically allows a smaller and cheaper circuit board, and reduces the
labor required to assemble and test the circuit board.

A microcontroller is a single integrated circuit, commonly with the following


 Central Processing Unit - ranging from small and simple 4-bit processors to
complex 32- or 64-bit processors
 discrete input and output bits, allowing control or detection of the logic state
of an individual package pin
 serial input/output such as serial ports (UARTs)
 other serial communications interfaces like I²C, Serial Peripheral Interface
and Controller Area Network for system interconnect
 peripherals such as timers, event counters, PWM generators, and
 volatile memory (RAM) for data storage
 ROM, EPROM, EEPROM or Flash memory for program and operating
parameter storage
 clock generator - often an oscillator for a quartz timing crystal, resonator or
RC circuit
 many include analog-to-digital converters
 in-circuit programming and debugging support
This integration drastically reduces the number of chips and the amount of wiring
and circuit board space that would be needed to produce equivalent systems using
separate chips. Furthermore, and on low pin count devices in particular, each pin may
interface to several internal peripherals, with the pin function selected by software.
This allows a part to be used in a wider variety of applications than if pins had
dedicated functions. Microcontrollers have proved to be highly popular in embedded
systems since their introduction in the 1970s.

Some microcontrollers use a Harvard architecture: separate memory buses for

instructions and data, allowing accesses to take place concurrently. Where a Harvard
architecture is used, instruction words for the processor may be a different bit size
than the length of internal memory and registers; for example: 12-bit instructions used
with 8-bit data registers.

The decision of which peripheral to integrate is often difficult. The microcontroller

vendors often trade operating frequencies and system design flexibility against time-
to-market requirements from their customers and overall lower system cost.
Manufacturers have to balance the need to minimize the chip size against additional

Microcontroller architectures vary widely. Some designs include general-purpose

microprocessor cores, with one or more ROM, RAM, or I/O functions integrated
onto the package. Other designs are purpose built for control applications. A
microcontroller instruction set usually has many instructions intended for bit-wise
operations to make control programs more compact. For example, a general purpose
processor might require several instructions to test a bit in a register and branch if the
bit is set, where a microcontroller could have a single instruction that would provide
that commonly-required function.

Microcontrollers typically do not have a math coprocessor, so floating point

multiplication and division are carried out using a standard library, or the faster and
more compact Horner method.
Programming environments( IDE 8051)
Microcontrollers were originally programmed only in assembly language, but various
high-level programming languages are now also in common use to target
microcontrollers. These languages are either designed specially for the purpose, or
versions of general purpose languages such as the C programming language.
Compilers for general purpose languages will typically have some restrictions as well
as enhancements to better support the unique characteristics of microcontrollers.
Some microcontrollers have environments to aid developing certain types of
applications. Microcontroller vendors often make tools freely available to make it
easier to adopt their hardware. IDE 8051 is the programming software provided by
Dr.Mohammad Ali Mazidi for the programming of microcontroller 8051.

Many microcontrollers are so quirky that they effectively require their own non-
standard dialects of C, such as SDCC for the 8051, which prevent using standard
tools (such as code libraries or static analysis tools) even for code unrelated to
hardware features. Interpreters are often used to hide such low level quirks.

Interpreter firmware is also available for some microcontrollers. For example, BASIC
on the early microcontrollers Intel 8052[3] and Zilog Z8 as well as some modern
devices. Typically these interpreters support interactive programming.

Simulators are available for some microcontrollers, such as in Microchip's MPLAB

environment. These allow a developer to analyse what the behaviour of the
microcontroller and their program should be if they were using the actual part. A
simulator will show the internal processor state and also that of the outputs, as well as
allowing input signals to be generated. While on the one hand most simulators will be
limited from being unable to simulate much other hardware in a system, they can
exercise conditions that may otherwise be hard to reproduce at will in the physical
implementation, and can be the quickest way to debug and analyse problems.

Recent microcontrollers are often integrated with on-chip debug circuitry that when
accessed by an In-circuit emulator via JTAG, allow debugging of the firmware with a


1. Window 1 is the main window where the program is written.
2. Window 2 shows the output window, which on the execution of the program shows
the errors occurred, warnings encountered and other similar data. This is selected by
pointing to ‘view’-> ‘output’.
3. Window 3 shows the Registers used along with their values. For dynamic variation of
these values reflecting their values in the memory, one needs to ‘Simulate’ which will
be further explained at a later stage. This is selected by pointing to ‘view’->
4. Window 4 shows Port Window showing the values acquired by the ports. This
window is also useful when simulating. This is selected by pointing to ‘view’->
5. Window 5 shows the values of important internal variables including Timers, TMOD,
IE etc.


To debug a program, in a more effective way, the option to ‘Simulate’ is provided. On

choosing the appropriate windows to be shown (by choosing them from ‘Views’ on the
menu bar), option of ‘Simulate’ is selected and further the option of ‘Start Simulator’ is
chosen. While the program is running, the dynamic values of the variables are shown in
their respective windows step-by-step value-by-value. To go to the next step, click on
‘Simulate’->’Step Into’ or as a shortcut, press F11. The various values stored in the
respective variable can than be checked and matched with their expected values for any
Microcontroller programs must fit in the available on-chip program memory, since it
would be costly to provide a system with external, expandable, memory. Compilers
and assembly language are used to turn high-level language programs into a compact
machine code for storage in the microcontroller's memory. Depending on the device,
the program memory may be permanent, read-only memory that can only be
programmed at the factory, or program memory may be field-alterable flash or
erasable read-only memory.

ORG 0000H

MANIK: CJNE A,#11110001B,HM1

HM1: CJNE A,#11110010B,HM2
HM2: CJNE A,#11110011B,HM3
HM3: CJNE A,#11110100B,HM4
HM4: CJNE A,#11110101B,HM5
HM5: CJNE A,#11110110B,HM6
HM6: CJNE A,#11111001B,HM7
HM7: CJNE A,#11111000B,HM8
HM8: CJNE A,#11110111B,HM9
HM9: CJNE A,#11111011B,HM10
HM10: CJNE A,#11111100B,HM11
HM11: CJNE A,#11111010B,HM12
MANIK OF ELECTRONICS email id – ph no.: 9312256415/9899893080
FW: CLR P0.0
CLR P0.3
BW: CLR P0.1
CLR P0.2
RT: CLR P0.2
CLR P0.0
LT: CLR P0.1
CLR P0.3
STOP: MOV P0,#11111111B

• The Sensor:-
These can be compared with “The sense organs “ of human being. These sensor are
responsible for the artificial intelligence of Robot ,”The controller can’t perform
intelligent task without ‘The Sensor’. Sensors are nothing but they are measuring
instrument who provide the valuable data (i.e. Position , velocity, force, torque,
proximity, temperature etc.) to the Microcontroller or PC

Examples Of Sensors:-
 Reed Switches
 Load Cell
 Microswitches
 Proximity Sensor ( Metal, IR )
 LDR( Light Emitting Diode)
 Ultrasonic Sensor
 Camera
 Thermister
 Electronic Compass
 Microphone
 Chemical Sensor

• I/P Devices:-
The input signals are given through the mobile phone. The mobile phone has Dual-Tone
Multi-Frequency (DTMF) technology which is perhaps the most widely known method
of Multi Frequency Shift Keying (MSFK) data transmission technique. DTMF was
developed by Bell Labs to be used in the telephone system. Most telephones today uses
DTMF dialing (or “tone” dialing).The mobile phone has encoder and decoder circuit
DTMF Decoder is a very easy to use program to decode DTMF dial tones found on
telephone lines with touch tone phones.
DTMF Decoder is also used for receiving data transmissions over the air in amateur radio
frequency bands.
The following are the frequencies used for the DTMF (dual-tone, multi-frequency)
system, which is also referred to as tone dialling. The signal is encoded as a pair of
sinusoidal (sine wave) tones from the table below which are mixed with each other.
DTMF is used by most PSTN (public switched telephone networks) systems for number
dialling, and is also used for voice-response systems such as telephone banking and
sometimes over private radio networks to provide signalling and transferring of small
amounts of data.

 Block diagram of DTMF :-

 Frequency Table

 Circuit diagram of DTMF decoder:-

• O/P Devices:-
The output signal generated by the microcontroller drives the DC motor through
H-Bridge .Thus the required motion is obtained. Here we have used seven DC
motor four of them are used for moving the plateform & rest of three are used to
move manipulator in all the three axis ( i.e x-axis,y-axis & z-axis).

• Power Supply:-
It provides the electric energy to the system. Li-ion battery, pencil cell, hydrade
ion battery etc. are some of the power supplies available for energizing the
electronic circuit electrically.
• Why Robots?


Robot is indefatigable to wort very Human being become tired after

accurately without any protest. working for some time
Robot can manufacture very accurately Human being estimates & in other
with help of sensors. word inaccurately.

Robot executes the command given Human being occasionally protest

faithfully. when asked to do a certain task &
invariably asks question such as-“
Why should not a different job be
assigned to me”?

Robot can wort for all week days & no Human being works only for 8
need for holiday at the week ends. hours need a holiday at the week

Robot need timely maintenance Human being needs increment in

salary increment after six months or

In case of accident during working Human being demands for medical

Hours it needs to be replacement of treatment & rest sometimes for pay
faulty part in few hours. without work. It may for few
weeks,month or year.

Nothing like that a retirement. It is Human being needs retirement after

working well then its ok otherwise; 55 or 60 years & will be getting half
the whole mechanism is to be of the amount of the salary till death.