RC Car Control via Bluetooth (using Smartphone)


Arduino Projects : How To Control RC Car via Bluetooth (with Smartphone)

Descriptions:

In this project I will show you how to transform an RC toy car to Bluetooth controlled through your Android smartphone!


Hardware Required:

- RC Car - https://goo.gl/xfZWFk
- Arduino Board - https://goo.gl/UyGYeF
- Motor Shield - https://goo.gl/9Ph44b
- Bluetooth Module - https://goo.gl/thjwVL
- Wires
- Battery

Recommended site to buy the required hardware:
https://www.banggood.com/?p=CS120478587752016125

Connections:

- Before starting, remove the existing rc circuit.
- You should find the polarity of 2 motors.
- For power, you can use the existing batteries, or replace them with a Li iOn rechargeable battery pack.

----------------------------------------------------------------------------------------------------------------------------------------------

Get the Application:

https://goo.gl/oUOMlK

-----------------------------------------------------------------------------------------------------------------------------------------------

About the Code

- When uploading code to arduino, you must disconnect first the VCC pin of Bluetooth module.

Get the Code:
#include <AFMotor.h>
AF_DCMotor front_motor(1, MOTOR12_8KHZ);
AF_DCMotor aft_motor(2, MOTOR12_8KHZ);

String readString;

void setup() {
  Serial.begin(9600);
  front_motor.setSpeed(250);
  aft_motor.setSpeed(250);
}

void loop() {
  while(Serial.available()){
    delay(50);
    char c=Serial.read();
    readString+=c;
  }
  if(readString.length()>0){
    Serial.println(readString);
    if (readString =="FORWARD"){
      aft_motor.run (FORWARD);
      front_motor.run (RELEASE);
      delay(500);
    }
    if (readString =="BACKWARD"){
      aft_motor.run (BACKWARD);
      front_motor.run (RELEASE);
      delay(500);
    }
    if (readString =="LEFT"){
      front_motor.run (FORWARD);
      aft_motor.run (FORWARD);
      delay(500);
    }
    if (readString =="RIGHT"){
      front_motor.run (BACKWARD);
      aft_motor.run (FORWARD);
      delay(500);
    }
    if (readString =="STOP"){
      front_motor.run (RELEASE);
      aft_motor.run (RELEASE);
      delay(500);
    }

    readString="";
  }
}