Robotic Arm - Project Report
Robotic Arm - Project Report
Digital
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
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 ;
}
Robotic Arm
Page 6
Microprocessor Systems
Robotic Arm
Hardware and
Programming
Hardware and
Circuit Patching
Page 7
Microprocessor Systems
Robotic Arm
Page 8
Microprocessor Systems
Horizontal Left Motion:
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
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.
Robotic Arm
Page 12
Microprocessor Systems
f) DC motors:
DC motors were used to control the motion of the robot.
Robotic Arm
Page 13