AflahvadoodAlbin Joy
Published

Bluetooth Controlled Car

A three-wheeled, Arduino-based car which can be controlled by Android phone.

BeginnerFull instructions provided2 hours1,837
Bluetooth Controlled Car

Things used in this project

Hardware components

Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1
HC-05 Bluetooth Module
HC-05 Bluetooth Module
×1
chassis
×1
9V battery (generic)
9V battery (generic)
×3
DC motor (generic)
×2
Jumper wires (generic)
Jumper wires (generic)
×2
wheel
×2
9v battery snap connecter+DC jack
×2

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

schematic diagram

Code

code

Arduino
/***************************BLUETOOTH CONTROLLED CAR CODE**************************/

//Declare the arduino pins

int lm1 = 10;
int lm2 = 9;
int rm1 = 8;
int rm2 = 7;
int horn = 11;
int fl = 3;
int bl = 2;

void setup()
{
  //initlize the mode of the pins
   pinMode(lm1,OUTPUT);
   pinMode(lm2,OUTPUT);
   pinMode(rm1,OUTPUT);
   pinMode(rm2,OUTPUT);
   pinMode(horn,OUTPUT);
   pinMode(fl,OUTPUT);
   pinMode(bl,OUTPUT);

   //set the serial communication rate
  Serial.begin(9600);
}

void loop()
{
  //check whether arduino is reciving signal or not 
  while(Serial.available() == 0);
  char val = Serial.read() ;//reads the signal
  Serial.print(val);

  /*********For Forward motion*********/
  
  if (val == 'F')
  {
    Serial.println("FORWARD");
    digitalWrite(lm1,HIGH);  digitalWrite(rm1,HIGH);
    digitalWrite(lm2,LOW);       digitalWrite(rm2,LOW);
    
  }

 
    /*********For Backward Motion*********/
  else if(val == 'B')
  {
  Serial.println("BACK");
      digitalWrite(lm2,HIGH);  digitalWrite(rm2,HIGH);
    digitalWrite(lm1,LOW);       digitalWrite(rm1,LOW);
  
  }
   /*********Right*********/
  else if(val == 'R')
  {
  Serial.println("RIGHT");
    digitalWrite(lm1,HIGH);  digitalWrite(rm2,HIGH);
    digitalWrite(lm2,LOW);       digitalWrite(rm1,LOW);
  }
   /*********Left*********/
  else if(val == 'L')
  {
   Serial.println("LEFT");
     digitalWrite(lm2,HIGH);  digitalWrite(rm1,HIGH);
    digitalWrite(lm1,LOW);       digitalWrite(rm2,LOW);
  
  }
   /*********Horn*********/
 else if(val == 'V')
  {
  digitalWrite(horn,HIGH);
  }
else if(val == 'v')
  {
    digitalWrite(horn,LOW);
  }
  
  /*********Front Lights*********/
  else if(val == 'W')
  {
  digitalWrite(fl,HIGH);
  }
  else if(val == 'w')
  {
    digitalWrite(fl,LOW);
  }
  /*********Back Lights*********/
  else if(val == 'U')
  {
    digitalWrite(bl,HIGH);
  }
  else if(val == 'u')
  {
    digitalWrite(bl,LOW);
  }
  /*********STOP*********/
  else
  {
  Serial.println("Invalid!!!");
     digitalWrite(lm1,LOW);  digitalWrite(rm1,LOW);
    digitalWrite(lm2,LOW);       digitalWrite(rm2,LOW);

  }
  
}

Credits

Aflahvadood

Aflahvadood

1 project • 2 followers
Albin Joy

Albin Joy

0 projects • 1 follower
Thanks to Amjad K, Albin Joy, Vishal N, and Jaseem K.

Comments