This post is about making a simple Android control Arduino Bot
Required Components:
Arduino Uno
Bluetooth Module
L293D Motor Driver
2x Gear Motor
1x Chasis
A breadboard
Connecting wires
#include <SoftwareSerial.h>
SoftwareSerial BT(10, 11); //TX, RX respetively
String readdata;
void setup() {
BT.begin(9600);
Serial.begin(9600);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, 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
readdata += c; //build the string- "forward", "reverse", "left" and "right"
}
if (readdata.length() > 0) {
Serial.println(readdata);
if(readdata == "forward")
{
digitalWrite(3, HIGH);
digitalWrite (4, HIGH);
digitalWrite(5,LOW);
digitalWrite(6,LOW);
delay(100);
}
else if(readdata == "reverse")
{
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, HIGH);
digitalWrite(6,HIGH);
delay(100);
}
else if (readdata == "right")
{
digitalWrite (3,HIGH);
digitalWrite (4,LOW);
digitalWrite (5,LOW);
digitalWrite (6,LOW);
delay (100);
}
else if ( readdata == "left")
{
digitalWrite (3, LOW);
digitalWrite (4, HIGH);
digitalWrite (5, LOW);
digitalWrite (6, LOW);
delay (100);
}
else if (readdata == "stop")
{
digitalWrite (3, LOW);
digitalWrite (4, LOW);
digitalWrite (5, LOW);
digitalWrite (6, LOW);
delay (100);
}
readdata="";}} //Reset the variable
_________________________________________________________________________________
Required Components:
Arduino Uno
Bluetooth Module
L293D Motor Driver
2x Gear Motor
1x Chasis
A breadboard
Connecting wires
Arduino Program
_________________________________________________________________________________#include <SoftwareSerial.h>
SoftwareSerial BT(10, 11); //TX, RX respetively
String readdata;
void setup() {
BT.begin(9600);
Serial.begin(9600);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, 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
readdata += c; //build the string- "forward", "reverse", "left" and "right"
}
if (readdata.length() > 0) {
Serial.println(readdata);
if(readdata == "forward")
{
digitalWrite(3, HIGH);
digitalWrite (4, HIGH);
digitalWrite(5,LOW);
digitalWrite(6,LOW);
delay(100);
}
else if(readdata == "reverse")
{
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, HIGH);
digitalWrite(6,HIGH);
delay(100);
}
else if (readdata == "right")
{
digitalWrite (3,HIGH);
digitalWrite (4,LOW);
digitalWrite (5,LOW);
digitalWrite (6,LOW);
delay (100);
}
else if ( readdata == "left")
{
digitalWrite (3, LOW);
digitalWrite (4, HIGH);
digitalWrite (5, LOW);
digitalWrite (6, LOW);
delay (100);
}
else if (readdata == "stop")
{
digitalWrite (3, LOW);
digitalWrite (4, LOW);
digitalWrite (5, LOW);
digitalWrite (6, LOW);
delay (100);
}
readdata="";}} //Reset the variable
_________________________________________________________________________________
check the video to know how to create android app using MIT app inventor
Download Android App from here:Android App
Did you use a bluetooth module? I would like to know which one. I am new to this.
ReplyDeleteI used HC-05 bluetooth module
Deleteand the android app, how did you develop that?
DeleteMIT app INVENTOR
DeleteThank you
Deletethe application is not able to send the string to the bluetooth module from the apk file
ReplyDeleteit showing an error message like "broken pipe ERROR 567"
good one bro
ReplyDeletecan you give the motors which using the your project link
ReplyDeletecan you please tell the type of motors used... and what to do if we want to connect 4 motors to it?... pls help
ReplyDeletei tried your code but the msg:
ReplyDeleteavrdude: stk500_rec(): programar is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00
What i have to do ?
hi bro help me plz,i want to make accelometer control app for this robot.plz make a tutorial for me.plz plz it's urgent.
ReplyDeleteplz help me
ReplyDeletehey the bluetooth module needs only 3.3v.here you are using 5v it may fry the module.please reply please....
ReplyDeletethanks
ReplyDeletelo schema del robot e uguale allo skech?
ReplyDeletesir we have studied your video to make an android app and we have also implemented.But we want somewhat difference in our app and that is that
ReplyDeletein this app when we click on forward button robot starts moving in forward direction and same for all other directions.But we want that when user click on forward button so until the forward button is clicked robot will move forward but as user stops pressing the button robot gets stop.Kindly help us. We will be very thankful to you.
thank you for this job
ReplyDeleteFred
And
ReplyDeletewhat is the maximum voltage for the circuit given
ReplyDeletewe need the robot to last for 2 hours please reply as fast as possible
sir.
Hi Sir/ Madam,
ReplyDeleteI Like this page. May I can copy this page to translate into VietNames to support about this project?
where can i learn the arduino programming?
ReplyDeletenice but can u explain the coding part of transmission and reception of data from bluetooth
ReplyDeletecan you give me the mit app inventor .aia file so i can make changes please
ReplyDeleteThe serial monitor from the pc doesn't read what I'm sending from the app. And whenever I send a command my robot doesn't do anything at all. A little help here please?
ReplyDeletethnx it is really cool.... it was useful
ReplyDeletenice work continue guys...
ReplyDeletetnx
ReplyDeletejozz
ReplyDelete