Introduction: Arduino Bluetooth Rc Car

Picture of Arduino Bluetooth Rc Car

this is my first Arduino project it is quite simple to make .
it will take about half an hour to make it it's quite simple as you think
you can also make it by following steps given below and make have fun it's give me create joy when I finally made it .
now it's your turn to make it.
just follow the steps given under description

Step 1: Requirements

Picture of Requirements

Arduino uno board
Bluetooth module hc 05
4wd shield (adafruit)
Jumper wires
Two 9v battery (1. arduino board
2. external power supply to sheild )
Battery cap with 9v pin jack

Step 2: Connection

Picture of Connection

mount the shield on arduino board and connect Bluetooth to the audino or directly to the shield by soldering on it connect RX to TX ,TX to RX ,ground to ground ,vcc to vcc as shown in the figure and also connect Motors to M1 (left) and M2 (right)

Step 3: Coding

//*** 1- Documentation
//This program is used to control a robot car using a app that communicates with Arduino trough a bluetooth module

#include

//creates two objects to control the terminal 3 and 4 of motor shield
AF_DCMotor motor1(3);
AF_DCMotor motor2(4);

char command;

void setup()
{
Serial.begin(9600); //Set the baud rate to your Bluetooth module.
}

void loop(){
if(Serial.available() > 0){
command = Serial.read();
Stop(); //initialize with motors stoped
//Change pin mode only if new command is different from previous.
//Serial.println(command);
switch(command){
case 'F':
forward();
break;
case 'B':
back();
break;
case 'L':
left();
break;
case 'R':
right();
break;
}
}
}

void forward()
{
motor1.setSpeed(255); //Define maximum velocity
motor1.run(FORWARD); //rotate the motor clockwise
motor2.setSpeed(255); //Define maximum velocity
motor2.run(FORWARD); //rotate the motor clockwise
}

void back()
{
motor1.setSpeed(255);
motor1.run(BACKWARD); //rotate the motor counterclockwise
motor2.setSpeed(255);
motor2.run(BACKWARD); //rotate the motor counterclockwise
}

void left()
{
motor1.setSpeed(255); //Define maximum velocity
motor1.run(FORWARD); //rotate the motor clockwise
motor2.setSpeed(0);
motor2.run(RELEASE); //turn motor2 off
}

void right()
{
motor1.setSpeed(0);
motor1.run(RELEASE); //turn motor1 off
motor2.setSpeed(255); //Define maximum velocity
motor2.run(FORWARD); //rotate the motor clockwise
}

void Stop()
{
motor1.setSpeed(0);
motor2.run(RELEASE); //turn motor1 off
motor2.setSpeed(0);
motor2.run(RELEASE); //turn motor2 off
}

Step 4: Uploading

remove Bluetooth module before uploading the codes

Step 5: Power Supply

Picture of Power Supply

connect 9 volt battery to arduino board and you can also connect 9 volt battery to shield through external power to increase power supply to your Motors
remove the power jumper shown in the figure.

Step 6: Install App

Picture of Install App

install Bluetooth RC controller app through play store
open the app
it ask for permission turn on Bluetooth allow it
the first time password is 1234 or 0000
then click on gear shown in the app now "choose connect to car"
the red button blinking in the app turn to green
now you are connected to your car play with it and enjoy your project.

thank you for watching this instruction

Comments

supniz (author)2017-03-31

Hi, I am getting a lot of code errors, could you please help

C:\Users\user\Documents\Arduino\libraries\arduino_723047\src\Temboo.cpp: In member function 'int TembooChoreo::run(IPAddress, uint16_t, uint16_t)':

C:\Users\user\Documents\Arduino\libraries\arduino_723047\src\Temboo.cpp:281:52: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

if (!m_client.findUntil("HTTP/1.", HTTP_EOL)) {

^

C:\Users\user\Documents\Arduino\libraries\arduino_723047\src\Temboo.cpp:301:62: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

if (m_client.findUntil("x-temboo-time:", HTTP_EOH)) {

^

C:\Users\user\AppData\Local\Temp\ccqB0Z6e.ltrans0.ltrans.o: In function `__static_initialization_and_destruction_0':

C:\Users\user\Documents\BTcar\CarCode/CarCode.ino:6: undefined reference to `AF_DCMotor::AF_DCMotor(unsigned char, unsigned char)'

C:\Users\user\Documents\BTcar\CarCode/CarCode.ino:7: undefined reference to `AF_DCMotor::AF_DCMotor(unsigned char, unsigned char)'

C:\Users\user\AppData\Local\Temp\ccqB0Z6e.ltrans0.ltrans.o: In function `Stop':

C:\Users\user\Documents\BTcar\CarCode/CarCode.ino:73: undefined reference to `AF_DCMotor::setSpeed(unsigned char)'

C:\Users\user\Documents\BTcar\CarCode/CarCode.ino:74: undefined reference to `AF_DCMotor::run(unsigned char)'

C:\Users\user\Documents\BTcar\CarCode/CarCode.ino:75: undefined reference to `AF_DCMotor::setSpeed(unsigned char)'

C:\Users\user\Documents\BTcar\CarCode/CarCode.ino:76: undefined reference to `AF_DCMotor::run(unsigned char)'

shaileshY3 (author)supniz2017-04-15

and remove the Bluetooth module before uploading the code

shaileshY3 (author)supniz2017-04-15

maybe you should first install AFmotor library. it is easy To get through adafruit official site.

marlonss (author)2017-02-15

Thanks for posting. Will save me time trying to figure it out.

shaileshY3 (author)marlonss2017-02-15

my pleasure my dear friend.

MuhammadA950 (author)2017-02-14

it will be work or not ?

cause my car is not working

shaileshY3 (author)MuhammadA9502017-02-15

definitely it will works if you follow the instructions properly.

AryanD6 (author)2017-02-14

Can you tell the use of the shield and the connections bit more in detail also can this be made without the shield??

shaileshY3 (author)AryanD62017-02-15

if you using the shield I mentioned then you just mount pin to pin right mentioned on arduino and the shield it is quite easy to use.

shaileshY3 (author)2017-02-13

thanks for appreciating me??

shaileshY3 (author)2017-02-13

thanks for appreciating me ??

About This Instructable

3,113views

30favorites

License:

More by shaileshY3:Arduino Bluetooth Rc Car
Add instructable to: