Professional Documents
Culture Documents
[ Ty p e t h e c o m p a n y a d d r e s s ]
We want to express our greatest gratitude for the following people who been very
supportive. Mr. Siraj Filum who is our advisor, he was indeed supporting us more than what
he is expected. We want also to acknowledge our classmate Tadese Hadush who gave us the
components and documents he had. His contribution helped us a lot. Without his help the
project could have taken us a lot of time. Last but not the least, we want to say thank you for
Mr. Daniel Belay lab assistant and all the other lab assistants.
[ Ty p e t h e c o m p a n y a d d r e s s ]
The objective of this project is to operate the robot for detecting the bombs. This project is
very useful in military applications for detecting the bombs and also used in finding mines.
This project also improves the security performance. More over this is also used to detect a
metal.
[ Ty p e t h e c o m p a n y a d d r e s s ]
[ Ty p e t h e c o m p a n y a d d r e s s ]
List of tables
Table 3.1 Controlling of the robot using motor driver IC
List of acronyms
[ Ty p e t h e c o m p a n y a d d r e s s ]
Bomb detector is just a metal detector which detects any metal in the required areas.
Bombs are made up of metal elements thus when a metal detector is near a bomb it will detect
it. The bomb detector is attached in the topside of the robot. Robot movements are controlled
by using keypad or switch.
The keypad is the set of keys in which each one controls the robot in a direction such as
forward, reverse, left and right. When any one key is pressed the corresponding signals are
encoded by the microcontroller and the microcontroller then instructs the driver to drive the dc
motors to the desired direction.
Driver circuit controls the motor, by which the robot movement is controlled. If any object
related to metal is there, bomb detecting mechanism finds that one and gives the signal to
micro controller. Now the micro controller activates the alarm driver circuits. So the alarm
makes sound for indication.
Once we are alarmed we have to take other measurements to safeguard our safety. The
most important thing is detecting its existence.
CHAPTER TWO
2.1 Material required
CHAPTER THREE
[ Ty p e t h e c o m p a n y a d d r e s s ]
[ Ty p e t h e c o m p a n y a d d r e s s ]
The Intel 8051 microcontroller is one of the most popular general purpose microcontrollers
in use today. The success of the Intel 8051 spawned a number of clones which are collectively
referred to as the MCS-51 family of microcontrollers, which includes chips from vendors such
as Atmel, Philips, Infineon, and Texas Instruments.
8051 was the original microcontroller by Intel (based on the older, but slightly different
8048-family (MCS48)). 8052 is an enhanced version of 8051, adding extra 128 bytes of
internal RAM (only indirectly addressable) to 128 bytes present already in 8051 (both directly
and indirectly addressable), adding a third timer (Timer2, which has also 16-bit reload mode
and various other features), and in version with ROM/EPROM, twice as much ROM/EPROM
(8kB) as was in 8051 (4kB).
However, today, both "8051" and "8052" are often used interchangeably as a generic name
for the whole family.
The Intel 8051 is an 8-bit microcontroller which means that most available operations are
limited to 8 bits. There are 3 basic "sizes" of the 8051: Short, Standard, and Extended. The
Short and Standard chips are often available in DIP (dual in-line package) form, but the
Extended 8051 models often have a different form factor, and are not "drop-in compatible".
[ Ty p e t h e c o m p a n y a d d r e s s ]
Some of the features that have made the 8051 popular are:
8051 models may also have a number of special, model-specific features, such as UARTs,
ADC, Operational amplifier, etc...
8051 chips are used in a wide variety of control systems, telecom applications, and robotics as
well as in the automotive industry. By some estimation, 8051 family chips make up over 50%
of the embedded chip market.
PIN 9: PIN 9 is the reset pin which is used to reset the microcontroller’s internal registers and
ports upon starting up. (Pin should be held high for 2 machine cycles.)
[ Ty p e t h e c o m p a n y a d d r e s s ]
PINS 18 & 19: The 8051 has a built-in oscillator amplifier hence we need to only connect a
crystal at these pins to provide clock pulses to the circuit.
PIN 40 and 20: Pins 40 and 20 are VCC and ground respectively. The 8051 chip needs +5V
500mA to function properly, although there are lower powered versions like the Atmel 2051
which is a scaled down version of the 8051 which runs on +3V.
PINS 29, 30 & 31: As described in the features of the 8051, this chip contains a built-in flash
memory. In order to program this we need to supply a voltage of +12V at pin 31. If external
memory is connected then PIN 31, also called EA/VPP, should be connected to ground to
indicate the presence of external memory. PIN 30 is called ALE (address latch enable), which
is used when multiple memory chips are connected to the controller and only one of them
needs to be selected. We will deal with this in depth in the later chapters. PIN 29 is called
PSEN. This is "program store enable". In order to use the external memory it is required to
provide the low voltage (0) on both PSEN and EA pins.
[ Ty p e t h e c o m p a n y a d d r e s s ]
3.2.7 Ports
There are 4 8-bit ports: P0, P1, P2 and P3.
PORT P1 (Pins 1 to 8): The port P1 is a general purpose input/output port which can be used
for a variety of interfacing tasks. The other ports P0, P2 and P3 have dual roles or additional
functions associated with them based upon the context of their usage. The port 1 output
buffers can sink/source four TTL inputs. When 1s are written to portn1 pins are pulled high by
the internal pull-ups and can be used as inputs.
PORT P3 (Pins 10 to 17): PORT P3 acts as a normal IO port, but Port P3 has additional
functions such as, serial transmit and receive pins, 2 external interrupt pins, 2 external counter
inputs, read and write pins for memory access.
[ Ty p e t h e c o m p a n y a d d r e s s ]
PORT P0 (pins 32 to 39) PORT P0 can be used as a general purpose 8 bit port when no
external memory is present, but if external memory access is required then PORT P0 acts as a
multiplexed address and data bus that can be used to access external memory in conjunction
with PORT P2. P0 acts as AD0-AD7, as can be seen from fig 1.1
Writing to a port pin loads data into a port latch that drives a FET connected to the port pin.
P0: Note that the pull-up is absent on Port 0 except when functioning as the external
address/data bus. When a "0" is written to a bit in port 0, the pin is pulled low. But when a "1"
is written to it, it is in high impedance (disconnected) state. So when using port 0 for output,
an external pull-up resistor is needed, depending on the input characteristics of the device
driven by the port pin
P1, P2, P3 have internal pull-ups: When a "0" is written to a bit in these port , the pin is
pulled low ( FET-ON) ,also when 1 is written to a bit in these port pin becomes high (FET-
OFF) thus using port P1,P2,P3 is simple.
You can use a port for output any time. But for input, the FET must be off. Otherwise, you
will be reading your own latch rather than the signal coming from the outside. Therefore, a "1"
should be written to the pin if you want to use it as input, especially when you have used it for
output before. If you don't do these input high voltage will get grounded through FET so you
will read pin as low and not as high. An external device cannot easily drive it high
[ Ty p e t h e c o m p a n y a d d r e s s ]
The 78L05 is a 5V regulator. The input voltage ranges from 7V to 35V and the output voltage
is about 5V.
A cycle is, in reality, 12 pulses of the crystal. That is to say, if an instruction takes one
machine cycle to execute, it will take 12 pulses of the crystal to execute. Since we know the
crystal is pulsing 11,059,000 times per second and that one machine cycle is 12 pulses, we can
calculate how many instruction cycles the 8051 can execute per second:
11,059,000 / 12 = 921,583
[ Ty p e t h e c o m p a n y a d d r e s s ]
The 8051 requires an external oscillator circuit. The oscillator circuit usually runs around
12MHz, although the 8051 (depending on which specific model) is capable of running at a
maximum of 40MHz. Each machine cycle in the 8051 is 12 clock cycles, giving an effective
cycle rate at 1MHz (for a 12MHz clock) to 3.33MHz (for the maximum 40MHz clock). The
oscillator circuit generates the clock pulses so that all internal operations are synchronized.
11.0592 MHz crystals are often used because it can be divided to give you exact clock rates
for most of the common baud rates for the UART, especially for the higher speeds (9600,
19200). Despite the "oddball" value, these crystals are readily available and commonly used.
The 8051 starts executing program instructions from address 0000 in the program memory.
The A register is located in the SFR memory location 0xE0. The A register works in a similar
fashion to the AX register of x86 processors. The A register is called the accumulator, and by
default it receives the result of all arithmetic operations.
[ Ty p e t h e c o m p a n y a d d r e s s ]
The Special Function Register (SFR) is the upper area of addressable memory, from
address 0x80 to 0xFF. A, B, PSW, DPTR are called SFR. This area of memory cannot be used
for data or program storage, but is instead a series of memory-mapped ports and registers. All
port input and output can therefore be performed by memory mov operations on specified
addresses in the SFR. Also, different status registers are mapped into the SFR, for use in
checking the status of the 8051, and changing some operational parameters of the 8051.
The 8051 has 4 selectable banks of 8 addressable 8-bit registers, R0 to R7. This means that
there are essentially 32 available general purpose registers, although only 8 (one bank) can be
directly accessed at a time. To access the other banks, we need to change the current bank
number in the flag status register.
The A register is located in the SFR memory location 0xE0. The A register works in a
similar fashion to the AX register of x86 processors. The A register is called the accumulator,
and by default it receives the result of all arithmetic operations. The B register is used in a
similar manner, except that it can receive the extended answers from the multiply and divide
operations. When not being used for multiplication and Division, the B register is available as
an extra general-purpose register
The 8051 Microcontroller can be programmed in PL/M, 8051 Assembly, C and a number
of other high-level languages. Many compilers even have support for compiling C++ for an
8051.Program memory in the 8051 is read-only, while the data memory is considered to be
read/write accessible. When stored on EEPROM or Flash, the program memory can be
rewritten when the microcontroller is in the special programmer circuit.
[ Ty p e t h e c o m p a n y a d d r e s s ]
[ Ty p e t h e c o m p a n y a d d r e s s ]
Metal detectors work on the principle of transmitting a magnetic field and analyzing a return
signal from the target and environment. The transmitted magnetic field varies in time, usually
at rates of fairly high-pitched audio signals. The magnetic transmitter is in the form of a
transmit coil with a varying electric current flowing through it produced by transmit
electronics. The receiver is in the form of a receive coil connected to receive and signal
processing electronics. The transmit coil and receive coil are sometimes the same coil.
This changing transmitted magnetic field causes electric currents to flow in metal targets.
These electric currents are called eddy currents, which in turn generate a weak magnetic field,
but their generated magnetic field is different from the transmitted magnetic field in shape and
strength. It is the altered shape of this regenerated magnetic field that metal detectors use to
detect metal targets. (The different “shape” may be in the form of a time delay.)
The regenerated magnetic field from the eddy currents causes an alternating voltage signal at
the receive coil. This is amplified by the electronics because relatively deeply buried targets
produce signals in the receive coil which can be millions of times weaker than the signal in the
transmit coil, and thus need to be amplified to a reasonable level for the electronics to be able
to process.
What make a metal detector buzz when you sweep it over buried treasure? Why is it important
to keep the detector moving?
1. A battery or power source in the top of the metal detector passes electricity to the
transmitter coil at the bottom.
2. When electricity flows through the transmitter coil, it creates a magnetic field all around
the coil.
[ Ty p e t h e c o m p a n y a d d r e s s ]
The metal detector is triggered and you've found something! The closer you move the
transmitter coil to the piece of metal, the stronger the magnetic field the transmitter coil
creates in it, the stronger the magnetic field the metal creates in the receiver coil, the more
current that flows in the loudspeaker and the louder the noise.
Metal detector works based on James clerk Maxwell’s theory. So thank you, James Clerk
Maxwell, for helping us see how metal detectors work—by using electricity to create
magnetism, which creates more electricity somewhere else.
[ Ty p e t h e c o m p a n y a d d r e s s ]
Metal detectors aren't just used to find coins on the beach. You can see them in walk-through scanners at
airports (designed to stop people carrying guns and knives onto airplanes or into other secure places such as
prisons and hospitals) and in many kinds of scientific research.
Motor driver is basically a current amplifier which takes a low-current signal from the
microcontroller and gives out a proportionally higher current signal which can control and
drive a motor.
[ Ty p e t h e c o m p a n y a d d r e s s ]
L293D IC generally comes as a standard 16-pin DIP (dual-in line package). This motor driver
IC can simultaneously control two small motors in either direction; forward and reverse with
just 4 microcontroller pins (if you do not use enable pins). Some of the features (and
drawbacks) of this IC are:
1. Output current capability is limited to 600mA per channel with peak output current
limited to 1.2A (non-repetitive). This means you cannot drive bigger motors with this
IC. However, most small motors used in hobby robotics should work. If you are unsure
whether the IC can handle a particular motor, connect the IC to its circuit and run the
motor with your finger on the IC. If it gets really hot, then beware... Also note the words
"non-repetitive"; if the current output repeatedly reaches 1.2A, it might destroy the
drive transistors.
2. Supply voltage can be as large as 36 Volts. This means you do not have to worry much
about voltage regulation.
3. L293D has an enable facility which helps you enable the IC output pins. If an enable
pin is set to logic high, then state of the inputs match the state of the outputs. If you pull
this low, then the outputs will be turned off regardless of the input states
4. The datasheet also mentions an "over temperature protection" built into the IC. This
means an internal sensor senses its internal temperature and stops driving the motors if
the temperature crosses a set point
5. Another major feature of L293D is its internal clamp diodes. This fly back diode helps
protect the driver IC from voltage spikes that occur when the motor coil is turned on
and off (mostly when turned off)
6. The logical low in the IC is set to 1.5V. This means the pin is set high only if the voltage
across the pin crosses 1.5V which makes it suitable for use in high frequency
applications like switching applications (up to 5KHz)
7. Lastly, this integrated circuit not only drives DC motors, but can also be used to drive
relay solenoids, stepper motors etc.
[ Ty p e t h e c o m p a n y a d d r e s s ]
The circuit shown to the right is the most basic implementation of L293D IC. There are 16
pins sticking out of this IC and we have to understand the functionality of each pin before
implementing this in a circuit.
1. Pin1 and Pin9 are "Enable" pins. They should be connected to +5V for the drivers to
function. If they pulled low (GND), then the outputs will be turned off regardless of the
input states, stopping the motors. If you have two spare pins in your microcontroller,
connect these pins to the microcontroller, or just connect them to regulated positive 5
Volts.
2. Pin4, Pin5, Pin12 and Pin13 are ground pins which should ideally be connected to
microcontroller's ground.
3. Pin2, Pin7, Pin10 and Pin15 are logic input pins. These are control pins which should
be connected to microcontroller pins. Pin2 and Pin7 control the first motor (left); Pin10
and Pin15 control the second motor (right).
4. Pin3, Pin6, Pin11, and Pin14 are output pins. Tie Pin3 and Pin6 to the first motor, Pin11
and Pin14 to second motor
5. Pin16 powers the IC and it should be connected to regulated +5Volts
6. Pin8 powers the two motors and should be connected to positive lead of a secondary
battery.
[ Ty p e t h e c o m p a n y a d d r e s s ]
Suppose you need to control the left motor which is connected to Pin3 (O1) and Pin6 (O2).
As mentioned above, we require three pins to control this motor - Pin1 (E1), Pin2 (I1) and
Pin7 (I2). Here is the truth table representing the functionality of this motor driver.
low X X stop
NB. X= it doesn’t matter whether it is high or low, High ~+5V, Low ~0V
The above table works the same way for the other motor connected at pin 10 & 15.
In the above truth table you can observe that if Pin1 (E1) is low then the motor stops,
irrespective of the states on Pin2 and Pin7. Hence it is essential to hold E1 high for the driver
to function, or simply connect enable pins to positive 5 volts.
With Pin1 high, if Pin2 is set high and Pin7 are pulled low, then current flows from Pin2 to
Pin7 driving the motor in anti-clockwise direction? If the states of Pin2 and Pin7 are flipped,
then current flows from Pin7 to Pin2 driving the motor in clockwise direction.
The above concept holds true for other side of the IC too. Connect your motor to Pin11 and
Pin14; Pin10 and Pin15 are input pins, and Pin9 (E2) enables the driver.
[ Ty p e t h e c o m p a n y a d d r e s s ]
[ Ty p e t h e c o m p a n y a d d r e s s ]
When the loop is connected to dc supply, electron current flow from point A to B point of the
loop, and from point C to D on the other side of the loop .Because the current flows through
the segment of the loop that are opposite each other, the segment of the one side pushes
upward while the segment on the side pushes downward.
Fig. 4.1
[ Ty p e t h e c o m p a n y a d d r e s s ]
When the loop reaches a position perpendicular to the main field, there is no interaction
between the flux lines to cause the loop to rotate. This position is called neutral plane.
Due to inertia the loop continues to rotate counter clock wise (CCW).
However, since the direction of current flow through the loop doesn’t change the interaction
between the conductor segments and the main field develops a force in the opposite direction.
Instead of continuing in the CCW direction, the loop stops and changes direction. an
oscillating motion is produced until the armature settles in the normal plane.
The continuous motion of the rotor is achieved by reversing the direction of current through
the loop as it passes the neutral plane, a switching device, called a commutator, achieves the
current change.
[ Ty p e t h e c o m p a n y a d d r e s s ]
Here is how the switching action of the brushes and commutator reverses current flow to
cause the armature to rotate in one direction. This swinging action is called commutation.
Position 1.In this position current enters the loop through the negative brush and exits through
the positive brush.
[ Ty p e t h e c o m p a n y a d d r e s s ]
The result is no torque is produced but the inertia causes the rotor to continue turning past the
neutral position.
Position 3
As the rotor turns in to the main field the switching action of the commutator reverses the
direction of current flow. This causes the current to flow in to the rotor section closest to the
South Pole of the magnet, as it did in position 1.
[ Ty p e t h e c o m p a n y a d d r e s s ]
The rotation of the armature continues in one direction because the commentator keeps
reversing the direction that current flows through the loop every half turn (180º).
In this way, the magnetic field of the rotor always interacts the same way with the main field
to main field to main field to maintain a continuous torque in one direction.
[ Ty p e t h e c o m p a n y a d d r e s s ]
The robot is programmed using microcontroller program. The program written is used to
send controlling signals for the motor driver IC which are connected to specific pins of the
microcontroller. By managing signals of the mc pins we can control the signals direction to
the DC motors which enable the motors to move in different directions.
The flowchart of the program is as follow.
[ Ty p e t h e c o m p a n y a d d r e s s ]
[ Ty p e t h e c o m p a n y a d d r e s s ]
The robot moves by the action of the two DC motors. Terminals of the DC motor are
connected to the pins of motor driver IC. Based on the states of the switch input to the ports of
microcontroller, the microcontroller is programmed in such a way that it gives an output of 5
volt in the ports that are connected to the motor driver IC.
Then the Motor driver IC drives the two DC motors in any of the 4 directions: right, left,
forward and backward.
If the two DC motors get 12v on their positive terminal and 0v on their negative terminals
the motor moves forward direction.
If the two DC motors get 0v on their positive terminal and 12v on their negative terminals
the motor moves backward direction.
If the two DC motors get 12v on their positive terminal and 12v on their negative or 0v on
both of their terminals the motors stops.
If the right side DC motors get a potential difference on its terminal the motor turns to the
left.
If the left side DC motors get a potential difference on its terminal the motor turns to the right.
While the robot moves the metal detector sends magnetic field to detect a metal and when it
detects any metal element it activates an alarm.
[ Ty p e t h e c o m p a n y a d d r e s s ]
While we were doing our project we have come up with the following limitations.
We were planning to control the direction of the movement of robot by designing RF
remote control but we ended up by replacing it by switch. Though switch works well it
is not convenient to handle it.
We were also planning to use solar power as a source of power for the robot
We didn’t use it because we think that it will add weight to the robot.
Thus we recommend any follow students to add the solar panel and RF remote control to
what we have done.
[ Ty p e t h e c o m p a n y a d d r e s s ]
[ Ty p e t h e c o m p a n y a d d r e s s ]
#include<reg52.h>
sbit sw1=P1^0;
sbit sw2=P1^1;
sbit sw3=P1^2;
sbit sw4=P1^3;
sbit A=P2^0;
sbit b=P2^1;
sbit C=P2^2;
sbit D=P2^3;
void delay(unsigned char);
void main()
{
unsigned char Z;
P1=0XFF; // make p1 input
P2=0X00; // make p2 as output
while(1)
{
Z=P1;
Z=Z&0X0F;// mask the upper 4 bits
switch(Z)
{
case(0):
{
A=0;b=0;
C=0;D=0;
delay(250);
break;
}
case(1):// move forward =>1=0001 which is the 3rd switch
{
A=1;b=0;
C=1;D=0;
delay(2);
[ Ty p e t h e c o m p a n y a d d r e s s ]
CHAPTER EIGHT
PCB DESIGN
[ Ty p e t h e c o m p a n y a d d r e s s ]