Feb 15, 2017

How To Make a Rover with Robotics Arm


How_to_make_AndroBot_Andro_Root_Sourabh_Kumar

How to Make AndroBot: A Rover with Robotics Arm

Previously on Andro Root, I have Posted a tutorial onHow to make an Android Controlled Robot.It was for beginners and it is having fewer functions and was very easy to build.Now I am planning for something bigger and better with lots of cool functions. Basically, AndroBot is an Android Controlled Advanced Robot and it is a combination of Android Controlled Rover With Robotics Arm.The AndroBot is inspired through a Robot which I saw in the movie" The Hurt Locker ". I am not a well experienced Robotics Project maker but I know that I can make a similar one, And I also know that it will be not of that quality, accuracy and costly but it can perform same tasks.
After many attempts, research and experiments I found all the possible combination of things to make the similar robot.The Robot Will have all the basic functions of a Rover Previous Project, and a Robotic arm will also be Attached on it.I have divided  Complete Project into Three Part which is as following 
  1. How To Make a Bluetooth Controlled Robot v2
  2. How to Make a Bluetooth Controlled Robotic Arm
Without wasting more time I will take all the parts one by one and explain them and show you that how I made it.so read the tutorial carefully and enjoy Robotics.

How To Make a Bluetooth Controlled Robot

How_to_make_AndroBot_Andro_Root_Sourabh_Kumar
First, I am explaining that how you can make an Android Controlled robot/Rover. To make this rover, I just modified the Previous Project Android Controlled Robot, and I got the result that I want to.The Rover/Bot will be controlled through the Bluetooth and all its function will be controlled through the Atmega 328p-PU Microcontroller.We are also using an L298N motor driver Board which will control the Motors.All the Above thing will be powered by a 12v battery.
 I added some Advanced Function, And the list of its functions are as Following:-
  1. Four-way Movement
  2. Front and Back-light
  3. Horn
  4. Indication Light
  5. A Smartphone can Be Added to be used as Camera.
So After All the Introduction about the plan and ideas, let's talk about the Requirements:-

Requirements To make Android Controlled Robot:-
  • 1 x Arduino Uno Board
  • 1 x L298N Motor driver Board
  • 1 x Bluetooth Module
  • 1 x 12v battery
  • 2 xWhite LED
  • 1 x Red LED
  • 1 x Indication LED Any Color
  • 4 x Bo Motor or 2 x 12v Geared Motor
  • 1 x Buzzer
  • 4 x Toy tires(if you have Bo Motors )If using 2 x 12v Geared Motor then Two Tyres and a Coster wheel.
  • 1 x Switch



Other Requirements;-
  • 1 x Robot Chassis/base: - I made it with combining 2 CD/DVD Outlets
  • 1 x PC/Laptop (Just for coding and watching the received videos from the bot)
  • Arduino IDE
  • 2 x Android Phone
  • Android App to control a robot.

How To make Rover/Robot Chassis:
The Arm will be mounted on the Rover so Please choose a solid and strong chassis I have made the Rover's Body and chassis with outlets(outer Body) of two old CD/DVD drives of PC.The Chassis and body will be Strong enough to carry the weight it will be solid and having a large space to mount all the part and components.The chassis will have same arrangements as shown in the figure below.

How_to_make_AndroBot_Andro_Root_Sourabh_KumarHow_to_make_AndroBot_Andro_Root_Sourabh_Kumar


About the components:-

