You are on page 1of 21

lOMoARcPSD|25873678

Bluetooth Controlled CAR

B.tech (Dr. A.P.J. Abdul Kalam Technical University)

Studocu is not sponsored or endorsed by any college or university


Downloaded by Ecclesiasticol Mussa (pxgyc6tq8x@privaterelay.appleid.com)
lOMoARcPSD|25873678

BLUETOOTH CONTROLLED CAR


USING ARDUINO UNO

A Mini Project Report Submitted In Partial


Fulfilment of the requirements

BACHELOR OF TECHNOLOGY
In
ELECTRONICS AND COMMNICATION ENGINEERING
At

FEROZE GANDHI INSTITUTE OF ENGINEERING AND


TECHNOLOGY

BY-
ANSHIKA MISHRA(2001870310028)
ANSHUL RAJPAL(2001870310029)
ANURAG TIWARI(2001870310030)
APARAJITA SINGH(2001870310031)

Under the supervision of-


Dr. GHANSHYAM SINGH
&
Mr. AMIT SINGH
Asst. Professors in Electronics & Communication
Department

Downloaded by Ecclesiasticol Mussa (pxgyc6tq8x@privaterelay.appleid.com)


lOMoARcPSD|25873678

CERTIFICATE

This is certifying that Project Report entitled “Bluetooth


Controlled Car Using Arduino UNO” which is submitted
by group members name in partial fulfilment of the
requirement for the award of degree B. tech in the
Department of Electronics & Communication
Engineering of Dr. A. P. J. Abdul Kalam
Technical University, Lucknow is a record of the
candidate own work carried out by them my/our
supervision. The matter embodied in this project is
original and has not been submitted for the award of any
other degree.

Dr. Ghanshyam Singh Mr. Amit Singh


(Assistant Professor) (Assistant Professor)
(Department of Electronics (Department of Electronics
& Comm. Engg.) & Comm. Engg.)

Dr.Digvijay Singh Chauhan


(Associate Professor & Head of the Department)
(Department of Electronics & Comm. Eng.)

Downloaded by Ecclesiasticol Mussa (pxgyc6tq8x@privaterelay.appleid.com)


lOMoARcPSD|25873678

DECLARATION

I hereby declare that this submission is my own


work and that, to the best of my knowledge and
belief, it contains no materials previously
published or written by another person nor
material which to a substantial extent has been
accepted for the award of any other
degree or diploma of the university or other
institution of learning, except where due to
acknowledgement has been made in the text.

SIGNATURE:

SIGNATURE:

Downloaded by Ecclesiasticol Mussa (pxgyc6tq8x@privaterelay.appleid.com)


lOMoARcPSD|25873678

ABSTRACT

The project aims is to design an android interface,


Arduino bot and write program in to the arduino
microprocessor. Arduino car contains Arduino
microcontroller with basic mobility features. Arduino
programs contains instructions mediating between
android controller and Arduino car. Android mobile
controller uses different mobile sensors to supervise
motion. Anappropriate program in the arduino
microprocessor to interact with the android
controller has to be created. The program has
been successfully complied through arduino IDE to
the arduino microprocessor & loaded in to it after
proper checking of logic to decrease any loss/damage
of hardware. We have to create an android application
that will provide user an interface to interact with
the arduino powered car. The interface is easy to use
and provide feedback from the arduino
microprocessor through the Bluetooth after giving
instruction to arduino for various actions through
interface via Bluetooth module. The android application
is to create with the help of android studio that provide
us with more capability & stability. After doing all
of this we have test this project thoroughly and find the
maximum no. of error & wrong logic in the
microprocessor program. After doing this only we can
say that we have been able to create as per our goal
described.

Downloaded by Ecclesiasticol Mussa (pxgyc6tq8x@privaterelay.appleid.com)


lOMoARcPSD|25873678

ACKNOWLEDGEMENT

It gives me a great sense of pleasure to present the report of the B.


Tech project undertaken during B. Tech. Third Year. I owe special
debt of gratitude to Dr. Ghanshyam Singh & Mr. Amit Singh, Assistant
Professor, Department of Electronics & Communication Engineering,
Feroze Gandhi Institute of Engineering & Technology, Raebareli, for
her constant support and guidance throughout the course of my
work. Her sincerity, thoroughness and perseverance have been a
constant source of inspiration for me. It is only his cognizant efforts
that our endeavours have seen light of the day.I also take the
opportunity to acknowledge the contribution of, Dr. Digvijay Singh
Chauhan HOD & Associate Professor, Department of Electronics &
Communication Engineering, Feroze Gandhi Institute of
Engineering & Technology, Raebareli, for his full support and
assistance during the development of the project. I also do not like to
miss the opportunity to acknowledge the contribution of all faculty
members of the department for their kind assistance and
cooperation during the development of my project. Last but not the
least, I acknowledge my friends for their contribution in the
completion of the project.

