How to make a simple different type of Bluetooth control car
Hello, and welcome back. In this project, we will learn step by step how to make a simple different type of Bluetooth control car. I think you’ve never seen it before. This project is mainly based on the Arduino UNO board and the L293D motor driver shield. If you don’t have an L293D driver shield, you can use an L298N driver board. But the motor driver shield is best suited for this project. Because the gear motors and the servo motors can be easily connected to it. Also, I used the HC05 Bluetooth module and the “SriTu Hobby” app to control Bluetooth. You can download this app from Play Store.
Ok, let’s do this project step by step. The required components are given below.
- Arduino UNO board x 1 — Our Store / Amazon
- L293D motor driver x 1 — Our Store / Amazon
- HC05 bluetooth module x 1 — Our Store / Amazon
- Gear motor x 2 — Our Store / Amazon
- Servo motor x 1 — Our Store / Amazon
- Robot wheel x 4 — Our Store / Amazon
- Li-ion battery x 2 — Amazon
- Battery holder x 1 — Our Store / Amazon
- Jumper wires — Our Store / Amazon
- Foam board — Amazon
- Cardboard — Amazon
Disclosure: These Amazon links are Affiliate links. As an Amazon Associate, I earn from qualifying purchases.
Step 1
Firstly, identify these components.
Step 2
Secondly, cut the foam board pieces into the following sizes.
Step 3
Thirdly, glue these pieces together. Use the pictures below for that.
Step 4
Now, attach the servo motor and gear motor as follows.
Step 5
Next, attach the other gear motor to another side of the car chassis.
Step 6
Then, connect the robot wheels for the gear motors.
Step 7
Next, attach the motor driver shield to the Arduino board. Then, mount it to the top of the car chassis.
Step 8
OK, now connect the motors and Bluetooth module to the motor driver shield. For that, use the circuit diagram below.
Step 9
Then, attach the battery holder and connect it to the motor driver shield.
Step 10
Now, connect it to your computer and upload the following program.
- AFMotor library — Download
The full program of this project — Download
/*Bluetooth control car
* https://srituhobby.com
*/
//Include the libraries
#include <Servo.h>
#include <AFMotor.h>
//Define speed of the car
#define Speed 200
//Create objects for libraries
Servo servo;
AF_DCMotor motor1(3);
AF_DCMotor motor2(4);
void setup() {
//Start the serial communication
Serial.begin(9600);
//Include the servo motor pin
servo.attach(9);
//Set the speed of the motors
motor1.setSpeed(Speed);
motor2.setSpeed(Speed);
//Include the start point of the servo
servo.write(80);
}
void loop() {
//Check the serial communication
if (Serial.available() > 0) {
//Get the serial values
char remote = Serial.read();
Serial.println(remote);
//Call the motor movement functions
if (remote == '1') {
Left();
} else if (remote == '2') {
Lstart();
} else if (remote == '3') {
Right();
} else if (remote == '4') {
Rstart();
} else if (remote == 'S') {
Stop();
} else if (remote == 'U') {
forward();
} else if (remote == 'D') {
backward();
}
}
}
//Turn the servo motor to the left
void Left() {
for (int a = 80; a > 40; a--) {
servo.write(a);
delay(30);
}
}
//Set the servo motor start point
void Lstart() {
for (int a = 40; a < 80; a++) {
servo.write(a);
delay(30);
}
}
//Turn the servo motor to the right
void Right() {
for (int a = 80; a < 120; a++) {
servo.write(a);
delay(30);
}
}
//Set the servo motor start point
void Rstart() {
for (int a = 120; a > 80; a--) {
servo.write(a);
delay(30);
}
}
//Stop
void Stop() {
motor1.run(RELEASE);
motor2.run(RELEASE);
}
//Go back
void backward() {
motor1.run(BACKWARD);
motor2.run(BACKWARD);
}
//Go forward
void forward() {
motor1.run(FORWARD);
motor2.run(FORWARD);
}
Step 11
Now, select the board and port. Then, remove the RX and TX wires from the car.
Step 12
Next, upload this code and reconnect the RX and TX wires.
Step 13
Then, insert the batteries into the battery holder and power ON this car.
Step 14
Ok, now let’s set up the Bluetooth controller app. For that, follow the steps below.
- First, install this app using this link — Download(Only play store)
- Next, run this application and click the “Controllers” button.
- Then, turn on Bluetooth. After, click the gear wheel icon in the upper right corner and select the “Connect to Device” button.
- Now you can find new Bluetooth devices. To do so, click on the “FIND DEVICES” button. Then, you need to enable Location and Location Permission to find new devices.
- Now, select the name of your Bluetooth module and enter the PIN as “1234”. Then it will connect.
OK, now you can run your Bluetooth control car using this remote control. So, enjoy this project. The full video guide is below. See you in the next project.
How to make a simple different type of Bluetooth control car
Return code is 0
Problem
What is your issue