How to make a Bluetooth control car with a 2WD smart car kit
Hello and welcome back. In this project, we will learn how to make a Bluetooth control car with a 2WD smart car kit. This kit makes the process easy, and you can find it at an affordable price in the market. It’s a great option for beginners and hobbyists. For powering this car, I used an Arduino Nano board, but you can substitute it with any compatible Arduino board that suits your needs. The HC-05 Bluetooth module handles Bluetooth communication. The L298N motor driver board controls the gear motors, allowing the car to move forward, backward, and turn left or right. Due to the need for higher voltage, we need to replace the battery holder. I used an AA x 6 battery holder for this purpose. Additionally, I used the SriTu Hobby Bluetooth controller to operate the car. If you’d like to build this project without the kit, feel free to use this link.
Ok, let’s do this project step by step. The required components are given below.
- 2WD smart car kit — Our store / Amazon
- Arduino Nano board x 1 — Our Store / Amazon
- HC-05 Bluetooth module x 1 — Our Store / Amazon
- L298N motor driver x 1 — Our Store / Amazon
- Jumper wires — Our Store / Amazon
- Breadboard — Our store / Amazon
- AA x 6 Battery holder x 1 — Our store / Amazon
- AA battery x 6 — Our store / Amazon
Step 1
First, unpack this robot kit and identify the components in this box.
Step 2
Secondly, let’s identify the additional components needed to control the car.
Step 3
Now, let’s assemble the robot car kit. Start by removing the protective stickers from the acrylic parts.
Step 4
Next, solder the wires to the gear motors, and then attach the code wheels to the motors.
Step 5
Now, insert the fasteners into the chassis and mount the gear motors using the screws. For that, use the images below.
Step 6
Next, attach the spacers to the caster wheel, and then mount it onto the chassis.
Step 7
Now, attach the wheels to the gear motors.
Step 8
Next, install the battery holder onto the chassis. I used an AA x 6 battery holder, as the AA x 4 battery holder provides insufficient voltage.
Step 9
Afterward, place the Arduino Nano board and Bluetooth module onto the breadboard. Then, connect the Bluetooth module to the Arduino using the circuit diagram below.
Step 10
Next, install the L298N motor driver board and breadboard on the chassis. Then, connect the gear motors to the motor driver board.
Step 11
Next, connect the battery holder to the motor driver board, and then link the motor driver board to the Arduino board.
Step 12
Now, connect the Arduino Nano board to your computer. Then, copy and paste the following program into the Arduino IDE.
- Code and circuit diagram — Download
/*Bluetooth control car with Arduino Nano board
Home Page
*/
//motor one
#define IN1 2
#define IN2 3
//motor two
#define IN3 4
#define IN4 5
void setup() {
Serial.begin(9600);
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
pinMode(IN3, OUTPUT);
pinMode(IN4, OUTPUT);
}
void loop() {
if (Serial.available() > 0) {
char value = Serial.read();
Serial.println(value);
if (value == 'U') {
Forward();
} else if (value == 'D') {
Backward();
} else if (value == 'S') {
Stop();
} else if (value == 'L') {
Left();
} else if (value == 'R') {
Right();
}
}
}
void Forward() {
digitalWrite(IN1, HIGH);
digitalWrite(IN2, LOW);
digitalWrite(IN3, HIGH);
digitalWrite(IN4, LOW);
}
void Backward() {
digitalWrite(IN1, LOW);
digitalWrite(IN2, HIGH);
digitalWrite(IN3, LOW);
digitalWrite(IN4, HIGH);
}
void Stop() {
digitalWrite(IN1, LOW);
digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW);
digitalWrite(IN4, LOW);
}
void Left() {
digitalWrite(IN1, HIGH);
digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW);
digitalWrite(IN4, HIGH);
}
void Right() {
digitalWrite(IN1, LOW);
digitalWrite(IN2, HIGH);
digitalWrite(IN3, HIGH);
digitalWrite(IN4, LOW);
}
- Next, disconnect the RX and TX jumper wires. Then, select the correct board and port in the Arduino IDE, and click the upload button.
- Once the code is uploaded, reconnect the RX and TX jumper wires.
Step 13
Now, remove the USB cable and put the batteries into the battery holder. Afterward, download and install the SriTu Hobby app from the Play Store. Then, open the app, go to the controller tab, and select the Bluetooth control remote.
Step 14
Afterward, click the Find your device button and select your Bluetooth module name. Finally, you should see a green indicator on the remote. Now, you can control the car as you like. Additionally, you can try the gesture mode and voice control mode.
OK enjoy this project. The full video guide is below. So we hope to see you in the next project. Have a great day!
Troubleshooting tips
- Check Connections.
- Check the voltage.
- Check your Bluetooth module.
- Select the correct Board and Port.
- Check motor direction. (If not rotate correctly, please switch the motor wires.)
- Check the Bluetooth connection. (If it doesn’t connect, restart the app)
How to make a Bluetooth control car with a 2WD smart car kit