Arduino Uno:-
The Arduino Board is an awesome Board which is very helpful to make and build some cool Project.The Arduino Uno R3 uses an ATmega328p-pu instead of the 8U2 or 16U2 found on the Uno (or the FTDI found on previous generations). This allows for faster transfer rates and more memory. No drivers needed for Linux or Mac (.inf file for Windows is needed and included in the Arduino IDE), and the ability to have the Uno show up as a keyboard, mouse, joystick, etc.The Uno R3 also adds SDA and SCL pins next to the AREF. In addition, there are two new pins placed near the RESET pin. One is the IOREF that allow the shields to adapt to the voltage provided from the board. The other is a not connected and is reserved for future purposes. The Uno R3 works with all existing shields but can adapt to new shields which use these additional pins.Arduino is an open-source physical computing platform based on a simple i/o board and a development environment that implements the Processing/Wiring language. Arduino can be used to develop stand-alone interactive objects or can be connected to software on your computer (e.g. Flash, Processing, Max MSP). The open-source IDE can be downloaded for free (currently for Mac OS X, Windows, and Linux).Note: The Arduino Uno R3 requires the Arduino 1.0 drivers folder in order to install properly on some computers.


  • FEATURES OF ARDUINO UNO R3:-


    • ATmega328 microcontroller
    • Input voltage - 7-12V
    • 14 Digital I/O Pins (6 PWM outputs)
    • 6 Analog Inputs
    • 32k Flash Memory
    • 16Mhz Clock Speed


Bluetooth Module:-


The HC-05 module is easy to use Bluetooth SPP (Serial Port Protocol) module, designed for transparent wireless serial connection setup.
Serial port Bluetooth module is fully qualified Bluetooth V2.0+EDR (Enhanced Data Rate) 3Mbps Modulation with complete 2.4GHz radio transceiver and baseband. It uses CSR Bluecore 04-External single chip Bluetooth system with CMOS technology and with AFH(Adaptive Frequency Hopping Feature)


Hardware Features

  • Typical -80dBm sensitivity
  • Up to +4dBm RF transmit power
  • Low Power 1.8V Operation,1.8 to 3.6V I/O
  • PIO control
  • UART interface with programmable baud rate
  • With integrated antenna
  • With edge connector
L298N Motor Driver:-

Internally the L298N consists of four independent power amps with 5-volt digital inputs and four high current, high voltage power amplifiers capable of driving single DC motors, and both unipolar and bipolar stepper motors.
The four amplifiers are usually used in pairs forming an H-bridge to switch polarity for to control the direction of a single DC motor or as two pairs of H-bridges a bi-polar stepper motor. This part seems to be the favorite of hobby robot builders.

Step By step Procedure to make An Android Controlled Robot:-
 Chassis:-
Either Use Readymade Chassis some of them are As following:-

Or Make an easy one like I made:-
  1. We need some Large space so Bring two Bad CD/DVD Drive from old PC.
  2. Open the Case/Outlet/Outer Body Of that CD/DVD drive using Screw Driver.
  3. Join them As shown in the image.

  4. Now Connect the clamps of the geared Motor, If you are using Bo Motor then fit them on the chassis as the Following diagram.


So now we have made a chassis for the complete Project.and we are moving to the next most important thing which is Circuit Assembly.
Observe the following circuit Diagram which is made by Fritzing Software and then Make the connection.

Circuit Diagram To Make an Android Controlled Robot

How_to_make_AndroBot_Andro_Root_Sourabh_Kumar


  • Power Supply:-
    • L298N's +12v         =  +12v battery
    • L298N's GND        =  Gnd of Battery and GND of Arduino
    • L298N's 5v            =  Arduino's VIN
  • Arduino Board ---- Bluetooth Module
    • Arduino's RX       = Bluetooth Module's Tx
    • Arduino's TX       = Bluetooth Module's Rx
    • Arduino's 5v         = Bluetooth Module's VCC
    • Arduino's GND    = Bluetooth Module's GND
  • Arduino Board ---- L298N Motor Driver Board
    • Arduino's 5           = in1
    • Arduino's 6           = in2
    • Arduino's 10         = in3
    • Arduino's 11         = in4
  • Arduino Board ---- LED and Buzzer
    • Arduino's 2           = Buzzer's red
    • Arduino's 3           = Red Led ( with 220ohm resistor)
    • Arduino's 4           = White LED ( with 220ohm resistor)

Code or Program to Make an Android Controlled Robot