Downloaded by Ecclesiasticol Mussa (pxgyc6tq8x@privaterelay.appleid.com)


lOMoARcPSD|25873678

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. If
you remember the earlier tutorial, I have discussed about HC-05
Bluetooth Module and how to interface one with Arduino. Also, I have
provided a simple Bluetooth Controller App, which can be installed on
your Android Phone and start transmitting the data. As a continuation to
that project, I will be implementing Bluetooth Controlled Robot using
Arduino and a few other components and build a simple robotic car that
can be controlled using an Android Phone (through an App) over
Bluetooth Communication. The robotic car can be controlled wirelessly
via a Smartphone. The smartphone has an Android app through which
the user can send commands directly to Robot. The robot can move
forward, backward, left, and right and can also be stopped. The
Arduino’s Bluetooth-controlled robot car is interfaced with a Bluetooth
module HC-05 or HC-06. We can give specific voice commands to the
robot through an Android app installed on the phone. At the receiving
side, a Bluetooth transceiver module receives the commands and
forwards them to the Arduino, and thus the robotic car is controlled.

Downloaded by Ecclesiasticol Mussa (pxgyc6tq8x@privaterelay.appleid.com)


lOMoARcPSD|25873678

COMPONENTS USED

Name of the Component: Quantity


1. Arduino UNO 1

2. Bluetooth Module HC-05 1

3. L298N Motor Drivers 1

4. Jumper wires 1

5. 18650 3.7V Li-ion 2200mAh batteries 3

6. Castor wheels 4

7. Battery Holder 3x1

8. On/Off Switch 1

Downloaded by Ecclesiasticol Mussa (pxgyc6tq8x@privaterelay.appleid.com)


lOMoARcPSD|25873678

THEORY
1.ARDUINO UNO:
Arduino UNO is a basic and inexpensive Arduino board and is the most
popular of all the Arduino boards with a market share of over 50%.
Arduino UNO is considered to be the best prototyping board for
beginners in electronics and coding.

UNO is based on ATmega328P microcontroller. There are two variants of


the Arduino UNO: one which consists of through – hole microcontroller
connection and other with surface mount type. Through-hole model will
be beneficial as we can take the chip out in case of any problem and
swap in with a new one.

Downloaded by Ecclesiasticol Mussa (pxgyc6tq8x@privaterelay.appleid.com)


lOMoARcPSD|25873678

Arduino UNO comes with different features and capabilities. As


mentioned earlier, the microcontroller used in UNO is ATmega328P,
which is an 8-bit microcontroller based on the AVR architecture.

UNO has 14 digital input – output (I/O) pins which can be used as either
input or output by connecting them with different external devices and
components. Out of these 14 pins, 6 pins are capable of producing PWM
signal. All the digital pins operate at 5V and can output a current of
20mA.

Some of the digital I/O pins have special functions which are describe
below.

 Pins 0 and 1 are used for serial communication. They are used to
receive and transmit serial data which can be used in several

Downloaded by Ecclesiasticol Mussa (pxgyc6tq8x@privaterelay.appleid.com)


lOMoARcPSD|25873678

ways like programming the Arduino board and communicating


with the user through serial monitor.
 Pins 2 and 3 are used for external interrupts. An external event
can be triggered using these pins by detecting low value, change
in value or falling or rising edge on a signal.
 As mentioned earlier, 6 of the 14 digital I/O Pins i.e. 3, 5, 6, 9, 10,
and 11 can provide 8-bit PWM output.
 Pins 10, 11, 12 and 13 (SS, MOSI, MISO AND SCK respectively) are
used for SPI communication.
 Pin 13 has a built-in LED connected to it. When the pin is HIGH, the
LED is turned on and when the pin is LOW, it is turned off.
Arduino Uno has 6 analog input pins which can provide 10 bits of
resolution i.e. 1024 different values. The analog pins on the Arduino UNO
are labelled A0 to A5.

By default, all the analog pins can measure from ground to 5V. Arduino
UNO has a feature, where it is possible to change the upper end of the
range by using the AREF pin but the value should be less than 5V.

Downloaded by Ecclesiasticol Mussa (pxgyc6tq8x@privaterelay.appleid.com)


lOMoARcPSD|25873678

Additionally, some analog pins have specialized functionality. Pins A4


and A5 are used for I2C communication.

There are different ways in which we can power the Arduino UNO board.
The USB cable, which is used to program the microcontroller, can be
used as a source of power.

There is a power jack, using which an external regulated power supply


