Smartphone Controlled RC Car


 Smartphone Controlled RC Car

    Hey! So, this blog post would help you make a DIY  Rc car that can be controlled using a smartphone via just Bluetooth. The entire page is divided into 6 main sections that'll guide you through the process -        

  •  Required parts 
  •  Fundamentals 
  •   Important stuff to keep in  mind 
  •  The circuit diagram       
  •  The code   
  •  Connecting the car with the mobile app      



# STEP 1 - REQUIRED PARTS 

  • Motors  and wheels kit  link
  • L298n motor driver  link
  • Arduino uno link
  • 9V battery 
  • HC05 bluetooth module link
  • Jumper wires link
  • Mini bread board link

#STEP 2 - UNDERSTANDING THE  FUNCTIONING    
     When we move the joystick in the smartphone the action is recorded and a signal is sent to the car which is received by the Bluetooth module, the received signal is then interpreted my the micro processor that is the arduino (the arduino is similar to a CPU of a computer). The arduino then commands the motor driver to function accordingly.  

SMARTPHONE → BLUETOOTH MODULE  → ARDUINO    MOTOR DRIVER   WHEELS   

for a detailed understanding you can check this blog.Here


#STEP 3 - IMPORTANT STUFF TO KEEP IN MIND 

 1.   Remove the 0 and 1 pins of the arduino while uploading the code. The code won't upload if the pins are not removed. Moreover, the arduino might get damaged if the code is uploaded while the 0 and 1 pins are still connected in the circuit. Once the code is uploaded you can again connect the pins back. 
2.  Do not remove the mini jumper wires / cap connectors from the l298n motor driver.
they are small black colored caps which actually connect two pins on the motor driver. The cap connectors would likely be already attached when the motor driver is purchased. 

#STEP 4 THE SCHEMATIC 



#STEP 5 UPLOADING THE CODE 
___________________________________________________________________________________

THE ARDUINO CODE 

// Starting of Program
int m1a = 9;
int m1b = 10;
int m2a = 11;
int m2b = 12;
char val;

void setup() 
{  
pinMode(m1a, OUTPUT);  // Digital pin 10 set as output Pin
pinMode(m1b, OUTPUT);  // Digital pin 11 set as output Pin
pinMode(m2a, OUTPUT);  // Digital pin 12 set as output Pin
pinMode(m2b, OUTPUT);  // Digital pin 13 set as output Pin
Serial.begin(9600);
}

void loop()
{
  while (Serial.available() > 0)
  {
  val = Serial.read();
  Serial.println(val);
  }

  if( val == 'F') // Forward
    {
      digitalWrite(m1a, HIGH);
      digitalWrite(m1b, LOW);
      digitalWrite(m2a, HIGH);
      digitalWrite(m2b, LOW);  
    }
  else if(val == 'B') // Backward
    {
      digitalWrite(m1a, LOW);
      digitalWrite(m1b, HIGH);
      digitalWrite(m2a, LOW);
      digitalWrite(m2b, HIGH); 
    }
  
    else if(val == 'L') //Left
    {
    digitalWrite(m1a, LOW);
    digitalWrite(m1b, LOW);
    digitalWrite(m2a, HIGH);
    digitalWrite(m2b, LOW);
    }
    else if(val == 'R') //Right
    {
    digitalWrite(m1a, HIGH);
    digitalWrite(m1b, LOW);
    digitalWrite(m2a, LOW);
    digitalWrite(m2b, LOW); 
    }
    
  else if(val == 'S') //Stop
    {
    digitalWrite(m1a, LOW);
    digitalWrite(m1b, LOW);
    digitalWrite(m2a, LOW);
    digitalWrite(m2b, LOW); 
    }
  else if(val == 'I') //Forward Right
    {
    digitalWrite(m1a, HIGH);
    digitalWrite(m1b, LOW);
    digitalWrite(m2a, LOW);
    digitalWrite(m2b, LOW);
    }
  else if(val == 'J') //Backward Right
    {
    digitalWrite(m1a, LOW);
    digitalWrite(m1b, HIGH);
    digitalWrite(m2a, LOW);
    digitalWrite(m2b, LOW);
    }
   else if(val == 'G') //Forward Left
    {
    digitalWrite(m1a, LOW);
    digitalWrite(m1b, LOW);
    digitalWrite(m2a, HIGH);     digitalWrite(m2b, LOW);
    }
  else if(val == 'H') //Backward Left
    {
    digitalWrite(m1a, LOW);
    digitalWrite(m1b, LOW);
    digitalWrite(m2a, LOW);
    digitalWrite(m2b, HIGH); 
    }
}


______________________________________________________________________________

#STEP 6 
CONNECTING THE CAR WITH THE MOBILE APP 

The final step is to connect the car's Bluetooth module with the mobile app. The mobile app 
can be downloaded from the Playstore (Bluetooth RC Car controller ). The app is specifically 
built for android operating systems. So, firstly download the app then turn your RC car on.
The lights on the HC05 Bluetooth would be blinking, indicating that it is ready to pair.Next 
go to the Bluetooth section of your smartphone and pair it with the module. Also, the while 
pairing you maybe asked for a password for connecting. The password would either be 1234 or 
0000. 
Now that you have paired the car with you smartphone your all set to go whroom with it.  
Open the app and play around with the controlls.



This was all for today. See y'all next time.         
 

Comments

  1. This appears to be the gadget for kids at home but will have to wait for them to grow up a bit and then work on DIY basis.
    Thanks for useful info.

    ReplyDelete

Post a Comment

If you have any doubts, please let me know

Popular posts from this blog

Measuring The Speed Of Light

Hand Battery

PASSWORD PROTECTED DOOR LOCK SECURITY SYSTEM

STORY ENGINEERING - A KIND GESTURE

ARDUINO OBSTACLE AVOIDING CAR - A TUTORIAL GUIDE

MORSE CODE - HARNESSING ELECTRICITY TO COMMUNICATE

3-D Endless Runner Game Using UNITY