I have developed simple ROBO-CAR using 8051 micro-controller &
programmed with Serial Communication coding. This controller connected
with HC-05 Bluetooth module. By developing Android App Which takes
command from Accelerometer Sensor and send those values to System via
Bluetooth. So when we Tilt our mobile, it gives movement to ROBO-CAR
(i.e. named as ANDROBO)
(ANDROBO with bluetooth module.
this module directly connected to RXD & TXD pin of microcontroller.)

(while pairing with module,it ask for security PIN CODE )
(forward movement of ANDROBO)
(Left movment of Androbo)
How to use
• Turn on your robot and this application
• Press "PAIR" and scan bluetooth on your robot and select it
• Waiting for connection
• You can control your robot now
If you want to changed command button
• Press menu button on your device then command button will enlarge
• Select a button you want to change
• Select command button you want
• Press menu button again or back button to complete the command button setting
This application use bluetooth connection in Serial Port Profile (SPP).Send hex code to robot as follows :
0x30 = Stop
0x38 = Up
0x32 = Down
0x34 = Left
0x36 = Right
0x41 = Auto Grab
0x42 = Auto Release
0x43 = Grab
0x44 = Release
0x45 = Rotate Left
0x46 = Rotate Right
Your robot will have bluetooth connection, and programmed with bluetooth connection code
Special Thanks to INEX who provided nice app to control robot:
You can customize that application.
Source code of App is also provided on following link:
https://play.google.com/store/apps/details?id=com.inex.BlueStickControl
if you have any query mail me at:
dexterganesh@gmail.com
Serial Programming For ROBOT:
here we added program for ROBOTIC ARM (customize values to be send as per your requirement)
/************************wireless robotic arm.C**************************************/
#include <reg51f.h> //Include registrey files for P89v51RD2
#include <stdio.h> //standard Input Output library for UARt communication
//Right Wheel :-
sbit RENA = P1^0; //a=clockwise rotation
sbit RENB = P1^1; //b=antickoclwise rotation
//Left Wheel :-
sbit LENA = P1^2;
sbit LENB = P1^3;
//Enable Left and Right MOTOR
sbit LEFT_EN = P0^4;
sbit RIGHT_EN = P0^5;
//Grabber motor
sbit AENA = P1^4; //a=clockwise rotation
sbit AENB = P1^5; //b=anticlockwise rotation
//upward and downward movement to ARM
sbit DENA = P1^6;
sbit DENB = P1^7;
sbit ARM_EN = P0^6;
sbit DIR_EN = P0^7;
void delay(unsigned char val) // delay function
{
unsigned int k,l,m;
for(m=0;m<val;m++)
for(k=0;k<500;k++)
for(l=0;l<100;l++);
}
void Drive_Motor1(unsigned char LEFT,unsigned char RGHT)
{
if(RGHT==0)//if right == 0 then right motor will stop
{
RENA=1;
RENB=1;
}
if(RGHT==1)//if right == 1 then right motor will go forward
{
RENA=0;
RENB=1;
}
if(RGHT==2)//if right == 2 then right motor will go backward
{
RENA=1;
RENB=0;
}
if(LEFT==0)//if left == 0 then left motor will stop
{
LENA=1;
LENB=1;
}
if(LEFT==1)//if left == 1 then left motor will go forward
{
LENA=1;
LENB=0;
}
if(LEFT==2)//if left == 2 then right motor will go backward
{
LENA=0;
LENB=1;
}
}
void Drive_Motor2(unsigned char ARM,unsigned char DIR)
{
if(ARM==0)//if ARM == 0 then arm motor will stop
{
AENA=1;
AENB=1;
}
if(ARM==1)//if ARM == 1 then arm motor will go grab
{
AENA=0;
AENB=1;
}
if(ARM==2)//if ARM == 2 then right motor will release
{
AENA=1;
AENB=0;
}
if(DIR==0)//if DIR == 0 then DIR motor will stop
{
DENA=1;
DENB=1;
}
if(DIR==1)//if DIR == 1 then left motor will go UP
{
DENA=1;
DENB=0;
}
if(DIR==2)//if DIR == 2 then right motor will go DOWN
{
DENA=0;
DENB=1;
}
}
void Motor_Init(void)
{
LEFT_EN = 0; //enable left motor
RIGHT_EN = 0; //enable right motor
Drive_Motor1(0,0);
ARM_EN=0; //ENABLE ARM MOTOR
DIR_EN=0; // ENABLE DIR MOTOR
Drive_Motor2(0,0);
}
void main(void)
{
unsigned char key;
/**** Serial Initanlisation Start here ****/
SCON|=0x50; //set UART in standard 8 bit mode and Recive Enable
TMOD|=0x20; //Timer 1 in 8 bit auto Relaod mode
TH1=0xFD; //0xFD is value to be loaded for 9600 baud ratewith SMOD =0 and
TL1=0xFD; //Not necessory to load this value as it will be reloded from TH1
TR1=1; //Run the timer 1 so that UART will function
// TI=1; //if you are going to use printf function then u have to set TI=1 to initilse UARt commn
/**** Serial Initanlisation Ends here ****/
Motor_Init();
while(1) //real time systems are always working hence while(TRUE) i.e TRUE =1
{
if(RI)
{
key=SBUF;
RI=0;
if(key=='Q' || key=='q') //left
{
Drive_Motor1(0,1);
delay(50);
Drive_Motor1(0,0);
}
if(key=='E' || key=='e') //rght
{
Drive_Motor1(1,0);
delay(50);
Drive_Motor1(0,0);
}
if(key=='W' || key=='w') //frwrd
{
Drive_Motor1(1,1);
delay(50);
Drive_Motor1(0,0);
}
if(key=='X' || key=='x') //bkwrd
{
Drive_Motor1(2,2);
delay(50);
Drive_Motor1(0,0);
}
if(key=='S' || key=='s') //stop gaddi
{
Drive_Motor1(0,0);
}
if(key=='U' || key=='u') //up arm
{
Drive_Motor2(0,1);
delay(50);
Drive_Motor2(0,0);
}
if(key=='D' || key=='d') //down arm
{
Drive_Motor2(0,2);
delay(50);
Drive_Motor2(0,0);
}
if(key=='G' || key=='g') //grab arm
{
Drive_Motor2(1,0);
delay(50);
Drive_Motor2(0,0);
}
if(key=='R' || key=='r') // release arm
{
Drive_Motor2(2,0);
delay(50);
Drive_Motor2(0,0);
}
if(key=='V' || key=='v' || key=='B' || key=='B') // stop arm
{
Drive_Motor2(0,0);
}
}
}
}
(ANDROBO with bluetooth module.
this module directly connected to RXD & TXD pin of microcontroller.)