in the range of 7V – 12V can be supplied. Additionally, the power can
also be supplied from a battery through the VIN pin.

The UNO board has on-board voltage regulators for 5V and 3.3V, which
can be used as power supply for small external devices like LEDs.

2. BLUETOOTH MODULE HC-05:


 HC-05 is a Bluetooth module which is designed for wireless
comunication. This module can be used in a master or slave
configuration.

Downloaded by Ecclesiasticol Mussa (pxgyc6tq8x@privaterelay.appleid.com)


lOMoARcPSD|25873678

HC-05 Bluetooth Module

Pin Description

Bluetooth serial modules allow all serial enabled devices to


communicate with each other using Bluetooth.

Downloaded by Ecclesiasticol Mussa (pxgyc6tq8x@privaterelay.appleid.com)


lOMoARcPSD|25873678

It has 6 pins,
1. Key/EN: It is used to bring Bluetooth module in AT commands mode. If
Key/EN pin is set to high, then this module will work in command mode.
Otherwise by default it is in data mode. The default baud rate of HC-05
in command mode is 38400bps and 9600 in data mode.
HC-05 module has two modes,
1. Data mode: Exchange of data between devices.
2. Command mode: It uses AT commands which are used to change
setting of HC-05. To send these commands to module serial (USART)
port is used.
2. VCC: Connect 5 V or 3.3 V to this Pin.
3. GND: Ground Pin of module.
4. TXD: Transmit Serial data (wirelessly received data by Bluetooth
module transmitted out serially on TXD pin)
5. RXD: Receive data serially (received data will be transmitted
wirelessly by Bluetooth module).
6. State: It tells whether module is connected or not.

HC-05 module Information:

 HC-05 has red LED which indicates connection status, whether the
Bluetooth is connected or not. Before connecting to HC-05 module
this red LED blinks continuously in a periodic manner. When it
gets connected to any other Bluetooth device, its blinking slows
down to two seconds.
 This module works on 3.3 V. We can connect 5V supply voltage as
well since the module has on board 5 to 3.3 V regulator.
 As HC-05 Bluetooth module has 3.3 V level for RX/TX and
microcontroller can detect 3.3 V level, so, no need to shift transmit
level of HC-05 module. But we need to shift the transmit voltage
level from microcontroller to RX of HC-05 module.

Downloaded by Ecclesiasticol Mussa (pxgyc6tq8x@privaterelay.appleid.com)


lOMoARcPSD|25873678

3. L298 Motor Drivers:

L298N Motor Driver IC is a 15-lead high voltage, high current Motor


Driver IC with two full bridge drivers. The logic levels of L298N IC are
compatible with standard TTL and IC can be used to drive different
inductive loads like DC Motors, Stepper Motors, Relay, etc.

The following image shows the Pin Diagram of the L298N IC in Multiwatt
Package (Multi Leaded Power Package).

Since the L298N Motor Driver IC is a dual full bridge driver IC, you can
control two motors at the same time with individual inputs. The logic
supply voltage is 5V but the motor supply voltage can be as high as 45V.
The peak output current per channel is 2A.

Generally, L298N Driver is available as modules that contains all the


necessary components and connectors for controlling two DC Motors.
One such module is shown below. I’ll explain few important components
on this module.

Downloaded by Ecclesiasticol Mussa (pxgyc6tq8x@privaterelay.appleid.com)


lOMoARcPSD|25873678

The L298N Motor Driver Module consists of two 2-pin screw terminal
blocks for connecting two motors. It also has six pin male headers for
connecting the two enable inputs and the four input pins (two for each
motor).

There is a 3-pin screw terminal block through which you need to give
the supply voltage to the motor. If the motors used are rated for 12V or
less, then the 12V supply is given through this screw terminal and the
onboard 5V regulator will provide the 5V logic supply to the L298N IC.

Downloaded by Ecclesiasticol Mussa (pxgyc6tq8x@privaterelay.appleid.com)


lOMoARcPSD|25873678

You can also access this regulated 5V through the third pin in the 3-pin
screw terminal block. The jumper provided near the 3-pin screw
terminal must be engaged for supply voltages up to 12V as this jumper
will enable the onboard regulator. The 5V output from the third pin of
the 3-pin screw terminal is available only when the jumper is engaged
i.e. supply voltage is 12V. This 5V output can be used to power your
Arduino Board.If the supply voltage is greater than 12V, then remove the
jumper as it might damage the regulator. In this case, the logic supply
of 5V to the L298N IC is given through the third pin of the 3-pin screw
terminal.

Arduino DC Motor Control using L298N:


