How To Build 4wheel Bluetooth Controlled Robotic Car Using Arduino

Learn How To Build 4wheel Drive Bluetooth Controlled Robotic

Car Using Arduino Uno


Hello friends In this project, I will show you how to design and develop a Bluetooth Controlled Robotic car using Arduino, HC-05 Bluetooth Module and L298N Motor Driver Module. On the other end of the Bluetooth Communication, I will be using a Smart Phone and a simple Android App to control the Robotic Car.

 

 

 

 

 

Introduction

Robots are always a fancy topic for students, hobbyists and DIYers. If you are beginner, then building a robot (like a car or an arm) is probably one of the important projects to do after learning about the basics.

List of Components Needed to Achieve this Project

NOTE: I have used L298N Motor Driver Module to drive the motors of the robot. You can use either this one or L293D Motor Driver Module. If you are using L293D, then check out for the connections.

Circuit Diagram and Explanation

 

Circuit diagram for bluetooth controlled car is shown in above figure. A Motor driver is connected to arduino to run the car. Motor driver’s input pins 2, 7, 10 and 15 are connected to arduino’s digital pin number 12, 11, 10 and 9 respectively. Here we have used two DC motors to driver car in which one motor is connected at output pin of motor driver 3 and 6 and another motor is connected at 11 and 14.  A 6 volt Battery is also used to power the motor driver for driving motors. Bluetooth module’s rx and tx pins are directly connected at tx and rx of Arduino. And vcc and ground pin of Bluetooth module is connected at +5 volt and gnd of Arduino. And a 9 volt battery is used for power the circuit at Arduino’s Vin pin.

Now Let Start Assembling the Components Together Step by Step:

Step 1: Assembling the Chassis

Solder each motor with a black and a red wire and attach them with the chassis as shown in the video.
join left side motor wires together as: red wire –> red wire and black wire –> black wire
similarly join motors on right side together as: red wire –> red wire and black wire –> black wire

Solder two wires to each DC motor. Then fix two motors to the chassis using the screws. If you need any clarification, use the  comment form. Finally attach the Universal wheel (or ball caster wheel) to the back of the chassis.

Step 2: Join Wheels to All the Motors

don’t apply too much pressure while pressing the wheels otherwise the chassis may get break.

Step 3 : Join the Two Batteries in Series

Connect the batteries in series by joining with a tape. You can also keep a little piece of open wire between them so that they are well connected. Now join red wire to positive terminal of battery and
black wire to negative terminal. Try to keep the voltage <= 9 volts. I used 2 batteries of 3.7 V so my total pack voltage was 7.4 volts. If you use to high voltage ( like >= 12 volts , there is a chance that your components will get heated and might burn )
If your batteries have more current rating- your motors will rotate fast. My battery current rating was 2260 mA which was enough to power 4 motors.
Caution: Don’t accidentally connect positive terminal of battery to its negative terminal directly. It might
burn your wires without any resistance.

Step 4: Connect Motors to Motor Drive

Join the red and black terminal of motors on each side, to the motor drive outputs.

Step 5: Connect Motor Drive to Arduino

Then join the four control pins of motor drive to the arduino 9th, 10th, 11th and 12th pin socket.

Step 6: Join Bluetooth Module to Arduino

Connect bluetooth module( BT ) HC-05 to arduino as shown in circuit diagram. join BT module to arduino as: VCC –> 5V and GND –> GND

Step 7: Connect Motor Drive to Battery

 

Connect motor drive’s power input socket, to positive and negative terminal of battery, also connect the negative terminal of battery to GND of arduino.

I wouldn’t go into the details of the construction of the robot as your robot chassis might be different from mine and you can easily figure it out how to build the robot from the available parts and possible cable management for making the robot more appealing.

Coming to the design of the circuit, first is the HC-05 Bluetooth Module. The +5V and GND pins of the Bluetooth Module are connected to +5V and GND of Arduino.

Since I will be only transmitting data related to the Robot’s movement from Android Phone to Bluetooth Module and do not intend to receive any data from Arduino, I will connect only the TX pin of the Bluetooth Module to RX Pin of Arduino.

