You are on page 1of 16

Robotic Arm

Microprocessor System Project Report

Digital

For our parents with whose support and effort we were


able to carry out this project successfully

Table of Contents
Coding and Design ..1
1. Code ..1
2. Block Diagram .7
3. Work Division7
Design..3
1. Logic Design8
2. Simulation8
Hardware and Components..10
1. Details of Components.10

Microprocessor Systems

Coding and Design


1.1 Code:
#
#
#
#

include<reg51.h>
include<stdio.h>
include<string.h>
define register ren
sbit prec=P0^7;
sbit MTR_up=P1^0;
sbit MTR_down=P1^1;
sbit MTR_left=P1^2;
sbit MTR_right=P1^3;
sbit MTR_grab=P1^4;
sbit MTR_leave=P1^5;
sbit MTR_claw_c=P1^6;
sbit MTR_claw_a=P1^7;
sbit rs=P0^0;
sbit rw=P0^1;
sbit en=P0^2;
sbit D0 = P2^0;
sbit D1 = P2^1;
sbit D2 = P2^2;
sbit D3 = P2^3;
sbit D4 = P2^4;
sbit D5 = P2^5;
sbit D6 = P2^6;
sbit busy = P2^7;
void MSDelay(unsigned int);
void serial_int();
void lcdcmd(unsigned char value);
void lcddata(unsigned char value);
void lcdready();
void main(void)