We will now see a simple circuit where we control the speed and
direction of a DC Motor using Arduino and L298N IC. You need few
additional components for this project and the complete list is given
below. In the Arduino DC Motor Control using L298N Project, we will
control both the functionalities of a simple DC Motor i.e. speed and
direction of rotation using a combination of PWM Signal and L298N (H-
Bridge).

Downloaded by Ecclesiasticol Mussa (pxgyc6tq8x@privaterelay.appleid.com)


lOMoARcPSD|25873678

WORKING

BLOCK DIAGRAM:

EXPLANATION: Take a closer look on the Wiring Diagram. We could


notice the power source, three 1.5 volt batteries connected to the 12V
power pin of L298 Motor Drive and ground of Motor Drive and Arduino
UNO. This supplies essential power to the circuit. A total of 6 volts is
being supplied to this system, where the maximum permissible amount
is 12 volts. Digital wires of Arduino are connected with the
input1, input2, input3 and input4 of the motor drive. Motors are
connected to the either sides of Motor Drive which are the outputs
terminals. To complete the power source circuit, 5V of Motor Drive is
connected to Vin power pin of Arduino UNO. Followed by this, HC05
Bluetooth Module’s Vcc is connected to 5V pin of Arduino UNO, which
supplies power to Bluetooth Module. Ground to Ground connections are
also made. Transistor Transistor logic pins, Transmitter (TX) and
Receiver (RX) of Arduino UNO are connected to RXD and TXD of
HC05 respectively. The program is uploaded to Arduino before
connecting the Bluetooth module.

Downloaded by Ecclesiasticol Mussa (pxgyc6tq8x@privaterelay.appleid.com)


lOMoARcPSD|25873678

After all successful connections, switch on the power source. Lights at


Motor Drive, Arduino UNO and HC05 would indicate the correct
connection. Upon successful connection of your Bluetooth module with
any android device, we could control this device. By passing the
command, for example, to move forward we pass ‘F’. This command is
transmitted by our device to Bluetooth module, which in turn transmits
to Arduino UNO. Arduino receives is and passes the same to Motor Drive
through its digital pins. Motor Drive will get this through their input pins
and exercise them through their output pins were motor is connected.

SOURCE CODE:
char t;

void setup() {
pinMode(13,OUTPUT); //left motors forward
pinMode(12,OUTPUT); //left motors reverse
pinMode(11,OUTPUT); //right motors forward
pinMode(10,OUTPUT); //right motors reverse
pinMode(9,OUTPUT); //Led
Serial.begin(9600);

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

if(t == 'F'){ //move forward(all motors rotate in forward


direction)
digitalWrite(13,HIGH);
digitalWrite(11,HIGH);
}

else if(t == 'B'){ //move reverse (all motors rotate in reverse


direction)
digitalWrite(12,HIGH);
digitalWrite(10,HIGH);
}

else if(t == 'L'){ //turn right (left side motors rotate in


forward direction, right side motors doesn't rotate)

Downloaded by Ecclesiasticol Mussa (pxgyc6tq8x@privaterelay.appleid.com)


lOMoARcPSD|25873678

digitalWrite(11,HIGH);
}

else if(t == 'R'){ //turn left (right side motors rotate in


forward direction, left side motors doesn't rotate)
digitalWrite(13,HIGH);
}

else if(t == 'W'){ //turn led on or off)


digitalWrite(9,HIGH);
}
else if(t == 'w'){
digitalWrite(9,LOW);
}

else if(t == 'S'){ //STOP (all motors stop)


digitalWrite(13,LOW);
digitalWrite(12,LOW);
digitalWrite(11,LOW);
digitalWrite(10,LOW);
}
delay(100);
}

CONCLUSION:
The final product we obtained is just the skeleton of those Bluetooth
Control Cars we see in the market. The mechanical design of this
product is also proposed, which could be practically made to give a
much better looking commercial product. For future plans, this product
could be added with sensors like, accelerometer and humidity sensor,
thereby widening their field of use.
The present product however could show some latency. The reason is,
due to many connections and least power source of 6V, which result in
loss of energy. So in future, we could use rechargeable batteries like
Ni-Cd Battery or Li-ion battery that could avoid the present
disadvantage.
Also, we could make use of this RC Motor Car as a surveillance system
or rovers by adding a few more sensors and updating the code. This
would make them into robots. These robots could self monitor under

Downloaded by Ecclesiasticol Mussa (pxgyc6tq8x@privaterelay.appleid.com)


lOMoARcPSD|25873678

any human supervision, thereby reducing man power. These are just the
alternatives, on which this project could be improvised and updated.

ACTUAL VIEW OF BLUETOOTH CONTROLLED CAR:

Downloaded by Ecclesiasticol Mussa (pxgyc6tq8x@privaterelay.appleid.com)

You might also like