Fig. 1: Block Diagram of Web Controlled Robot
Firstly for this project an Android phone is needed along with an internet connection and a “Getblue” application. This app gets command from website and sends it to Arduino/Microcontroller through Bluetooth. After getting the command from phone, Arduino/Microcontroller can control any kind of robot, home security and automation. [Note: Always keep the Android phone with robot or module.
v Website Design:
Html, JavaScript, php and Css languages were used for website. “http://www.w3schools.com” is suitable for the beginner.
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
<iframe width=”420″ height=”315″ src=”https://www.youtube.com/embed/oJzkwEZSQ70″ frameborder=”0″ allowfullscreen></iframe>
Live event page in youtube
Fig. 2: Screenshot of Live Event Page on YouTube
Fig. 3: Screenshot of Video Embed Code for the Website
For tracing the robot, “Mobiucare” application is used. Sign in “http://www.mobiucare.com” and switch on the GPS option of the android phone. In “spy_robot.php”, below code is for “mobiucare” tracking application.
· “Getblue” Setup:
Fig. 4: Screenshot of GetBlue Setup
Fig. 5: Screenshot of switching Bluetooth Connection for GetBlue App
Fig. 6: Screenshot showing Data Source setting on GetBlue App
Fig. 7: Screenshot of GetBlue App’s Data Settings
Fig: 11-14- From setting, open these options and select as shown in the pictures.
Fig. 8: Screenshot of Additional Settings done in the GetBlue App
Fig: 16- Also select both the above options from setting.
• Backup:
Fig. 9: Block Representation of Web Controlled Robot
If there is no internet connection then RF controller can be used as backup. For this control system, there is a Tx remote for sending command and an Rx module in robot part for receiving command.
(Check the circuit diagram tab for complete circuit for Web Controlled System)
Fig. 10: Prototype of RF Transmitter
Fig. 11: Prototype of RF Receiver mounted on Robot
Robot:
Fig. 12: Prototype of Web Controlled Robotic Tank
Fig. 13: Prototype of Arduino based Control Circuit mounted on Web Controlled Robot
Fig. 14: Image showing Arduino based Control Circuit in action on Web Controlled Robot
Fig. 15: Circuit Diagram of Arduino based Web Controlled Robot
Project Source Code
###
#include <Servo.h>#include <SoftwareSerial.h>Servo srvoleg;int angle;String Blue_Car;String cmd; // For Changing The Command From BT To RF & Vice VersaString BT; // BT & RF Are Used To Print Some Data Through Serial Ports..String RF; // BT & RF Are Used To Print Some Data Through Serial Ports..//For RF Pin Definition#define RF_1 2 // Near The IC RF_1 & Count CCW For RF_2, RF_3, RF_4#define RF_2 3#define RF_3 4#define RF_4 5//For Motor Pin Definition#define Motor_1_1 6 // C On Motor Driver#define Motor_1_2 7 // D On Motor Driver#define Motor_2_1 8 // B On Motor Driver#define Motor_2_2 9 // A On Motor Driver#define servocam A1SoftwareSerial BlueTooth(10, 11); // RX, TX : (10 = RX Of Arduino With TX Of Bluetooth, 11 = TX Of Arduino With RX Of Bluetooth)// @@@@ Used Pins Are : 2 3 4 5 6 7 8 9 10 11 12 A1void setup(){Serial.begin(9600);BlueTooth.begin(9600);pinMode(Motor_1_1, OUTPUT);pinMode(Motor_1_2, OUTPUT);pinMode(Motor_2_1, OUTPUT);pinMode(Motor_2_2, OUTPUT);pinMode(RF_1, INPUT);pinMode(RF_2, INPUT);pinMode(RF_3, INPUT);pinMode(RF_4, INPUT);cmd = "all";BT = "BlueTooth Command Enabled";RF = "RF Controller Command Enabled";// Initialization Of The DeviceSerial.println("Initialization Complete & Waiting For Command");BlueTooth.println("Initialization Complete & Waiting For Command");Stop();Srvo_close();}void loop(){Blue_Car=""; //Reset the variable after initiatingwhile (BlueTooth.available())//Check if there is an available byte to read{delay(5); //Delay added to make thing stable in mschar c = BlueTooth.read(); //Conduct a serial readif (c == '#') //Exit the loop when the # is detected after the word{ break; }Blue_Car += c; //Shorthand for Blue_Car = Blue_Car + c}while (Serial.available())//Check if there is an available byte to read{delay(5); //Delay added to make thing stablechar c = Serial.read(); //Conduct a serial readif (c == '#') //Exit the loop when the # is detected after the word{ break; }Blue_Car += c; //Shorthand for Blue_Car = Blue_Car + c}// Changing Command Control From Bluetooth Moduleif (Blue_Car.length() > 0){if( Blue_Car == "rf" ){ cmd = Blue_Car ;Serial.println(RF);BlueTooth.println(RF);}if( Blue_Car == "bt" ){ cmd = Blue_Car ;Serial.println(BT);BlueTooth.println(BT);}}// Changing Command Control From RF Moduleif ( digitalRead(RF_1) == LOW && digitalRead(RF_2) == HIGH && digitalRead(RF_3) == LOW && digitalRead(RF_4) == HIGH){ cmd = "bt";Stop();Serial.println(BT);BlueTooth.println(BT);}if ( digitalRead(RF_1) == LOW && digitalRead(RF_2) == HIGH && digitalRead(RF_3) == HIGH && digitalRead(RF_4) == LOW){ cmd = "rf";Stop();Serial.println(RF);BlueTooth.println(RF);}//@@@@@ Start Of Bluetooth command @@@@@if ((cmd == "bt") || (cmd == "all")){if (Blue_Car.length() > 0){if (cmd == "all" ){cmd = "bt";Serial.println(BT);BlueTooth.println(BT);}BlueTooth.println(Blue_Car);Serial.println(Blue_Car);if(Blue_Car == "*stop") //Turn of All Pins (Call Function){ Stop(); }if(Blue_Car == "*go"){ Forward(); }if(Blue_Car == "*back"){ Backward(); }if(Blue_Car == "*right"){ Right(); }if(Blue_Car == "*left"){ Left(); }if(Blue_Car == "*servoon"){Srvo_open();delay(20);}if(Blue_Car == "*servooff"){Srvo_close();delay(20);}if(Blue_Car == "*res"){Stop();delay(5);Srvo_close();delay(5);}if(Blue_Car == "*a"){Forward();Srvo_open();}if(Blue_Car == "*@"){Srvo_open();delay(20);Forward();}}}//#### Start Of RF Command ####if ((cmd == "rf") || (cmd == "all")){if(cmd == "all" ){if( digitalRead(RF_1) == LOW || digitalRead(RF_2) == LOW || digitalRead(RF_3) == LOW || digitalRead(RF_4) == LOW ){ cmd= "rf";Serial.println(RF);BlueTooth.println(RF);}}if( cmd == "rf" ){if ( digitalRead(RF_1) == LOW && digitalRead(RF_2) == HIGH && digitalRead(RF_3) == HIGH && digitalRead(RF_4) == HIGH){ Forward(); }if (digitalRead(RF_1) == HIGH && digitalRead(RF_2) == LOW && digitalRead(RF_3) == HIGH && digitalRead(RF_4) == HIGH){ Left(); }if ( digitalRead(RF_1) == HIGH && digitalRead(RF_2) == HIGH && digitalRead(RF_3) == LOW && digitalRead(RF_4) == HIGH){ Backward(); }if ( digitalRead(RF_1) == HIGH && digitalRead(RF_2) == HIGH && digitalRead(RF_3) == HIGH && digitalRead(RF_4) == LOW){ Right(); }if ( digitalRead(RF_1) == HIGH && digitalRead(RF_2) == LOW && digitalRead(RF_3) == LOW && digitalRead(RF_4) == HIGH){ Stop(); Srvo_open(); }if ( digitalRead(RF_1) == HIGH && digitalRead(RF_2) == HIGH && digitalRead(RF_3) == LOW && digitalRead(RF_4) == LOW){ Stop(); Srvo_close(); }if ( digitalRead(RF_1) == HIGH && digitalRead(RF_2) == HIGH && digitalRead(RF_3) == HIGH && digitalRead(RF_4) == HIGH){ Stop(); }}}}// End Of void loopvoid Stop(){digitalWrite(Motor_1_1, LOW);digitalWrite(Motor_1_2, LOW);digitalWrite(Motor_2_1, LOW);digitalWrite(Motor_2_2, LOW);Serial.println("Don't Move");BlueTooth.println("Don't Move");delay(11);}void Forward(){digitalWrite(Motor_1_1, LOW);digitalWrite(Motor_1_2, HIGH);digitalWrite(Motor_2_1, LOW);digitalWrite(Motor_2_2, HIGH);Serial.println("Move Forward");BlueTooth.println("Move Forward");delay(11);}void Backward(){digitalWrite(Motor_1_1, HIGH);digitalWrite(Motor_1_2, LOW);digitalWrite(Motor_2_1, HIGH);digitalWrite(Motor_2_2, LOW);Serial.println("Move Back");BlueTooth.println("Move Back");delay(11);}void Right(){digitalWrite(Motor_1_1, LOW);digitalWrite(Motor_1_2, HIGH);digitalWrite(Motor_2_1, HIGH);digitalWrite(Motor_2_2, LOW);Serial.println("Move Left");BlueTooth.println("Move Left");delay(11);}void Left(){digitalWrite(Motor_1_1, HIGH);digitalWrite(Motor_1_2, LOW);digitalWrite(Motor_2_1, LOW);digitalWrite(Motor_2_2, HIGH);Serial.println("Move Right");BlueTooth.println("Move Right");delay(11);}void Srvo_open(){if(angle < 95){srvoleg.attach(A1);for(angle = angle; angle < 100; angle=angle+2){srvoleg.write(angle);delay(11);}srvoleg.detach();}Serial.println("Srvo Open");BlueTooth.println("Srvo Open");}void Srvo_close(){if (angle > 5){srvoleg.attach(servocam);for(angle = angle; angle > 0; angle=angle-3){srvoleg.write(angle);delay(11);}srvoleg.detach();}Serial.println("Srvo Close");BlueTooth.println("Srvo Close");}/////////////////////////////////////////////Command button code: ////1. back.php ////2. blue.php ////3. go.php ////4. left.php ////5. rf.php ////6. right.php ////7. servooff.php ////8. servoon.php ////9. stop.php //////////////////////////////////////Command Calling Code: ////1. Spy.php ///////////////////////////////////Command Save File: ////1. Spy.txt ////////////////////////////////Page Style Code:1. spy_robot.css//////////////////////////Mani page Code:1. spy_robot.php###
Circuit Diagrams
Filed Under: Electronic Projects
Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.
Tell Us What You Think!!
You must be logged in to post a comment.