Download the file AndroBot_rover.ino
or copy following Code and paste in IDE
//The AndroBot By Sourabh Kumar @ http://www.androroot.com
#define in1 5 //L298n Motor Driver pins.
#define in2 6
#define in3 10
#define in4 11
#define whitelight 4
#define redlight 3
#define buzzer 2
#define LED 12
int command; //Int to store app command state.
int Speed = 204; // 0 - 255.
int Speedsec;
int buttonState = 0;
int lastButtonState = 0;
int Turnradius = 0; //Set the radius of a turn, 0 - 255 Note:the robot will malfunction if this is higher than int Speed.
int brakeTime = 45;
int brkonoff = 1; //1 for the electronic braking system, 0 for normal.
void setup() {
  pinMode(LED, OUTPUT);
  pinMode(in1, OUTPUT);
  pinMode(in2, OUTPUT);
  pinMode(in3, OUTPUT);
  pinMode(in4, OUTPUT);
  pinMode(whitelight, OUTPUT);
  pinMode(redlight, OUTPUT);
  pinMode(buzzer, OUTPUT);
  Serial.begin(9600);  //Set the baud rate to your Bluetooth module.
    Serial.println("The SKY Bot");
}
 void loop()
 {if (Serial.available() > 0) {
    command = Serial.read();
    Stop(); //Initialize with motors stoped.
    switch (command) {
      case 'F':
        forward();
        break;
      case 'B':
        back();
        break;
      case 'L':
        left();
        break;
      case 'R':
        right();
        break;
      case 'G':
        forwardleft();
        break;
      case 'I':
        forwardright();
        break;
      case 'H':
        backleft();
        break;
      case 'J':
        backright();
        break;
      case '0':
        Speed = 100;
        break;
      case '1':
        Speed = 140;
        break;
      case '2':
        Speed = 153;
        break;
      case '3':
        Speed = 165;
        break;
      case '4':
        Speed = 178;
        break;
      case '5':
        Speed = 191;
        break;
      case '6':
        Speed = 204;
        break;
      case '7':
        Speed = 216;
        break;
      case '8':
        Speed = 229;
        break;
      case '9':
        Speed = 242;
        break;
      case 'q':
        Speed = 255;
        break;
     
    case 'U': // Red light on
    Serial.println("Red LIght On");
    digitalWrite(redlight, HIGH);
    break;
 
    case 'u': // Red light off
    Serial.println("Red Light Off");  
    digitalWrite(redlight, LOW);
    break;
 
    case 'W': // Front Lights On
    Serial.println("White LIght On");
    digitalWrite(whitelight, HIGH);
    break;
 
    case 'w': // Front Lights Off
    Serial.println("White Light Off");  
    digitalWrite(whitelight, LOW);
    break;
 
    case 'V': //Buzzer On
    Serial.println("Buzzer On");
    digitalWrite(buzzer, HIGH);
    break;
 
    case 'v': // Buzzer OFF
    Serial.println("Buzzer Off");  
    digitalWrite(buzzer, LOW);
    break;
    }
    Speedsec = Turnradius;
    if (brkonoff == 1) {
      brakeOn();
    } else {
      brakeOff();
    }
  }
}
void forward() {
  analogWrite(in1, Speed);
  analogWrite(in3, Speed);
}
void back() {
  analogWrite(in2, Speed);
  analogWrite(in4, Speed);
}
void left() {
  analogWrite(in3, Speed);
  analogWrite(in2, Speed);
}
void right() {
  analogWrite(in4, Speed);
  analogWrite(in1, Speed);
}
void forwardleft() {
  analogWrite(in1, Speedsec);
  analogWrite(in3, Speed);
}
void forwardright() {
  analogWrite(in1, Speed);
  analogWrite(in3, Speedsec);
}
void backright() {
  analogWrite(in2, Speed);
  analogWrite(in4, Speedsec);
}
void backleft() {
  analogWrite(in2, Speedsec);
  analogWrite(in4, Speed);
}
void Stop() {
  analogWrite(in1, 0);
  analogWrite(in2, 0);
  analogWrite(in3, 0);
  analogWrite(in4, 0);
}
void brakeOn() {
  //Here's the future use: an electronic braking system!
  // read the pushbutton input pin:
  buttonState = command;
  // compare the buttonState to its previous state
  if (buttonState != lastButtonState) {
    // if the state has changed, increment the counter
    if (buttonState == 'S') {
      if (lastButtonState != buttonState) {
        digitalWrite(in1, HIGH);
        digitalWrite(in2, HIGH);
        digitalWrite(in3, HIGH);
        digitalWrite(in4, HIGH);
        delay(brakeTime);
        Stop();
      }
    }
    // save the current state as the last state,
    //for next time through the loop
    lastButtonState = buttonState;
  }
}
void brakeOff() {
}




