Bluetooth-Controlled Smart RC Vehicle
NAME ::
MUHAMMAD AHSAN
ID::
F2019376007
Project Report on
ELECTRIC CAR
Abstract
A remote controlled vehicle is any mobile machine controlled by means that is physically not connected with origin external to the machine. There are many types in it, based on the controls – radio control device, Wi-Fi controlled and even Bluetooth controlled. These devices are always controlled by humans and take no action autonomously. The main target in such vehicles would be to safely reach a designated point, maneuver the area and reach back to the point of origin.
In this project we make use of the Bluetooth technology to control our machine car. We don’t call this as a robot as this device doesn’t have any sensors. Thereby, sensor less robots are machines. This machine ccan be controlled by any human using his android mobile phone, by downloading an app and connecting it with the Bluetooth module present inside our car. User can perform actions like moving forward, backward, moving left and right by the means of command using his-her mobile phone app. The task of controlling our car is taken car by the Arduino UNO with micro controller ATMEGA32, 16 mHz processor, 2 KB SRAM (Static Random Accessible Memory) and 32 KB flash memory. Arduino play a major role in the control section and had made it easier to convert digital signals and analogue signals into physical movements. The major reason for using a Bluetooth based tech is that we can change the remote anytime – mobiles phones, tablets and laptops and physical barriers like wall or doors do not affect the car controls.
Materials Used
Model or Specifications
Theory
Arduino UNO Board
The Arduino Uno is an open-source microcontroller board based on the Microchip ATmega328P microcontroller and developed by Arduino.cc. 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. It is similar to the Arduino Nano and Leonardo. The hardware reference design is distributed under a Creative Commons Attribution Share-Alike 2.5 license and is available on the Arduino website. Layout and production files for some versions of the hardware are also available. The word "uno" means "one" in Italian and was chosen to mark the initial release of Arduino Software. The Uno board is the first in a series of USB-based Arduino boards; it and version 1.0 of the Arduino IDE were the reference versions of Arduino, which have now evolved to newer releases. The ATmega328 on the board comes preprogrammed with a bootloader that allows uploading new code to it without the use of an external hardware programmer. While the UNO communicates using the original STK500 protocol, it differs from all preceding boards in that it does not use the FTDI USB-to-serial driver chip. Instead, it uses the Atmega16U2
(Atmega8U2 up to version R2) programmed as a USB-to-serial converter.
Motor Drive
The Motor Driver is a module for motors that allows you to control the working speed and direction of two motors simultaneously .
1st Pin Motor Driver IC. This is designed to provide bidirectional drive currents at voltages from 5 V to 36 V.
Rotation of motor depends on Enable Pins. When Enable 1/2 is HIGH , motor connected to left part of IC will rotate according to following manner:
Input
Input
2
Result
0
0
Stop
0
1
Anti-Clockwise
1
0
Clockwise
Pin Diagram and Connections
Working
Take a closer look on the Wiring Diagram. We could notice the power source, four 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.
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
#include<SoftwareSerial.h> SoftwareSerial MyBlue(0,1); char t;
void setup()
{
pinMode(13,OUTPUT); pinMode(12,OUTPUT); pinMode(11,OUTPUT); pinMode(10,OUTPUT);
MyBlue.begin(9600);
}
void loop()
{
if(MyBlue.available())
{
t = MyBlue.read();
}
if(t == 'F')
{
digitalWrite(13,HIGH);
digitalWrite(12,LOW); digitalWrite(11,HIGH);
digitalWrite(10,LOW);
}
else if(t == 'B')
{
digitalWrite(13,LOW);
digitalWrite(12,HIGH); digitalWrite(11,LOW);
digitalWrite(10,HIGH);
}
else if(t == 'L')
{
digitalWrite(13,HIGH);
digitalWrite(12,LOW); digitalWrite(11,LOW);
digitalWrite(10,HIGH);
}
else if(t == 'R')
{
digitalWrite(13,LOW);
digitalWrite(12,HIGH); digitalWrite(11,HIGH);
digitalWrite(10,LOW);
}
else if(t == 'S')
{
digitalWrite(13,LOW);
digitalWrite(12,LOW); digitalWrite(11,LOW);
digitalWrite(10,LOW);
}
delay(100);
}
Final Product Final Product
Final Product
Final Product
The end
Project Summary
Designed a Bluetooth-connected four-wheeled vehicle controlled via a custom Android smartphone application.
Programmed an Arduino UNO in embedded C++ to listen for character codes ('F', 'B', 'L', 'R', 'S') from an HC-05 Bluetooth module. Wired outputs to an L298N dual H-bridge motor driver controlling DC gear motors.
Built a responsive, barrier-independent RC car controllable from any Bluetooth-enabled Android device.