Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
Vaisakh1997Boniface
Published © GPL3+

Bluetooth Controlled Robot

We can control this robot with our smartphone using an Arduino, a Bluetooth module and an Android app downloaded from the Play Store.

IntermediateShowcase (no instructions)8,387
Bluetooth Controlled Robot

Things used in this project

Story

Read more

Schematics

circuit diagram

connect the arduino,motor driver and bluetooth module as shown in the figure

Code

arduino sketch

Arduino
upload the sketch into your arduino board
char junk;
String inputString="";

void setup()                    
{
 Serial.begin(9600);            
 pinMode(2, OUTPUT);
pinMode(3,OUTPUT);
pinMode(4,OUTPUT);
pinMode(5,OUTPUT);
}

void loop()
{
  if(Serial.available()){
  while(Serial.available())
    {
      char inChar = (char)Serial.read(); 
      inputString += inChar;       
    }
    Serial.println(inputString);
    while (Serial.available() > 0)  
    {
 junk = Serial.read() ; 
}      
    if(inputString == "f")
{         
      digitalWrite(3, HIGH);  
digitalWrite(2, LOW); 
digitalWrite(4, HIGH); 
digitalWrite(5, LOW); 
    }
else if(inputString == "b")
{  
      digitalWrite(3, LOW);  
digitalWrite(2, HIGH); 
digitalWrite(4, LOW); 
digitalWrite(5, HIGH); 
    }
else if(inputString == "r")
{  
      digitalWrite(3, HIGH);  
digitalWrite(2, LOW); 
digitalWrite(4, LOW); 
digitalWrite(5, LOW); 
    }
else if(inputString == "l")
{  
digitalWrite(3, LOW);  
digitalWrite(2, LOW); 
digitalWrite(4, HIGH); 
digitalWrite(5, LOW); 
    }
    inputString = "";
  }
}

Credits

Vaisakh1997
2 projects • 14 followers
Contact
Boniface
0 projects • 4 followers
Contact

Comments

Please log in or sign up to comment.