Android App:-
I Found some good apps on Playstore and I also made an App for controlling the Rover:-
Links are as following:-

Option 1:-

How_to_make_AndroBot_Andro_Root_Sourabh_Kumar



The application allows you to control an Arduino based RC car over Bluetooth. This is done using a Bluetooth enabled Android phone. Visit this site https://sites.google.com/site/bluetoothrccar/ for the Arduino code and control circuit. The app lets you control the car with either buttons or the phone's accelerometer. A slider bar allows you to control your car's velocity if the car's control circuit has this feature. There are also two buttons for front and back lights. A flashing light lets you know when the phone is connected to the car, and arrows light up letting you know the car's driving direction.
Option 2:-
How_to_make_AndroBot_Andro_Root_Sourabh_Kumar

With the help of MIT App Developer website I made an app and it is in beta test mode so you can give a try and then if anything goes wrong then we will solve that problem here is the link to my app.




Download the App and Install it in Android Smartphone.

Now we have to burn The code to the Arduino:

Steps are as following:-
  1. Download or copy the Code from the section Code or Program to Make an Android Controlled Robot v2 above.
  2. Now start Your computer transfer the .ino file and open it with Arduino IDE.
  3. Connect the Arduino Board and computer with Connecting Cable.
  4. Select the Port and Board
  5. Compile and Burn the code by clicking on the Upload button which will be on the Top-Left Corner of the IDE.
So now Everything is completed and Our BOT/ROVER is ready.And We just have to Power it UP by Switching It ON.


Steps to Controlling the Rover through The Android Phone:-

  1. Switch the Rover On
  2. In your Phone Go to Settings and find the Bluetooth settings.
  3. Switch on the Bluetooth of the Android Phone, And Search for new Bluetooth Devices.
  4. HC-04/05 will be Appear in the List after search result.
  5. Pair with the Bluetooth module by using Password:-1234
  6. Now Open the Android App and click on Connect or connect to the bot.
  7. A new window will appear in which all the Bluetooth devices will appear.
  8. Click on HC-04/05.
  9. Now your bot is connected with the android Smartphone.
  10. Observe the Buttons and check then one by one by pressing them.
  11. To add a camera take an android phone and install the AirDroid app in your Smartphone and also on Computer and connect them.Camera option will appear on the main menu on desktop AirDroid click on it.Now place the smartphone in the free space of the rover.
I am not explaining the last step because I have some different plan, I will add the camera in the next step.



