Project showcase
Bluetooth Controlled Bot (Using Adafruit L293D Motor Driver)

Bluetooth Controlled Bot (Using Adafruit L293D Motor Driver) © GPL3+

A robot which is controlled by an HC-05 module and receives commands using a Bluetooth terminal app.

  • 17 views
  • 0 comments
  • 2 respects

Components and supplies

Necessary tools and machines

Apps and online services

Ide web
Arduino IDE
Bluetooth Terminal

About this project

The idea was to make an extremely simple Bluetooth-controlled robot. It was done with an effort to understand the working of the Bluetooth module (HC-05) and how to use it. It can move forward, backward, left, right and stop by giving letter inputs of 'f', 'b', 'l', 'r' and 's' respectively.

Note: This model uses Adafruit L293D motor shield. This requires you to download and use a particular library for the same. You can use a generic motor shield as well but the code will change. For those of you who want to use the Adafruit one, please refer the following link:

(All the credit goes to the creator of the video, I learnt how to use the motor shield from the above mentioned link and hence I am merely recommending the same)

The other prerequisite needed is how to use the bluetooth module which can be learnt easily online.

Code

Code implemented for the botArduino
Again reiterating,this code works only if you are using the Adafruit L 293 D motor shield and have followed the instructions in the video and imported the library.
char j;
String iS="";
#include<AFMotor.h>//Follow instructions in the video to understand how to import the same(All credit on how to use the same goes to the creator of the video)
AF_DCMotor motor1(1);
AF_DCMotor motor2(2);
void setup()    
{
 motor1.setSpeed(200);//Can be set from 0-255
 motor2.setSpeed(200);//Can be set from 0-255
 Serial.begin(9600);           
}
void loop()
{
  if(Serial.available()){
  while(Serial.available())
    {
      char iC = (char)Serial.read();
      iS += iC;       
    }
    Serial.println(i);
    while (Serial.available() > 0)  
    { j = Serial.read() ; }      
    if(iS == "f"){  //To move forward      
      motor1.run(FORWARD);
      motor2.run(FORWARD);
    }else if(iS == "b"){ //To move backward 
      motor1.run(BACKWARD);
      motor2.run(BACKWARD);
    }
    else if(iS == "l"){  //To move left
      motor1.run(FORWARD);
      motor2.run(RELEASE);
    }
    else if(iS == "r"){//To move right 
      motor1.run(RELEASE);
      motor2.run(FORWARD);
    }
    else if(iS == "s"){  //To stop
      motor1.run(RELEASE);
      motor2.run(RELEASE);
    }
    iS = "";
  }
}

Comments

Similar projects you might like

Robotic Car controlledover Bluetooth with Obstacle Avoidance

Project showcase by S.Ranjith Reddy

  • 12,387 views
  • 8 comments
  • 21 respects

Bluetooth Controlled Car

Project tutorial by JANAK13

  • 11,532 views
  • 19 comments
  • 41 respects

Arduino Bluetooth Robot for Android Device

Project showcase by aip06

  • 3,066 views
  • 2 comments
  • 15 respects

Home Safety Bot

Project showcase by Team HomeSafety

  • 594 views
  • 0 comments
  • 5 respects

Bluetooth Controlled Light Switch

Project showcase by Team The Instrumentation Crustaceans

  • 26,168 views
  • 4 comments
  • 27 respects

Bluetooth Controlled Servo

Project tutorial by JANAK13

  • 11,408 views
  • 17 comments
  • 37 respects
Add projectSign up / Login