{
char ren;
int a,b,c,d ;
serial_int();
prec=1;
Robotic Arm

Page 1

Microprocessor Systems

MTR_up=0;

MTR_down=0;
MTR_left=0;
MTR_right=0;
MTR_grab=0;
MTR_leave=0;
MTR_claw_c=0;
MTR_claw_a=0;
lcdcmd(0x38);
lcdcmd(0x0E);
lcdcmd(0x01);
lcdcmd(0x06);
lcdcmd(0x80);
for(d=1;d<=10;d++)
{
lcddata('R');lcddata('e');lcddata('a');lcddata('d');lcddata('y')
;
lcdcmd(0x80);
}
while(1)
{
c=0;
if (prec==1)
{
lcdcmd(0x80);
lcddata('P');lcddata(':');lcddata('H');lcddata('i');lcddata('g')
;lcddata('h');
b=1000;
}
if (prec==0)
{
lcdcmd(0x80);
lcddata('P');lcddata(':');lcddata('L');lcddata('o');lcddata('w')
;lcddata(' ');
b=100000;
}
while(RI==0);
a=SBUF;
Robotic Arm

Page 2

Microprocessor Systems

RI=0;
lcdcmd(0XC0);
if(a==0X77)
{
MTR_up=1;
lcddata('U');lcddata('P');lcddata('.');lcddata('.');lcddata('
');
lcdcmd(0xC0);
MSDelay(b);
c++;
}
if(a==0X73)
{
MTR_down=1;
lcddata('D');lcddata('O');lcddata('W');lcddata('N');lcddata('
');
lcdcmd(0xC0);
MSDelay(b);
c++;
}
if(a==0X61)
{
MTR_left=1;
lcddata('L');lcddata('E');lcddata('F');lcddata('T');lcddata('
');
lcdcmd(0xC0);
MSDelay(b);
c++;
}
if(a==0X64)
{
MTR_right=1;
lcddata('R');lcddata('I');lcddata('G');lcddata('H');lcddata('T')
;
lcdcmd(0xC0);
MSDelay(b);
MTR_right=0;
c++;
}
if(a==0X67)
{
Robotic Arm

Page 3

Microprocessor Systems

MTR_grab=1;
lcddata('G');lcddata('R');lcddata('A');lcddata('B');lcddata('
');
lcdcmd(0xC0);
MSDelay(b);
c++;
}
if(a==0X6C)
{
MTR_leave=1;
lcddata('D');lcddata('R');lcddata('O');lcddata('P');lcddata('
');
lcdcmd(0xC0);
MSDelay(b);
MTR_leave=0;
c++;
}
if(a==0X63)
{
MTR_claw_c=1;
lcddata('C');lcddata('s');lcddata('p');lcddata('i');lcddata('n')
;
lcdcmd(0xC0);
MSDelay(b);
c++;
}
if(a==0X76)
{
MTR_claw_a=1;
lcddata('A');lcddata('S');lcddata('p');lcddata('i');lcddata('n')
;
lcdcmd(0xC0);
MSDelay(b);
MTR_claw_a=0;
c++;
}
else
{
MTR_up=0;
MTR_down=0;
Robotic Arm

Page 4

Microprocessor Systems

MTR_left=0;
MTR_right=0;
MTR_grab=0;
MTR_leave=0;
MTR_claw_a=0;
MTR_claw_c=0;
if(c==0)
{
lcddata('E');lcddata('r');lcddata('r');lcddata('o');lcddata('r')
;
lcdcmd(0xC0);
MSDelay(10000);
}
}
}
}
void serial_int()
{
TMOD=0x20;
TH1=0xFD;
SCON=0x50;
TR1=1;
}
void lcdcmd(unsigned char value)
{
lcdready();
P2=value;
rs=0;
rw=0;
en=1;
MSDelay(1);
en=0;
return;
}
void lcddata(unsigned char value)
{
Robotic Arm

Page 5

Microprocessor Systems

lcdready();
P2=value;
rs=1;
rw=0;
en=1;
MSDelay(1);
en=0;
return;
}
void lcdready()
{
busy=1;
rs=0;
rw=1;
while (busy==1)
{
en=0;
MSDelay(1);
en=1;
}
return ;
}

void MSDelay(unsigned int value)


{
unsigned int x,y;
for(x=0;x<1275;x++);
for(y=0;y<value;y++);
}

Robotic Arm

Page 6

Microprocessor Systems

1.2 Block Diagram:

Figure 1: Block Diagram

1.3 Work Division:

Proteus Design and


Programming

Robotic Arm

Hardware and
Programming

Hardware and
Circuit Patching

Page 7

Microprocessor Systems

Proteus Design and Simulation


Design:

Simulation(Precision is set as high ) :


Vertical UP Motion:

Robotic Arm

Page 8

Microprocessor Systems
Horizontal Left Motion:

Grab Motion of the Claw:

Other specified functions are also performed in a similar way.

Robotic Arm

Page 9

Microprocessor Systems

Hardware Components
1) Microcontroller 89C5
2) LCD
3) 4-DC motors
4) RS-232 USB to Serial Converter
5) 10k Resistors
6) 2-L293D Motor Drivers
7) 2-Bread Boards
8) Max-232
9) Capacitors
10) NOT-Gate
11) Wires
12) LCD headers

Details of Components used:

a) RS-232 USB to serial Converter:


This is the main input device used to serially connect laptop or computer with the
microcontroller. The w,a,s,d buttons are used to control directions while g,l are used to
control grab and leave action of the hand .The c and v keys are used to control
clockwise and counter-clockwise action of the claw.

Robotic Arm

Page 10

Microprocessor Systems

b) LCD:
An LCD will be used to display the instruction given to the robot as well as the precision
mode it is working in

c) Microcontroller (8051):
The instructions sent through the keyboard will be received by the microcontroller which
will then drive the respective motor depending upon the instruction .

Robotic Arm

Page 11

Microprocessor Systems

d) MAX-232:
Max 232 is used to convert RS-232s signal to TTL voltage level that are acceptable by
the micro- controller.

e) L293D Motor Driver:


Motor Driver is used to drive the motors clockwise or anticlockwise depending upon the
input and also supply voltage to drive the motors.

Robotic Arm

Page 12

Microprocessor Systems

f) DC motors:
DC motors were used to control the motion of the robot.

Robotic Arm

Page 13

You might also like