Sie sind auf Seite 1von 16

Sir Syed University of Engineering and Technology

Project Report Of Robot


5th Semester
Electronics

Submitted To: Sir Zain

Group Members:

Shazaib Khan(2012-EE-209)
Umar Awan(2012-EE-214)
Shafaque Fatima(2012-EE-226)
Uzair Ashraf(2012-EE-242)
Muzzafar Alam (2012-EE-257)
Faraz Ali Khan (2012-EE-259)

ACKNOWLEDGEMENT:
1

First and foremost, we would like to thank to our supervisor of this project,
Sir Zain for the valuable guidance and advice. They inspired us greatly to
work

in

this

project.

Their

willingness

to

motivate

us

contributed

tremendously to our project. We would also like to thank them for showing
us some example that related to the topic of our project. Besides, we would
like to thank the authority of Sir Syed University Of Engineering
&Technology for providing us with a good environment and facilities to
complete this project. Also, we would like to take this opportunity to thank
to the Dean of the Electronic Department for offering this subject,
Computing Project. It gave us an opportunity to participate and learn about
Microcontrollers.

Finally, an honorable mention goes to our families and

friends for their understandings and support on us in completing this


project. Without the help of the particulars that are mentioned above, we
would have faced many difficulties while doing making this project.

Index:
(1)Abstract
(2) Schematic
(3)Coding
(4)Components
(5) Bibliography

(1)Abstract:

The aim of this project was to simulate and test the circuit of microcontroller
AT89C51 using both software and hardware tools. The circuit was simulated
using PROTEUS; then, it was built on a breadboard in order to be tested.
Using PROTEUS and KEIL, the technique was used in order to operate Hbridge and development board. The same was done on breadboard;
however, the signals generated using PROTEUS and on breadboard were in
agreement.

(2)Schematic:
Motherboard along with h bridges .

(3)Coding:
#include <REG52.H> /* special function register declarations */
/* for the intended 8051 derivative */
#include <stdio.h> /* prototype declarations for I/O functions */
unsigned char mybyte=0;
#ifdef MONITOR51 /* Debugging with Monitor-51 needs */
char code reserve [3] _at_ 0x23; /* space for serial interrupt if */
#endif /* Stop Exection with Serial Intr. */
/* is enabled */
/*-----------------------------------------------The main C function. Program execution starts
here after stack initialization.
------------------------------------------------*/
void main (void) {
/*-----------------------------------------------Setup the serial port for 9600 baud at 11.0592MHz.
------------------------------------------------*/
#ifndef MONITOR51
SCON = 0x50; /* SCON: mode 1, 8-bit UART, enable rcvr */
TMOD |= 0x20; /* TMOD: timer 1, mode 2, 8-bit reload */
TH1 = 0xFD; /* TH1: reload value for 9600 baud @ 11.0592MHz */
TR1 = 1; /* TR1: timer 1 run */
TI = 1; /* TI: set TI to send first char of UART */
#endif
/*-----------------------------------------------Note that an embedded program never exits (because
there is no operating system to return to). It
must loop and execute forever.
------------------------------------------------*/
while (1) {
P2=0;
while(RI==0)
{ mybyte=SBUF;
if (mybyte=='w') //forward
{P2=0x55}
if (mybyte=='b') //reverse
{P2=0xaa;
5

}
if (mybyte=='r') //right
{P2=0xa5;
}
if (mybyte=='l') //left
{P2=0x5a;
}
}
RI=0;
}}

(4)Components:
(1) 2N222 Transistor:

The 2N2222 is a common NPN bipolar junction transistor used for general
purpose low-power amplifying or switching applications. It is designed for
low to medium current, low power, medium voltage, and can operate at
moderately high speeds. It is made in the TO-18 metal can as shown in
the picture. Replacements are commonly available now in the cheaper
TO-92 packaging, where it is known as the PN2222 or P2N2222, which
has similar specifications except for the lower maximum collector
current.

(2)Relay:

Relays are electromagnetic switches that switch between a normally


open condition and a normally closed condition. Relay switches are
used to switch a high-voltage or high-powered circuit by using a lowvoltage circuit to actuate the switch mechanism. When the relay is
actuated (or energized), the common terminal is switched from the
normally closed to the normally open position. When the relay is
turned off, the common terminal is switched back to the normally
closed position.

(3)Resistor:
A resistor is a two-terminal electricalcomponent that implements electrical
resistance as a circuit element. Resistors act to reduce current flow, and, at the
same time, act to lower voltage levels within circuits. Resistors may have fixed
resistances or variable resistances, such as those found in thermistors,
varistors, trimmers, photoresistors, humistors and potentiometers. The current
through a resistor is in directly proportion to the voltage across the resistor's
terminals. This relationship is represented by,

(4)7805:
IC 7805 is a 5V Voltage Regulator that restricts the voltage output to 5V and draws
5V regulated power supply. It comes with provision to add heatsink.
The maximum value for input to the voltage regulator is 35V. It can provide a
constant steady voltage flow of 5V for higher voltage input till the threshold limit of
35V. If the voltage is near to 7.5V then it does not produce any heat and hence no
need for heatsink. If the voltage input is more, then excess
7

electricity is liberated as heat from 7805.