This RX pin of Arduino is based on Software Serial library (Pin 2 and Pin 3 are configured as RX and TX on Arduino). The RX pin of the Bluetooth is left open.

Bluetooth Controlled Robot using Arduino Circuit DesignNow, the L298N Motor Driver Module. Digital I/O Pins 9 through 12 of Arduino are configured as Input pins of the Motor Driver and are connected to IN1 through IN4 of the L298N Motor Driver Module. Both the Enable Pins are connected to 5V through provided jumper.

The robot chassis which I am using in this Bluetooth Controlled Robot Car project is supplied with 4 geared motors.

Programming Arduino UNO

The open-source Arduino Software (IDE) makes it easy to write code and upload it to the board. It runs on Windows, Mac OS X, and Linux. The environment is written in Java and based on Processing and other open-source software. This software can be used with any Arduino board you Can download Arduino uno Ide now.

Upload the Code & Download the App

Now compile and upload the given code to the arduino.

void setup() {
pinMode(9,OUTPUT); //left motors forward
pinMode(10,OUTPUT); //left motors reverse
pinMode(11,OUTPUT); //right motors forward
pinMode(12,OUTPUT); //right motors reverse

Serial.begin(9600);

}

void loop() {
if(Serial.available()){
t = Serial.read();
Serial.println(t);
}

if(t == ‘1’){ //move forward(all motors rotate in forward direction)
digitalWrite(9,HIGH);
digitalWrite(10,LOW);
digitalWrite(11,HIGH);
digitalWrite(12,LOW);
}

else if(t == ‘2’){ //move reverse (all motors rotate in reverse direction)
digitalWrite(9,LOW);
digitalWrite(10,HIGH);
digitalWrite(11,LOW);
digitalWrite(12,HIGH);
}

else if(t == ‘3’){ //turn right (left side motors rotate in forward direction, right side motors doesn’t rotate)
digitalWrite(9,LOW);
digitalWrite(10,LOW);
digitalWrite(11,HIGH);
digitalWrite(12,LOW);
}

else if(t == ‘4’){ //turn left (right side motors rotate in forward direction, left side motors doesn’t rotate)
digitalWrite(9,HIGH);
digitalWrite(10,LOW);
digitalWrite(11,LOW);
digitalWrite(12,LOW);
}

else if(t == ‘5’){ //STOP (all motors stop)
digitalWrite(9,LOW);
digitalWrite(10,LOW);
digitalWrite(11,LOW);
digitalWrite(12,LOW);
}
delay(100);
}

DOWNLOAD CODE

DOWNLOAD FULL PROJECT REPORT FROM CHAPTER 1-5

After uploading, disconnect the arduino from pc. Now connect Rx of Hc-05 to Tx of arduino and Tx of Hc-05 to Rx of arduino.

Download Arduino Uno Bluetooth control application from PlayStore.

Pair With Bluetooth Module Start the Car. Check that the LED of Bluetooth module is blinking fast without pairing. Pair the HC-05 Bluetooth module with your smartphone. Enter password 1234. ( if it not works try 0000 ) After pairing open the app and choose HC-05 to pair with. Check the LED of Bluetooth module, its blinking rate would have been very slow now.

Test Drive and Configuration of App

 

Go to App –> Buttons
Press 1: Car moves forward. ( all wheels start moving forward )
Press 1: Car moves in reverse. ( all wheels start moving backward )
Press 3: Car turns to left side. ( Only right wheels move )
Press 4: Car turns to right side. ( Only left wheels move )

make all your connections correct and tight. You can even build a obstacle avoiding robot as your next project.

What video of Our final Output

Thank you for your time, We can build this device and Mail it to you, we also training students on how to build any kind of Robotic Machine, if you also need help on how to get the Component feel free to contact me.

Alex Raji

CEO/Researcher

Loading

8 thoughts on “How To Build 4wheel Bluetooth Controlled Robotic Car Using Arduino”

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.