Working of the Bluetooth Controlled Rover Circuit:-
First of all the switch, the Rover "ON" and Bluetooth module will also turn to on with it.we have to connect the Rover with the Smartphone using above steps.Now after successful connection we have to press any button let it is Forward button so it will send the "F" text to the Arduino
and in the program, F denotes Forward 
void forward() {
  analogWrite(in1, Speed);
  analogWrite(in3, Speed);

and it will enable pin 5,6 of Arduino and these pins are connected to in1 and in2 pins of L298N motor driver Module so it is giving power supply to motors to rotate. and thus the rover move forward.we have to press Stop button after every successful command execution.thus the previous command will be stopped.and thus all the direction buttons will work. There is also a slider to control the motor speed. which sends the value between 0 to 10 thus the speed of motor controlled.
In the App, there is also 3 extra buttons available for some extra functions like Light and Horn.On the click, a Capital letter is transferred on the Long click small letter is transferred to the Arduino and it is matched to the program and according to the program and digital pin either enable or disable thus the Led and buzzer switched on( with Capital letter) or off ( with the small letter).
thus the complete rover works.


Also Read:-
Haptic Proximity Module - Cheap and Easy
Make An Ultrasonic Radar or USDAR
How_to_make_AndroBot_Andro_Root_Sourabh_Kumar


If everything goes right and working then congratulate.you have completed Part 1  How To Make a Bluetooth Controlled Rover v2 of AndroBot and we are ready to move on the next step.

How to Make an Android-Controlled Robotic Arm


How to Make Bluetooth Controlled Robotic Arm Andro Root Sourabh Kumar
 So after completing First Part, I am going to explain every single step which I used to Make a Bluetooth Controlled Robotics Arm.The Robotics arm will be able to and drop any small things.and rotates in 180 degrees Right - Left angle other thing depends on the design.The Robotics Arm will be controlled through the Bluetooth and all its function will be controlled through the Atmega 328p-PU Micro-controller. We are using 4 Servo controller and all of the things will be powered by any Powerbank or 9v battery.

So After All the Introduction about the plan and ideas lets talk about the Requirements.
Requirements To make Bluetooth Controlled Robotics arm:-
  • 1 x Arduino Uno Board
  • 1 x Bluetooth Module
  • 1 x Power Bank or 9v battery
  • 1 x Indication LED Any Color
  • 4 x 9g Micro Servo Motor with gears and clamps
  • 1 x Switch
Other Requirements:-
A strong base
Some chopstick or Scales or Metallic sticks.
Circular strong but thin sheet.
Double side tape or super glue
Glu gun with stick
& an Android Smartphone


About the components:-

9G Micro Servo 

Tiny and lightweight with high output power. The servo can rotate approximately 180 degrees (90 in each direction) and works just like the standard kinds but smaller. You can use any servo code, hardware or library to control these servos. Good for beginners who want to make stuff move without building a motor controller with feedback & gear box, especially since it will fit in small places. It comes with 3 horns (arms) and hardware.
Stall torque: 1.8 kgf·cm.
Operating speed: 0.1 s/60 degrees.
Operating voltage: 4.8 V (~5V)
Wire:-
Brown (Black) - GND
Red - VCC
Orange - PWM (Signal)
Construction:-
How to Make Bluetooth Controlled Robotic Arm Andro Root Sourabh Kumar

How to Make Bluetooth Controlled Robotic Arm Andro Root Sourabh Kumar

I am using My rover as a Platform/base and I am posting some pictures of the plan and setup so it will be easy to make the similar arm and you don't have to think more about the design but you have to make the wires of servo longer by adding some wires.

Circuit Diagram:-

How to Make Bluetooth Controlled Robotic Arm Andro Root Sourabh Kumar

Circuit Assembly:-

Arduino Uno's   10 - Bluetooth Module TX
Arduino Uno's   11 - Bluetooth Module RX
Servo 1's Orange- Arduino Uno's 3
Servo 2's Orange- Arduino Uno's 5
Servo 3's Orange- Arduino Uno's 6
Servo 4's Orange- Arduino Uno's 9

Also Read:-
Arduino Code:-

Download the AndroBot_Arm.ino or Copy the following code
//AndroBot Arm by Sourabh Kumar @ http://www.androroot.com
#include <SoftwareSerial.h>
#include <Servo.h>
Servo myservo1, myservo2, myservo3, myservo4;
int bluetoothTx = 10;
int bluetoothRx = 11;
SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);
void setup()
{
  myservo1.attach(3);
  myservo2.attach(5);
  myservo3.attach(6);
  myservo4.attach(9);
  Serial.begin(9600);
  bluetooth.begin(9600);
}
void loop()
{
  if(bluetooth.available()>= 2 )
  {
    unsigned int servopos = bluetooth.read();
    unsigned int servopos1 = bluetooth.read();
    unsigned int realservo = (servopos1 *256) + servopos;
    Serial.println(realservo);
    if (realservo >= 1000 && realservo <1180) {
      int servo1 = realservo;
      servo1 = map(servo1, 1000, 1180, 0, 180);
      myservo1.write(servo1);
      Serial.println("Servo 1 ON");
      delay(10);
    }
    if (realservo >= 2000 && realservo <2180) {
      int servo2 = realservo;
      servo2 = map(servo2, 2000, 2180, 0, 180);
      myservo2.write(servo2);
      Serial.println("Servo 2 ON");
      delay(10);
    }
    if (realservo >= 3000 && realservo <3180) {
      int servo3 = realservo;
      servo3 = map(servo3, 3000, 3180, 0, 180);
      myservo3.write(servo3);
      Serial.println("Servo 3 ON");
      delay(10);
    }
    if (realservo >= 4000 && realservo <4180) {
      int servo4 = realservo;
      servo4 = map(servo4, 4000, 4180, 0, 180);
      myservo4.write(servo4);
      Serial.println("Servo 4 ON");
      delay(10);
    }
  }
}