(while pairing with module,it ask for security PIN CODE )
(forward movement of ANDROBO)
(Left movment of Androbo)
How to use
• Turn on your robot and this application
• Press "PAIR" and scan bluetooth on your robot and select it
• Waiting for connection
• You can control your robot now
If you want to changed command button
• Press menu button on your device then command button will enlarge
• Select a button you want to change
• Select command button you want
• Press menu button again or back button to complete the command button setting
This application use bluetooth connection in Serial Port Profile (SPP).Send hex code to robot as follows :
0x30 = Stop
0x38 = Up
0x32 = Down
0x34 = Left
0x36 = Right
0x41 = Auto Grab
0x42 = Auto Release
0x43 = Grab
0x44 = Release
0x45 = Rotate Left
0x46 = Rotate Right
Your robot will have bluetooth connection, and programmed with bluetooth connection code
Special Thanks to INEX who provided nice app to control robot:
You can customize that application.
Source code of App is also provided on following link:
https://play.google.com/store/apps/details?id=com.inex.BlueStickControl
if you have any query mail me at:
dexterganesh@gmail.com
Serial Programming For ROBOT:
here we added program for ROBOTIC ARM (customize values to be send as per your requirement)
/************************wireless robotic arm.C**************************************/
#include <reg51f.h> //Include registrey files for P89v51RD2
#include <stdio.h> //standard Input Output library for UARt communication
//Right Wheel :-
sbit RENA = P1^0; //a=clockwise rotation
sbit RENB = P1^1; //b=antickoclwise rotation
//Left Wheel :-
sbit LENA = P1^2;
sbit LENB = P1^3;
//Enable Left and Right MOTOR
sbit LEFT_EN = P0^4;
sbit RIGHT_EN = P0^5;
//Grabber motor
sbit AENA = P1^4; //a=clockwise rotation
sbit AENB = P1^5; //b=anticlockwise rotation
//upward and downward movement to ARM
sbit DENA = P1^6;
sbit DENB = P1^7;
sbit ARM_EN = P0^6;
sbit DIR_EN = P0^7;
void delay(unsigned char val) // delay function
{
unsigned int k,l,m;
for(m=0;m<val;m++)
for(k=0;k<500;k++)
for(l=0;l<100;l++);
}
void Drive_Motor1(unsigned char LEFT,unsigned char RGHT)
{
if(RGHT==0)//if right == 0 then right motor will stop
{
RENA=1;
RENB=1;
}
if(RGHT==1)//if right == 1 then right motor will go forward
{
RENA=0;
RENB=1;
}
if(RGHT==2)//if right == 2 then right motor will go backward
{
RENA=1;
RENB=0;
}
if(LEFT==0)//if left == 0 then left motor will stop
{
LENA=1;
LENB=1;
}
if(LEFT==1)//if left == 1 then left motor will go forward
{
LENA=1;
LENB=0;
}
if(LEFT==2)//if left == 2 then right motor will go backward
{
LENA=0;
LENB=1;
}
}
void Drive_Motor2(unsigned char ARM,unsigned char DIR)
{
if(ARM==0)//if ARM == 0 then arm motor will stop
{
AENA=1;
AENB=1;
}
if(ARM==1)//if ARM == 1 then arm motor will go grab
{
AENA=0;
AENB=1;
}
if(ARM==2)//if ARM == 2 then right motor will release
{
AENA=1;
AENB=0;
}
if(DIR==0)//if DIR == 0 then DIR motor will stop
{
DENA=1;
DENB=1;
}
if(DIR==1)//if DIR == 1 then left motor will go UP
{
DENA=1;
DENB=0;
}
if(DIR==2)//if DIR == 2 then right motor will go DOWN
{
DENA=0;
DENB=1;
}
}
void Motor_Init(void)
{
LEFT_EN = 0; //enable left motor
RIGHT_EN = 0; //enable right motor
Drive_Motor1(0,0);
ARM_EN=0; //ENABLE ARM MOTOR
DIR_EN=0; // ENABLE DIR MOTOR
Drive_Motor2(0,0);
}
void main(void)
{
unsigned char key;
/**** Serial Initanlisation Start here ****/
SCON|=0x50; //set UART in standard 8 bit mode and Recive Enable
TMOD|=0x20; //Timer 1 in 8 bit auto Relaod mode
TH1=0xFD; //0xFD is value to be loaded for 9600 baud ratewith SMOD =0 and
TL1=0xFD; //Not necessory to load this value as it will be reloded from TH1
TR1=1; //Run the timer 1 so that UART will function
// TI=1; //if you are going to use printf function then u have to set TI=1 to initilse UARt commn
/**** Serial Initanlisation Ends here ****/
Motor_Init();
while(1) //real time systems are always working hence while(TRUE) i.e TRUE =1
{
if(RI)
{
key=SBUF;
RI=0;
if(key=='Q' || key=='q') //left
{
Drive_Motor1(0,1);
delay(50);
Drive_Motor1(0,0);
}
if(key=='E' || key=='e') //rght
{
Drive_Motor1(1,0);
delay(50);
Drive_Motor1(0,0);
}
if(key=='W' || key=='w') //frwrd
{
Drive_Motor1(1,1);
delay(50);
Drive_Motor1(0,0);
}
if(key=='X' || key=='x') //bkwrd
{
Drive_Motor1(2,2);
delay(50);
Drive_Motor1(0,0);
}
if(key=='S' || key=='s') //stop gaddi
{
Drive_Motor1(0,0);
}
if(key=='U' || key=='u') //up arm
{
Drive_Motor2(0,1);
delay(50);
Drive_Motor2(0,0);
}
if(key=='D' || key=='d') //down arm
{
Drive_Motor2(0,2);
delay(50);
Drive_Motor2(0,0);
}
if(key=='G' || key=='g') //grab arm
{
Drive_Motor2(1,0);
delay(50);
Drive_Motor2(0,0);
}
if(key=='R' || key=='r') // release arm
{
Drive_Motor2(2,0);
delay(50);
Drive_Motor2(0,0);
}
if(key=='V' || key=='v' || key=='B' || key=='B') // stop arm
{
Drive_Motor2(0,0);
}
}
}
}



No comments:
Post a Comment