Project Document
Project Document
on
Smartphone Controlled Car Using Arduino and Bluetooth
Submitted to
Ms. CH RAJESWARI,M.Tech
Assistant Professor
CHAPTER-5 CONCLUSION 30
CHAPTER-6 REFERENCES 31
LIST OF FIGURES
Arduino UNO
Bluetooth module
300RPM motors
Lithium batteries
Switch
Jumper wires
Circuit diagram
ABSTRACT
In this modern world, the smart phone is becoming a mean to control most of our day-to-day
activities, either directly or indirectly. We’re becoming more and more dependent on smart
phone for controlling various day to day objects near and around us, some of which include
lights, televisions, sound systems, air conditioners etc. So in such a time where people are
migrating to a smart phone based life, exercising control over things near and around them ,our
project is aimed at developing a smartphone controlled car to which can be controlled through a
smart phone app. Making best use of the high end byte crushing processors in their hands, the
app facilitates the user can control the car by connecting Bluetooth to our smartphone which
attracts the child, plays with the child and also packs some additional features for entertainment
of the user. We’re using Arduino Uno, motor driver and a mobile application to get the things
done in our project.
Keywords: Arduino Uno, motor driver, Bluetooth, mobile applications.
CHAPTER-1
INTRODUCTION
Nowadays smart phones are becoming more powerful with reinforced processors, larger
storage capacities, richer entertainment function and more communication methods. Bluetooth
is mainly used for data exchange; add new features to smart phones. Bluetooth
technology, created by telecom vendor Ericsson in 1994, shows its advantage by integrating
with smart phones. It has changed how people use digital device at home or office, and has
transferred traditional wired digital devices into wireless devices. A host Bluetooth device is
capable of communicating with up to seven Bluetooth modules at same time through one
link. Considering its normal working area of within eight meters, it is especially useful in
home environment. Thank for Bluetooth technology and other similar techniques, with
dramatic increase in Smartphone users, smart phones have gradually turned into an all-
purpose portable device and provided people for their daily use. In recent years, an open-
source platform Android has been widely used in smart phones. Android has complete
software package consisting of an operating system, middleware layer and core applications.
Different from other existing platform like iOS (iPhone OS), it comes with software
development kit (SDK), which provides essential tools and Application. Using a Smartphone
as the “brain” of a car is already an active research field with several open opportunities
and promising possibilities. In this project we present a car controlled by mobile phone and
discuss a control systems using mobile devices.
As most of the work in this area has been done regarding the Arduino & its application, what
left out most of the time is the Android controller. In this project we are trying to exploit the
android open accessory Bundle so that we can give more realistic experience to the user, better
connectivity to the Arduino Chip.
The smartphone has an Android app through which the user can send commands directly to the
car. The car can move forward, backward, left, and right.The Arduino’s Bluetooth-controlled car
is interfaced with a Bluetooth module. We can give specific commands to the car 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.
The Arduino Uno is a microcontroller board based on the ATmega328P. It has 14 digital
input/output pins (of which 6 can be used as PWM outputs), 6 Analog inputs, a 16 MHz quartz
crystal, a USB connection, a power jack, an ICSP header and a reset button. The L293 is an
integrated monolithic circuit in a 15- lead Multi-watt and PowerSO20 packages. It is a high
voltage, high current dual full-bridge driver designed to accept standard TTL logic levels and
drive inductive loads such as relays, solenoids, DC and stepping motors.
CHAPTER-2
BLOCK DIAGRAM OF SMARTPHONE CONTROLLED CAR
COMPONENTS REQUIRED
S.NO APPARATUS RANGE QUANTITY
7. Wheels - 4
8. Switch - 1
9. Jumper wires - As per
requirement
10. PVC Sheets - As per
requirement
COMPONENTS DESCRIPTION
1.ARDUINO UNO:
The Arduino Uno is an open-source microcontroller board based on the Microchip
ATmega328P microcontroller and developed by Arduino.cc and initially released in 2010. The
board is equipped with sets of digital and Analog input/output (I/O) pins that may be interfaced
to various expansion boards (shields) and other circuits. The board has 14 digital I/O pins (six
capable of PWM output), 6 Analog I/O pins, and is programmable with the Arduino IDE
(Integrated Development Environment), via a type B USB cable. It can be powered by the USB
cable or by an external 9-volt battery, though it accepts voltages between 7 and 20 volts.
Technical Specifications:
• Microcontroller: Microchip ATmega328P
• Operating Voltage: 5 Volts
• Input Voltage: 7 to 20 Volts
• Digital I/O Pins: 14
• PWM Pins: 6 (Pin # 3, 5, 6, 9, 10 and 11)
• UART: 1
• I2C: 1
• SPI: 1
• Analog Input Pins: 6
• DC Current per I/O Pin: 20 mA
• DC Current for 3.3V Pin: 50 mA
• Flash Memory: 32 KB of which 0.5 KB used by bootloader
• SRAM: 2 KB
• EEPROM: 1 KB
• Clock Speed: 16 MHz
• Length: 68.6 mm
• Width: 53.4 mm
• Weight: 25 g
• ICSP Header: Yes
• Power Sources: DC Power Jack, USB Port and the VIN pin (+5 volt only)
General pin functions:
• LED: There is a built-in LED driven by digital pin 13. When the pin is high value, the
LED is on, when the pin is low, it is off.
• VIN: The input voltage to the Arduino/Genuino board when it is using an external power
source (as opposed to 5 volts from the USB connection or other regulated power source).
You can supply voltage through this pin, or, if supplying voltage via the power jack,
access it through this pin.
• 5V: This pin outputs a regulated 5V from the regulator on the board. The board can be
supplied with power either from the DC power jack (7 - 20V), the USB connector (5V),
or the VIN pin of the board (7-20V). Supplying voltage via the 5V or 3.3V pins bypasses
the regulator, and can damage the board.
• 3V3: A 3.3-volt supply generated by the on-board regulator. Maximum current draw is
50 mA.
• GND: Ground pins.
• IOREF: This pin on the Arduino/Genuino board provides the voltage reference with
which the microcontroller operates. A properly configured shield can read the IOREF pin
voltage and select the appropriate power source, or enable voltage translators on the
outputs to work with the 5V or 3.3V.
• Reset: Typically used to add a reset button to shields that block the one on the board.
Special pin functions:
Each of the 14 digital pins and 6 Analog pins on the Uno can be used as an input or output,
under software control (using pin Mode (), Digital Write (), and Digital Read () functions). They
operate at 5 volts. Each pin can provide or receive 20 mA as the recommended operating
condition and has an internal pull-up resistor (disconnected by default) of 20-50K ohm. A
maximum of 40mA must not be exceeded on any I/O pin to avoid permanent damage to the
microcontroller. The Uno has 6 Analog inputs labelled A0 through A5; each provides 10 bits of
resolution (i.e., 1024 different values). By default, they measure from ground to 5 volts, though it
is possible to change the upper end of the range using the AREF pin and the Analog Reference ()
function.
In addition, some pins have specialized functions:
• Serial / UART: pins 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL
serial data. These pins are connected to the corresponding pins of the ATmega8U2 USB-
to-TTL serial chip.
• External interrupts: pins 2 and 3. These pins can be configured to trigger an interrupt
on a low value, a rising or falling edge, or a change in value.
• PWM :(pulse-width modulation): pins 3, 5, 6, 9, 10, and 11. Can provide 8-bit PWM
output with the Analog Write () function.
• SPI :(Serial Peripheral Interface): pins 10 (SS), 11 (MOSI), 12 (MISO), and 13 (SCK).
These pins support SPI communication using the SPI library.
• TWI (two-wire interface) / I²C: pin SDA (A4) and pin SCL (A5). Support TWI
communication using the Wire library.
• AREF (Analog reference): Reference voltage for the Analog inputs.
Communication:
The Arduino/Genuino Uno has a number of facilities for communicating with a computer,
another Arduino/Genuino board, or other microcontrollers. The ATmega328 provides UART
TTL (5V) serial communication, which is available on digital pins 0 (RX) and 1 (TX). An
ATmega16U2 on the board channels this serial communication over USB and appears as a
virtual com port to software on the computer.
The 16U2 firmware uses the standard USB COM drivers, and no external driver is needed.
However, on Windows, a .inf file is required. Arduino Software (IDE) includes a serial monitor
which allows simple textual data to be sent to and from the board. The RX and TX LEDs on the
board will flash when data is being transmitted via the USB-to-serial chip and USB connection
to the computer (but not for serial communication on pins 0 and 1). A Software Serial library
allows serial communication on any of the Uno's digital pins.
Pin Description:
• 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.
Bluetooth communication between Devices:
E.g., Send data from Smartphone terminal to HC-05 Bluetooth module and see this data on PC
serial terminal and vice versa.
To communicate smartphone with HC-05 Bluetooth module, smartphone requires Bluetooth
terminal application for transmitting and receiving data. You can find Bluetooth terminal
applications for android and windows in respective app store.
Command Mode:
• When we want to change settings of HC-05 Bluetooth module like change password for
connection, baud rate, Bluetooth device’s name etc.
• To do this, HC-05 has AT commands.
• To use HC-05 Bluetooth module in AT command mode, connect “Key” pin to High
(VCC).
• Default Baud rate of HC-05 in command mode is 38400bps.
• Following are some AT command generally used to change setting of Bluetooth module.
• To send these commands, we have to connect HC-05 Bluetooth module to the PC via
serial to USB converter and transmit this command through serial terminal of PC.
3.300 RPM MOTORS:
These motors are simple DC Motors featuring gears for the shaft for obtaining the optimal
performance characteristics. They are known as Center Shaft DC Geared Motors because their
shaft extends through the center of their gearbox assembly.These standard size DC Motors are
very easy to use. Also, you don’t have to spend a lot of money to control motors with an Arduino
or compatible board. The L298N H-bridge module with an onboard voltage regulator motor
driver can be used with this motor that has a voltage of between 5 and 35V DC.
FIG:LOGIC DIAGRAM
Functional diagram of a device shows the steps followed by that device in order to perform some
action to give output.
FIG:FUNCTIONAL BLOCK DIAGRAM
FEATURS:
• High output current up to 1A/channel.
• Wide voltage supply range ranging from 4.5V to 36V.
• Peak output current up to 2A/channel.
• Internal Electrostatic Discharge (ESD) protection.
• A separate input supply.
• Inputs having large noise immunity.
APPLICATIONS:
• DC motor drivers.
• Relay drivers.
• Stepper motor drivers.
• Two phase motor driver, block diagram of L 293D application for two phase motor.
5.18650 LITHIUM BATTERIES:
DESIGN:
Generally, the negative electrode of a conventional lithium-ion cell is made from carbon The
positive electrode is typically a metal oxide. The electrolyte is a lithium salt in
an organic solvent. The electrochemical roles of the electrodes reverse between anode and
cathode, depending on the direction of current flow through the cell.
The most common commercially used anode (negative electrode) is graphite, which in its fully
litigated state of LiC6 correlates to a maximal capacity of 1339 C/g (372 mAh/g). The positive
electrode is generally one of three materials: a layered oxide (such as lithium cobalt oxide),
a polyanion (such as lithium iron phosphate) or a spinel (such as lithium manganese
oxide). More experimental materials include graphene-containing electrodes, although these
remain far from commercially viable due to their high cost.
6.SWITCH:
FIG: Switch
A switch is an electrical component that can disconnect or connect the conducting path in an
electrical circuit, interrupting the electric current or diverting it from one conductor to another.
There are many designs of switches, common type switch is toggle or tumbler, switch is widely
used in home lighting and other applications.
The oil switch has its live parts immersed in oil to reduce arcing. The aggregate of switching or
circuit breaking equipment for a power station or a transforming station, frequently located in an
outdoor yard beside the station, is usually regarded as switchgear.
A switch is used in a wired network to connect to other devices using Ethernet cables. The
switch allows each connected device to talk to the others. Wireless only networks do not use
switches because devices such as wireless routers and adapters communicate directly with the
another one.
Switches are key building blocks for any network. They connect multiple devices, such as
computers, wireless access points, printers, and servers; on the same network within a building
or campus. A switch enables connected devices to share information and talk to each other.
An Unmanaged network switch is designed so that you can simply plug them in and they work,
no configuration required. Unmanaged switches are typically for basic connectivity. You will
often see them used in home networks or wherever a few more ports are needed, such as at your
desk, in a lab, or in a conference room.
Managed switches give your greater security and more features and flexibility because you can
configure them to custom-fit network. With this greater control, you can better protect your
network and improve the quality of service for those who access the network.
A network hub is central connection point for devices in a local area network, or LAN. But there
is a limit to the amount of bandwidth users can share on a hub-based network. The more devices
are added to the network hub, the longer it takes data to reach its destination. A switch avoids
these and other limitations of network hubs.
A large network may include multiple switches, which connect different groups of computer
systems together. These switches are typically connected to a router that allows connected
devices to access the internet. While switches allow different devices on a network
communicate, routers allow different networks to communicate.
A router is a networking device that routers data packets between computer networks. A router
can connect networked computers to the internet, so multiple users can share a connection.
Routers help connect networks within organization or connect the networks of multiple branch
locations. And a router works as a dispatcher. It directs data traffic, choosing the best route for
information to travel across the network, so that it’s transmitted as efficiently as possible.
You may find that you need to increase the number of ports that can plug into your router, so you
can setup a network switch connects with your router. Your network switch connects to the
router through one of the ports on the router, extending the number of devices in your small
office network, such as desktop computers, printers, laptops, etc. that have wired connection to
the internet.
7.JUMPER WIRES:
Wire jumpers sometimes referred to as panel switch jumpers are premade sections of wire
used to interconnect the back of an electrical panel or similar piece of equipment. Oftentimes,
when wiring the of the back of the panel, you need short runs of wire that offer the same
protection as longer run world.
FIG: Jumper wire connections
There are three types of jumper wires:
Jumper wires typically come in three versions: male to male, male to female and female to
female. The difference between each is in the end point of the wire. Male ends have a pin
protruding and can plug into things, while female ends do not and are used to plug things into.
These are male to female jumper wires used in connecting the female header pin of any
development boards having a male connector pin at each end allowing them to be used to
connect two points each other.
A male connector is commonly referred to as a plug and has a solid pin for a centre conductor. A
female connector is commonly referred to as a jack and has a centre conductor with a hole in it to
accept the male pin.
CHAPTER-3
CIRCUIT DIAGRAM
CODE:
#include <LiquidCrystal.h>
const int rs = 13, en = 12, d4 = 11, d5 = 10, d6 = 9, d7 = 8;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
int buzzer=3;
int mic=13;
int fire=12;
int up1=8;
int up2=9;
int open1=10;
int open2=11;
int m1 = 7;
int m2 = 6;
int m3 = 5;
int m4 = 4;// select the pin for the LED
int x = 0; // variable to store the value coming from the sensor
int y = 0; // variable to store the value coming from the sensor
int z = 0; // variable to store the value coming from the sensor
String data;
void setup()
{
pinMode(buzzer, OUTPUT);
pinMode(fire, INPUT);pinMode(mic, INPUT);
pinMode(m1, OUTPUT);pinMode(m2, OUTPUT);pinMode(m3, OUTPUT);pinMode(m4,
OUTPUT);
pinMode(up1, OUTPUT);pinMode(up2, OUTPUT); pinMode(open1,
OUTPUT);pinMode(open2, OUTPUT);
digitalWrite(m1,LOW);digitalWrite(m2,LOW);digitalWrite(m3,LOW);digitalWrite(m4,LOW);
digitalWrite(up1,LOW);digitalWrite(up2,LOW);digitalWrite(open1,LOW);digitalWrite(open1,
LOW);
digitalWrite(buzzer,LOW);delay(1000);
Serial.begin(9600);
}
void front()
{
Serial.println("FRONT");delay(1000);
delay(1000);digitalWrite(m1, HIGH); digitalWrite(m2, LOW); digitalWrite(m3, HIGH);
digitalWrite(m4, LOW);delay(1000);
}
void back()
{
Serial.println("BACK");delay(1000);
delay(1000);digitalWrite(m1, LOW); digitalWrite(m2, HIGH); digitalWrite(m3, LOW);
digitalWrite(m4, HIGH);delay(1000);
void left()
{
Serial.println("LEFT");delay(1000);
delay(1000);digitalWrite(m1, HIGH); digitalWrite(m2,LOW); digitalWrite(m3, LOW);
digitalWrite(m4, HIGH);delay(1000);
stop1();
}
void right()
{
Serial.println("RIGHT");delay(1000);
delay(1000);digitalWrite(m1, LOW); digitalWrite(m2,HIGH); digitalWrite(m3, HIGH);
digitalWrite(m4, LOW);delay(1000);
stop1();
}
void stop1()
{
Serial.println("STOP");delay(1000);
digitalWrite(m1, LOW); digitalWrite(m2,LOW); digitalWrite(m3,LOW); digitalWrite(m4,
LOW);delay(1000);
}
void up()
{
Serial.println("up");delay(1000);
digitalWrite(up1, HIGH); digitalWrite(up2,LOW); delay(500); digitalWrite(up1,LOW);
digitalWrite(up2, LOW);delay(100);
}
void down()
{
Serial.println("down");delay(1000);
digitalWrite(up2, HIGH); digitalWrite(up1,LOW); delay(500); digitalWrite(up1,LOW);
digitalWrite(up2, LOW);delay(100);
}
void open11()
{
Serial.println("open");delay(1000);
digitalWrite(open1, HIGH); digitalWrite(open2,LOW); delay(1000); digitalWrite(open1,LOW);
digitalWrite(open2, LOW);delay(100);
}
void close1()
{
Serial.println("close");delay(1000);
digitalWrite(open2, HIGH); digitalWrite(open1,LOW); delay(1000); digitalWrite(open1,LOW);
digitalWrite(open2, LOW);delay(100);
}
void loop()
{
back:
Serial.println("i need voice command from bluetooth to start...");
while(1)
{
while(Serial.available())
{
data=Serial.readString();delay(100);Serial.println(data);delay(100);
if(data[0]=='f' )
{
data="";
front();
}
else if(data[0]=='f' && data[1]=='r' && data[2]=='o' && data[3]=='n' && data[4]=='t')
{
data="";
front();
}
else if(data[0]=='*' && data[1]=='f' && data[2]=='r' && data[3]=='o' && data[4]=='n' &&
data[5]=='t' && data[6]=='#')
{
data="";
front();
}
else if(data[0]=='b' )
{
data="";
back();
}
else if(data[0]=='b' && data[1]=='a' && data[2]=='c' && data[3]=='k' )
{
data="";
back();
}
else if(data[0]=='*' && data[1]=='b' && data[2]=='a' && data[3]=='c' && data[4]=='k' &&
data[5]=='#')
{
data="";
back();
}
else if(data[0]=='l' )
{
data="";
left();
}
else if(data[0]=='l' && data[1]=='e' && data[2]=='f' && data[3]=='t' )
{
data="";
left();
}
else if(data[0]=='*' && data[1]=='l' && data[2]=='e' && data[3]=='f' && data[4]=='t' &&
data[5]=='#')
{
data="";
left();
}
else if(data[0]=='r' )
{
data="";
right();
}
else if(data[0]=='r' && data[1]=='i' && data[2]=='g' && data[3]=='h' && data[4]=='t')
{
data="";
right();
}
else if(data[0]=='*' && data[1]=='r' && data[2]=='i' && data[3]=='g' && data[4]=='h' &&
data[5]=='t' && data[6]=='#')
{
data="";
right();
}
else if(data[0]=='s' )
{
data="";
stop1();
}
else if(data[0]=='s' && data[1]=='t' && data[2]=='o' && data[3]=='p' )
{
data="";
stop1();
}
else if(data[0]=='*' && data[1]=='s' && data[2]=='t' && data[3]=='o' && data[4]=='p' &&
data[5]=='#')
{
data="";
stop1();
}
if(data[0]=='u' )
{
data="";
up();
}
if(data[0]=='u' && data[1]=='p' )
{
data="";
up();
}
if(data[0]=='*' && data[1]=='u' && data[2]=='p' && data[3]=='#')
{
data="";
up();
}
if(data[0]=='d' )
{
data="";
down();
}
if(data[0]=='d' && data[1]=='o' && data[2]=='w' && data[3]=='n' )
{
data="";
down();
}
if(data[0]=='*' && data[1]=='d' && data[2]=='o' && data[3]=='w' && data[4]=='n' &&
data[5]=='#')
{
data="";
down();
}
if(data[0]=='o' )
{
data="";
open11();
}
if(data[0]=='o' && data[1]=='p' && data[2]=='e' && data[3]=='n' )
{
data="";
open11();
}
if(data[0]=='*' && data[1]=='o' && data[2]=='p' && data[3]=='e' && data[4]=='n' &&
data[5]=='#')
{
data="";
open11();
}
if(data[0]=='c' )
{
data="";
close1();
}
if(data[0]=='c' && data[1]=='l' && data[2]=='o' && data[3]=='s' && data[4]=='e')
{
data="";
close1();
}
if(data[0]=='*' && data[1]=='c' && data[2]=='l' && data[3]=='o' && data[4]=='s' &&
data[5]=='e' && data[6]=='#')
{
data="";
close1();
}
}
}
}
CHAPTER-4
ADVANTAGES
• It gives us wider range of control and more efficiency.
• It gives us the advantage of changing the remote anytime, meaning that we can use any
android devices including phones, tablets, computers.
• The connected vehicles come with an important security feature known as Geo-Fencing.
• Vehicle-to-vehicle connectivity technology allows connected vehicles to communicate
with each other.
• Connected vehicles come equipped with several critical security features such as real-
time location sharing/tracking, emergency SOS calls in case of an accident
CHAPTER-5
CONCLUSION
The project titled Bluetooth Car using Arduino is an application based on popular open-source
technology - Android and Arduino. The aim of the project was to create an Arduino integrated
car that has to be controlled through an application that runs on the android operating system.
The project has been completed with success with the utmost satisfaction.
The Arduino is an open-source device that has been the brain for numerous projects. The
Arduino has everything that is required by the user which includes its inbuilt converter, I /O pins
etc. With the combination of Arduino, and the Bluetooth Shield we can control over many other
things, like home Lightings, air conditioner and many more through our cell phones. The
Arduino can also contribute at large for the Smart Home system. By doing this Project we found
out a lot about the Arduino, and how it has made us easier to convert digital signals into physical
movements. One more advantage of Arduino is that once a program is burned we don‘t need to
worry about the program getting erased as long as it is not RESET. Arduino has also over all
other microcontroller because of its efficiency and user-friendly property.
CHAPTER-6
REFERENCES
[1] Design of a Bluetooth Enabled Android Application for a Microcontroller Driven Robot By
Vito M. Guardi, (May 2014).
[2] Introduction to Arduino A piece of cake! by Alan G. Smith September 30, 2011.
[3] 30 Arduino Projects for the Evil Genius Simon Monk, McGraw-Hill Companies Inc
[4] A. Sharma, J. Mondal, C. Pandey, R. Kumar and A. Bhattacharya, “IoT Based Home
Automation System”; Advances in Applied Science; Volume 2017; Article ID 100005, pp. 01-
06; Feb. 2017
[5] Arpit Sharma, Reetesh Verma, Saurabh Gupta and Sukhdeep Kaur Bhatia, “Android Phone
Controlled Robot Using Bluetooth”, International Journal of Electronic and Electrical
Engineering. Volume 7, Number 5 (2014), pp. 443- 448.
[6] P. D. Minns, Atmega32 for Arduino Microcontroller System. Author House, 2013
[7] https://www.arduino.cc/en/Tutorial/Foundations/AnalogInputPin