Project showcase
Bluetooth-Controlled Arduino Robot

Bluetooth-Controlled Arduino Robot © GPL3+

Make an Arduino-powered robot which is controlled by Bluetooth.

  • 4,234 views
  • 1 comment
  • 10 respects

Components and supplies

Apps and online services

About this project

Bluetooth Controlled Arduino Robot

Hello guys, this project was made as a part of my college assignment.

Here we used Bluetooth module (HC-05) in combination with Arduino Mega to control the movement of the robotic car. The commands to the Arduino are transferred from an Android mobile via Bluetooth.

The Android app on the mobile connects with the Bluetooth network, and then when a button is pressed on the screen of the app, the corresponding command is sent over the network to Arduino. Then Arduino intercepts the command and performs the designated action as per the code.

Watch the Robot in Action

Bluetooth Controlled Arduino Robotic Car

Video Demonstration of Bluetooth Controlled Arduino Robotic Car in Action

The video describes the complete circuit assembly, code implementation and Android app configuration required for the project to work

Code

#include<SoftwareSerial.h>
SoftwareSerial bt(10,11); // assigning 10 as RX ans 11 as TX 
#define motor_left 5
#define motor_right 3
#define motor_right_dir 2
#define motor_left_dir 4
void setup() {
 pinMode(2,OUTPUT);
 pinMode(3,OUTPUT);
 pinMode(4,OUTPUT);
 pinMode(5,OUTPUT);
 while(!Serial){;} // waiting for serial communication to setup
 bt.begin(9600); // beginning the bluetooth connection
}
void loop() {
 bt.listen(); // listening to the bluetooth
 while(bt.available()) // till we are receiving the input continue in the loop
 {
     char ch = bt.read();  // reading one character at a time
     if(ch=='f'){          // action to be performed if input is 'f'
       digitalWrite(motor_left_dir,HIGH);
       digitalWrite(motor_right_dir,HIGH);
       analogWrite(motor_left,150);
       analogWrite(motor_right,150);
     }
     else if(ch == 'b'){       // action to be performed if input is 'b'
       digitalWrite(motor_left_dir,LOW);
       digitalWrite(motor_right_dir,LOW);
       analogWrite(motor_left,150);
       analogWrite(motor_right,150);
     }
     else if(ch == 'l'){       // action to be performed if input is 'l'
       digitalWrite(motor_left_dir,HIGH);
       digitalWrite(motor_right_dir,HIGH);
       analogWrite(motor_left,0);
       analogWrite(motor_right,120);
     }
     else if(ch == 'r'){     // action to be performed if input is 'r'
       digitalWrite(motor_left_dir,HIGH);
       digitalWrite(motor_right_dir,HIGH);
       analogWrite(motor_left,120);
       analogWrite(motor_right,0); 
     }
     else if(ch =='s'){  // action to be performed if input is 's'
       digitalWrite(motor_left_dir,HIGH);
       digitalWrite(motor_right_dir,HIGH);
       analogWrite(motor_left,0);
       analogWrite(motor_right,0); 
     }
 }
} 

Circuit Assembly

Code

Arduino Code for Bluetooth Controlled Robotic CarC/C++
Upload the code in your arduino board, do proper connection as per video/post and your robot is ready to go.......
#include<SoftwareSerial.h>

SoftwareSerial bt(10,11); // assigning 10 as RX ans 11 as TX 

#define motor_left 5
#define motor_right 3

#define motor_right_dir 2
#define motor_left_dir 4

void setup() {
  pinMode(2,OUTPUT);
  pinMode(3,OUTPUT);
  pinMode(4,OUTPUT);
  pinMode(5,OUTPUT);

  while(!Serial){;} // waiting for serial communication to setup

  bt.begin(9600); // beginning the bluetooth connection
}

void loop() {
  
  bt.listen(); // listening to the bluetooth

  while(bt.available()) // till we are receiving the input continue in the loop
  {
      char ch = bt.read();  // reading one character at a time

      if(ch=='f'){          // action to be performed if input is 'f'
        digitalWrite(motor_left_dir,HIGH);
        digitalWrite(motor_right_dir,HIGH);
        analogWrite(motor_left,150);
        analogWrite(motor_right,150);
      }
      else if(ch == 'b'){       // action to be performed if input is 'b'
        digitalWrite(motor_left_dir,LOW);
        digitalWrite(motor_right_dir,LOW);
        analogWrite(motor_left,150);
        analogWrite(motor_right,150);
      }
      else if(ch == 'l'){       // action to be performed if input is 'l'
        digitalWrite(motor_left_dir,HIGH);
        digitalWrite(motor_right_dir,HIGH);
        analogWrite(motor_left,0);
        analogWrite(motor_right,120);
      }
      else if(ch == 'r'){     // action to be performed if input is 'r'
        digitalWrite(motor_left_dir,HIGH);
        digitalWrite(motor_right_dir,HIGH);
        analogWrite(motor_left,120);
        analogWrite(motor_right,0); 
      }
      else if(ch =='s'){  // action to be performed if input is 's'
        digitalWrite(motor_left_dir,HIGH);
        digitalWrite(motor_right_dir,HIGH);
        analogWrite(motor_left,0);
        analogWrite(motor_right,0); 
      }
  }

}

Schematics

Circuit assembly for Bluetooth Controlled Robotic Car
Make connections as per the circuit and upload the provided code to make the Robot Work
bluetooth_controlled_robotic_car_l16npzw426.fzz

Comments

Similar projects you might like

Otto DIY+ Arduino Bluetooth Robot Easy to 3D Print

Project tutorial by Team Otto builders

  • 48,265 views
  • 117 comments
  • 162 respects

VEPCRo - Vertical External Pole Climbing Robot

Project showcase by Pramod C Wickramasinghe

  • 5,854 views
  • 10 comments
  • 30 respects

WiFi Robot

Project tutorial by Team Kartik

  • 2,231 views
  • 1 comment
  • 8 respects

Hand Gesture Controlled Robot

Project tutorial by Mayoogh Girish

  • 54,944 views
  • 78 comments
  • 65 respects

Smartphone Controlled Arduino 4WD Robot Car

Project in progress by Andriy Baranov

  • 53,239 views
  • 43 comments
  • 98 respects

Two Mode Robot Controlling through Android and Windowsphone8

Project tutorial by Anas Siddiqui

  • 16,314 views
  • 9 comments
  • 48 respects
Add projectSign up / Login