Steps to Burn or Upload the code to the Arduino:

Steps are as following:-
  1. Download or copy the Code from the above section 
  2. Now start Your computer transfer the .ino file and open it with Arduino IDE.
  3. Connect the Arduino Board and computer with Connecting Cable.
  4. Select the Port and Board
  5. Compile and Burn the code by clicking on the Upload button which will be on the Top-Left Corner of the IDE.
So now Everything is completed and Our Robotics Arm is ready.And We just have to Power it UP by Switching It ON.


Android App- AndroBot_Arm to control 4 servos (Robotics Arm)

AndroBot_Arm by Sourabh Kumar(MIT app Inventor) 

How to Make Bluetooth Controlled Robotic Arm Andro Root Sourabh Kumar

I have Developed an app "AndroBot_Arm" for android smartphones with the help of MIT app Inventor, and it is able to make the connection with the arm through Bluetooth and can control 4 servo.i am still learning and will update regularly.so visit our site and follow our social profiles.Click on the image to see the details of all options and buttons.
Download The app AndroBot _Arm by Sourabh Kumar from Here:-

AndroBot_Arm.apk by Sourabh Kumar

Steps to Controlling the Robotics Arm through The Android Phone:-

  1. Switch the Arm by switch it  ON
  2. In your Phone Go to Settings and find the Bluetooth settings.
  3. Switch on the Bluetooth of the Android Phone, And Search for new Bluetooth Devices.
  4. HC-04/05 will be Appear in the List after search result.
  5. Pair with the Bluetooth module by using Password:-1234
  6. Now Open the Android App and click on Connect.
  7. A new window will appear in which all the Bluetooth devices will appear.
  8. Click on HC-04/05.
  9. Now your Robotics Arm is connected with the android Smartphone.
  10. Now in the app, there is 4 Slider (One slide for one servo).
  11. Try one by one they will control the arm.
Working of the Robotic arm Circuit:-
First of all the switch the arm "ON" and Bluetooth module will also be turned to on with it.we have to connect the arm with the Smartphone using above steps.Now after the successful connection, we have to move the slides right or left. Every slide has some values similar to X000 to X180.where X= 1,2,3,4.Now when we move slider then a number or date is transferred to the Arduino through Bluetooth module.Now the Date is converted to the angle with the help of Program and Library now according to the angle PWM signal is given to the Pins of Arduino.Orange wire or signal wire of all servo is connected to the PWM pin of Arduino.Thus the servo's gear also rotates to the angle.Similarly, the working is same for all the servo, and Thus the Robotics Arm works.

Also Read:-
Haptic Proximity Module - Cheap and Easy
Make An Ultrasonic Radar or USDAR

If everything goes right and working then congratulations.you have completed the Robotics Arm.Now use your creativity and sense to mount the Arm on the Rover.Fix all the Wires and check the power supply.
How_to_make_AndroBot_Andro_Root_Sourabh_Kumar

Application of AndroBot:-


  • We can use it To do some Cool pick and drop Tasks at home, at outside or at the office.
  • In military.Specially in Bomb Diffusion.
  • As a Spy Rover.etc
So finally The Project AndroBot is completed and we have learned many things from this project specially in the coding and assembly.I have presented this project in Tech Fest 2017 organized in my college and won a Medal for it.I have completed it in three days and I hope you can make it quicker than me.I am still finding/Searching the way to combine both of the circuits on a single circuit board and control it by single Smartphone.I will modify this post whenever I will find that way till then think about what modification we can do in AndroBot and if you found any good idea share with us.Enjoy Robotics.



0 comments:

Post a Comment

Join Us on Facebook