(5) BC547:
BC547 is an NPN bi-polar junction transistor. A transistor, stands for transfer of
resistance, is commonly used to amplify current. A small current at its base
controls a larger current at collector & emitter terminals. BC547 is mainly used for
amplification and switching purposes. It has a maximum current gain of 800. Its
equivalent transistors are BC548 and BC549.The transistor terminals require a
fixed DC voltage to operate in the desired region of its characteristic curves. This is
known as the biasing. For amplification applications, the transistor is biased such
that it is partly on for all input conditions. The input signal at base is amplified and
taken at the emitter. BC547 is used in common emitter configuration for amplifiers.
The voltage divider is the commonly used biasing mode. For switching applications,
transistor is biased so that it remains fully on if there is a signal at its base. In the
absence of base signal, it gets completely off.

(6) 11.0592MHz Crystal:


It provide clock pulses of 11.0592 Mhz frequency. It can be used as UART clock
(61.8432 MHz). It allows integer division to common baud rates (96115200
baud or 96961,200 baud). It is a common clock for Intel
8051 microprocessors It uses the mechanical resonance of a
vibrating crystal of piezoelectric material to create an electrical signal with a very
precise frequency. This frequency is commonly used to keep track of time, to
provide a stable clock signal for digital integrated circuits, and to stabilize
frequencies for radio transmitters and receivers. The most common type of
piezoelectric resonator used is the quartz crystal, so oscillator circuits incorporating
them became known as crystal oscillators. The crystal oscillator circuit sustains
oscillation by taking a voltage signal from the quartz resonator, amplifying it, and
feeding it back to the resonator. The rate of expansion and contraction of the
quartz is the resonant frequency, and is determined by the cut and size of the
crystal. When the energy of the generated output frequencies matches the losses
in the circuit, an oscillation can be sustained. One of the most important traits of
the crystal oscillator is that it exhibits very low phase noise. In the crystal
oscillator, the crystal mostly vibrates in one axis, therefore only one phase is
dominant. This property of low phase noise makes them particularly useful in
telecommunications where stable signals are needed, and in scientific equipment
where very precise time references are needed. The result is that a quartz crystal
behaves like a circuit composed of an inductor,capacitor and resistor, with a
precise resonant frequency
FEATURES: - The crystal oscillator circuit sustains oscillation by taking a voltage
signal from the quartz resonator, amplifying it, and feeding it
back to the resonator
- It provides clock pulses of 11.0592 MHz frequency.

(7)AT89C51:
AT89C51 is an 8-bit microcontroller and belongs to Atmel's 8051 family. ATMEL
89C51 has 4KB of Flash programmable and erasable read only memory (PEROM)
and 128 bytes of RAM. It canbe erased and program to a maximum of 1000
times.In 40 pin AT89C51, there are four ports designated as P 1, P2, P3 and P0. All
these ports are 8-bit bi-directional ports, i.e., they can be used as both input and
output ports. Except P0 which needs external pull-ups, rest of the ports have
internal pull-ups. When 1s are written to these port pins, they are pulled high by
the internal pull-ups and can be used as inputs. These ports are also bit
addressable and so their bits can also be accessed individually.Port P 0 and P2 are
9

also used to provide low byte and high byte addresses, respectively, when
connected to an external memory. Port 3 has multiplexed pins for special functions
like serial communication hardware interrupts, timer inputs and read/write
operation from external memory. AT89C51 has an inbuilt UART for serial
communication. It can be programmed to operate at different baud rates. Including
two timers & hardware interrupts it has a total of six interrupts.

10

(8) Window Motor:

12v Dc power window motor, permanent magnet, with solid shaft, low rpm. High
torque, compact size design
& competitive price
Dc power window motor, advantages:
1. Steady quality, all the products pass the ISO/TS 16949 test.
2. Low rpm High torque output
3. Competitive price,
4. Reliable performance
5. In-time & Professional After Sale Service
11

Voltage(v)

No load
current(A)

No load
Current
speed(rpm) (3N.m)(A)

Speed
Max.torque
(3N.M)(rpm) (N.m)

Block
current(A)

12

2.5

85

50

30

10

(9) Bluetooth module HC06:

The workshop is using the HC06 modules mounted on a 4 or 6 pin carrier board.
only Vcc (3.3v), GND, Rxd and Txd are used.
12

Hardware connections:
Connect Vcc to 3.3volts. This is different from all the other parts, the connection is
for HC06 Vcc goes to 3.3 on the quickstart.

Connect GND to Vss as normal.

Connect HC06 - Tx tp pin 26

Connect HC06 - Rx tp pin 27

If you have a 6 pin HC06, there are two more pins that are not connected. These
are only used initialization and troubleshooting. Don't worry about connecting KEY
to P1. We only do this if the HC06 is stubborn.

Power On:
When you apply power, the STATUS LED on the HC06 should blink. This means the
HC06 is ready. If the HC06 STATUS LED does NOT blink, pull the power wire for a
second or two, and reconnect. Sometimes they come up flashing every time,
sometimes they only come up every other time. This is fine for our situation.

Configuration Scripts:
The following is a modification of the script found in bot.f and QSbot.f. Feel free to
modify these script once you are comfortable with their action.
The HC06 need to be configured rather than left as default. The names need to to
be unique and the baud needs to be set from 9600 to 230400. This is typically
done before the session; each manufacturer tends to set something just a little
"off" from normal. This instuction assume pre-configured modules with unique
names and 230400 baud.

13

(5)Bilography:

http://www.engr.usask.ca/classes/EE/392/DataSheets/ULN2803.pdf
http://freedatasheets.com/datasheetblog/2010/02/uln2803-eight-darlingtonarray-uln2803a/
http://www.edaboard.com/thread61984.html
8051 Microcontroller and embedded systems.
~~~~M.A. Mazidi ~~~

14

15

16