Showing posts with label Arduino Robot. Show all posts
Showing posts with label Arduino Robot. Show all posts

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. 

Monday, November 24, 2014

A simple sound activated bot, turn On when there is a sound and turn off if it hear sound again, It don't have any specific purpose just a toy with minimum intelligence lol.

This robot uses sound detecting sensor, which actually produces vibration whenever there is a noise, it cannot measure the db of the sound that producing, all it can do is to produce a signal when there is a sound .





sound sensor


Arduino Program:
--------------------------------------------------------------------------------------------------------------------------

int Tomotor = 8;       // signal to motor driver
int soundsensor = 7;   // input from sound sensor

boolean state = false;

void setup()
{
  pinMode(Tomotor, OUTPUT);
  pinMode(soundsensor, INPUT);
}

void loop()
{
  if (digitalRead(soundsensor) == LOW)
  {
    delay(100);                    
    state = !state;              
    digitalWrite(Tomotor, state);  
  }
}
--------------------------------------------------------------------------------------------------------------------------


Sunday, November 23, 2014

A very simple obstacle avoiding robot using arduino , this robot uses very simple code and can accomplish the task with ease, check out the video for how the robot is working, its really simple to make not much complicated circuit. It uses HC SR-04 sensor which senses distance between the robot and object. If the distance is maximum and robot can move without colliding , the robot moves in forward direction, if the robot senses object near to it, it takes diversion and moves to the safe place and avoiding colliding to any objects around the robot,





Components Used: 

HC SR- 04 (ultrasonic sensor)
L293D Motor driver
2x Gear Motor
2x wheels
1x chasis
1x castor wheel
connecting wires
battery
Arduino Uno 


Circuit Diagram:


--------------------------------------------------------------------------------------------------------------------------
Arduino Program:

/*
 HC-SR04 Ping distance sensor:
 VCC to arduino 5v 
 GND to arduino GND
 Echo to Arduino pin 8 
 Trig to Arduino pin 9*/
#define echopin  8 // echo pin
#define trigpin 9 // Trigger pin


int maximumRange = 30;
long duration, distance;

void setup() {
  Serial.begin (9600);
  pinMode (trigpin, OUTPUT);
  pinMode (echopin, INPUT );
  pinMode (4, OUTPUT);
  pinMode (5, OUTPUT);
  pinMode (13, OUTPUT);
  pinMode (6, OUTPUT);
  pinMode (7, OUTPUT);
}

void loop ()
{

  {
    digitalWrite(trigpin,LOW);
    delayMicroseconds(2);
    
    digitalWrite(trigpin,HIGH);
    delayMicroseconds(10);
    
    duration=pulseIn (echopin,HIGH);
    
    distance= duration/58.2;
    delay (50);
    Serial.println(distance);
  }
  
  if (distance >= 30 ){
    digitalWrite(4,HIGH);
    digitalWrite(5,HIGH);
    digitalWrite(6,LOW);
    digitalWrite(7,LOW);
    delay (200);
  }
  
  else if (distance >=15 && distance <= 25) {
    digitalWrite (4,HIGH);
    digitalWrite (5,LOW);
    digitalWrite (6,LOW);
    digitalWrite (7,LOW);
    delay (1000);
  }
 else if (distance < 15){
   digitalWrite (4, LOW);
   digitalWrite (5, LOW);
   digitalWrite (6,HIGH);
   digitalWrite (7,HIGH);
   delay (1000);
   digitalWrite (4,LOW);
   digitalWrite (5,HIGH);
   digitalWrite (6,LOW);
   digitalWrite (7, LOW);
   delay (1000);
   
     
 }

}

--------------------------------------------------------------------------------------------------------------------------

For assembling the robot please check  http://learnhowtomakerobot.blogspot.in/2014/11/a-simple-line-following-robot-without.html