Friday, December 19, 2014

How to Make Master and Slave Robot control

If you are thinking to make a Master and slave robot or planning to create a  swarm robot or copying robot, If you don't have any idea of how to make this robot and a novice like me. This is a perfect example to get start with. A cool robot to make at home without much effort. As these robots does not share any intelligence between these two but a Master robot ( controlled by the human) will control the another robot (slave robot). We can add some intelligence and makes these robots to complete a task by cooperating each other during work course. 

I've used One Master and a Slave bot, there is no limitation as we can extend many number of slaves as we want and make the robot to move in a synchronized motion. 

Components Required.

1x Arduino uno
1x Bluetooth Module (I used HC-05)
2x Chasis
2x Breadboard
1x RF transmitter Module
1x RF receiver module
4x Wheels
4x Motors
2x 9v batteries
2x L293D (Motor driver)
connecting wires

The Master Robot is going to control from a Android device. we need a android device and an app to control our master robot. we don't need to rely on 3rd party apps to control our robot lets make our own app to control our robot. check the step by step video to know how to make android app using MIT app inventor.  You can also download the app from the link here



Robot circuit Diagram:

Master Robot Circuit:


Master Robot Program:

____________________________________________________________________________________

#include <SoftwareSerial.h>

SoftwareSerial BT(10, 11); //TX, RX respetively
String readvoice;

void setup() {
 BT.begin(9600);
 Serial.begin(9600);
  pinMode (2, OUTPUT);
  pinMode (3, OUTPUT);
  pinMode (4, OUTPUT);
  pinMode (5, OUTPUT);
  pinMode (6, OUTPUT);
  pinMode (7, OUTPUT);
  pinMode (8, OUTPUT);
  pinMode (9, OUTPUT);
}

void loop() {
  while (BT.available()){  //Check if there is an available byte to read
  delay(10); //Delay added to make thing stable 
  char c = BT.read(); //Conduct a serial read
  readvoice += c; //build the string- "forward", "reverse", "left" and "right"
  }  
  if (readvoice.length() > 0) {
    Serial.println(readvoice); 
    if(readvoice == "forward") 
  {
    digitalWrite(8, HIGH);
    digitalWrite (9, HIGH);
    digitalWrite(6,LOW);
    digitalWrite(7,LOW);
    digitalWrite(2, HIGH);
    digitalWrite (3, HIGH);
    digitalWrite(4,LOW);
    digitalWrite(5,LOW);
    delay(100);
  } 
  
  else if(readvoice == "reverse") 
  {
    digitalWrite(8, LOW);
    digitalWrite (9, LOW);
    digitalWrite(6,HIGH);
    digitalWrite(7,HIGH);
    digitalWrite(2, LOW);
    digitalWrite (3, LOW);
    digitalWrite(4,HIGH);
    digitalWrite(5,HIGH);
    delay(100);
  }
  
  else if (readvoice == "right")
  {
    digitalWrite(8, LOW);
    digitalWrite (9, HIGH);
    digitalWrite(6,LOW);
    digitalWrite(7,LOW);
    digitalWrite(2, LOW);
    digitalWrite (3, HIGH);
    digitalWrite(4,LOW);
    digitalWrite(5,LOW);
    delay (100);
    
  }
  
 else if ( readvoice == "left")
 {
   digitalWrite(8, HIGH);
    digitalWrite (9, LOW);
    digitalWrite(6,LOW);
    digitalWrite(7,LOW);
    digitalWrite(2, HIGH);
    digitalWrite (3, LOW);
    digitalWrite(4,LOW);
    digitalWrite(5,LOW);
   delay (100);
 }

 else if (readvoice == "stop")
 {
digitalWrite(8, LOW);
    digitalWrite (9, LOW);
    digitalWrite(6,LOW);
    digitalWrite(7,LOW);
    digitalWrite(2, LOW);
    digitalWrite (3, LOW);
    digitalWrite(4,LOW);
    digitalWrite(5,LOW);
   delay (100);
 }

   

readvoice="";}} //Reset the variable

_____________________________________________________________________________________


Slave Robot Circuit:



No program Required for slave robot.

check out the wireless robot without microcontroller to know about RF Circuits here

PS: use same chassis, RPM motor, Battery rating, as I had different chassis and motor the robot movement was not synchronized. 

13 comments:

Post a Comment