Home > Control Circuits >Other Control Circuitss > Homemade Bluetooth controlled car using HC-05 Bluetooth module to communicate with mobile phone

Homemade Bluetooth controlled car using HC-05 Bluetooth module to communicate with mobile phone

Source: InternetPublisher:风向双子座 Keywords: Bluetooth module HC-05 Bluetooth car Updated: 2024/12/19

This is a Bluetooth controlled car that uses the HC-05 Bluetooth module to communicate with your phone.

We can control the car with our phone via Bluetooth. Use an app to control the movement of the car.

Step 1: Requirements

poYBAGL0pKuASPwiAAOqUHsMCR8367.png

Arduino

Motor guard

Motor battery (4v or more, 1amp or more)

5v power bank for Arduino

HC-05 Bluetooth Module

Robot chassis

Step 2: Assemble the chassis

pYYBAGL0pKaAdH-SAAIdr3K5iN0249.png

Assemble the motor, wheels, and chassis according to the given chassis instructions.

Step 3: Download the Zip file

poYBAGL0pJyAb8IUAAPP7oNkL2o854.png

Download the zip file

and extract it

Step 4: Add the Autofocus Motor Library

pYYBAGL0pJiAACx7AAHWY2gv8Kw887.png

Extract the zip file

Open the extracted folder

Copy the AF Motor folder

Go to the documentation section

Open the Arduino folder

Now open the Library folder

Paste the AFMotor folder

closure

Step 5: Upload the program

poYBAGL0pJSAf1YuAAG9LadNHB0148.png

Connect Arduino to Laptop or PC

Open the extracted folder again

Open the car program

Go to Tools in the Arduino software

Make sure the board is the port that the Arduino Uno and Arduino are connected to

Upload the program

Step 6: Circuit Connection

poYBAGL0pI-ASOTfAAOtspjUULI384.png

Solder two wires at pins 0 and 1 of the Arduino: RX and TX.

Attach the motor shield to the top of the Arduino

Connect all motors to the motor shield as per the schematic.

The left motor is connected to M3 and M4

The right motor is connected to M1 and M2

If any motor rotates in the opposite direction, the wiring to the motor is reversed.

Step 7: Add Bluetooth Module

pYYBAGL0pIqAEfKmAAMBJO8o8pA146.png

With Bluetooth module

Connect two busbars to busbars at +5v and GND

Connect the +5v and GND of the Bluetooth and the + and - of the servo to the motor shield as shown.

Connect the RX of the Arduino to the TX of the Bluetooth module

Connect the TX of Arduino to the RX of Bluetooth module

Step 8: Powering the Arduino and Motors

pYYBAGL0pIWAJGb4AAQeHKtzDqA573.png

pYYBAGL0pICAJs7YAAVwMGjgEBA722.png

Connect the power bank to the Arduino via USB cable

Connect the battery to the motor shield

Step 9: Connect the application

pYYBAGL0pH2AdE8GAAJZSEIb_o8042.png

Turn on Bluetooth

Search for new devices

Click HC-05

Enter password 1234

After pairing, open the Play Store

Search for Arduino Bluetooth RC Car

Download the app and open it

Click the Settings icon

Click to connect car

Click HC-05

When the red light turns green, it means it is connected

All done

Step 10: All Done

poYBAGL0pHWATzrSAARQDXZNwNw917.png

Mobile Controlled car code:

#include

AF_DCMotor motor1(1);
AF_DCMotor motor2(2);
AF_DCMotor motor3(3);
AF_DCMotor motor4(4);

char bt='S';
void setup()
{
Serial.begin(38400);

motor1.setSpeed(255);
motor2.setSpeed(255);
motor3.setSpeed(255);
motor4.setSpeed(255);
Stop() ;
}


void loop() {

bt=Serial.read();

if(bt=='F')
{
forward();
}

if(bt=='B')
{
backward();
}

if(bt=='L')
{
left();
}

if(bt=='R')
{
right();
}

if(bt=='S')
{
Stop();
}

}
void forward()
{
 motor1.run(FORWARD);
motor2.run(FORWARD);
motor3.run(FORWARD);
motor4.run(FORWARD);
}

void backward()
{
 motor1.run(BACKWARD);
motor2.run(BACKWARD);
motor3.run(BACKWARD);
motor4.run(BACKWARD);
}
void left()
{
motor1.run(FORWARD);
motor2.run( FORWARD);
motor3.run(BACKWARD);
motor4.run(BACKWARD);
}
void right()
{
motor1.run(BACKWARD);
motor2.run(BACKWARD);
motor3.run(FORWARD);
motor4.run(FORWARD);
}
void Stop()
{
motor1.run(RELEASE);
motor2.run(RELEASE);
motor3. run(RELEASE);
motor4.run(RELEASE);
}

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号