Professional Documents
Culture Documents
& Interfacing.
Presented To:
Sir Nesruminallah
Presented By:
Hafiz Ahsan Bajwa
Muhammad Junaid Sultan
Muhammad Hammad
Registration No:
FA20-BEE-055-T
FA20-BEE-089-T
FA20-BEE-132-T
Introduction:
In this project, we will deliberate how to control robot- controlled car using Bluetooth
module through Bluetooth application of an android mobile phone. The benefit of using
robot-controlled car is it can be used to reduce manual work. This project can be
modified quite easily to include a camera well that can stream the videos to the user
over Wi-Fi using WiFi module.
Related Work:
The automotive industry is evolving at a fast pace. Modern automobiles are far from the
vehicles that rolled off assembly lines in the 90s. Vehicles today are increasingly being
equipped with electrical and electronic components, efficiently replacing the ubiquitous
mechanical components of the past.
This transformation has also benefited the industry in several ways, as electrical and
electronic components enable:
The modern vehicle hosts wireless technologies such as Bluetooth Low Energy (BLE), GPS,
cellular (4G or 5G), Wi-Fi, etc. to fuel the evolving demands of the connected vehicle
ecosystem.
Project Implementation:
Components Detials
Components:
HC‐05 module is simple to use Bluetooth SPP (Serial Port Protocol) module, designed for
clear wireless serial association setup. The HC-05 Bluetooth Module is utilized in a Master
or Slave configuration, creating it a good resolution for wireless communication.
Ultrasonic sensor:
Servo Motor ;
A servomotor is a rotating actuator or straight actuator that takes into account exact control
of angular or linear position, speed and acceleration. It comprises of a reasonable engine
coupled to a sensor for position input. It likewise requires a moderately refined controller,
frequently a committed module structured explicitly for use with servomotors.
Servo motors are great devices that can turn to a specified position.Usually, they have a
servo arm that can turn 180 degrees. Using the Arduino, we can tell a servo to go to a
specified position and it will go there.
This L293D 16 pin Based Motor Driver Module is a powerful engine driver ideal for driving
DC Motors and Stepper Motors. It utilizes the wellknown L293 engine driver IC and has the
locally available 5V controller which it can gracefully to an outside circuit. It can control up
to 4 DC engines, or 2 DC engines with directional and speed control.
Obstacle detector:
The obstacle detector has a night vision which enables no light or low light usage. It
performs high-quality picture transmitting and receiving.
Schematic Diagram:
Block Diagram:
Working;
Practical Application;
The block diagram of the simple voice controlled robotic vehicle is given it consists of the
smartphone that recognizes the voice commands and are being wirelessly transferred to
the Bluetooth module HC05. The module at that point changes over the order to content
and the series of characters are sent to the Arduino for additional handling. The Arduino
microcontroller decodes the string got and correspondingly performs further capacities.
The signals are sent to the motor that hence powers and drives the motors connected to it.
On the Transmitter area, commands are given to the Mobile Application through the mic.
This portable handset is associated with the moving vehicle by means of Bluetooth
module. The portable application utilized, is modified so that the voice orders given to the
handset are received by the mic and these simple voice orders are changed over to
advanced word successions (A to D transformation). These stored sequences are than
transmitted to the robotic vehicle via Bluetooth transceiver module and are sent to the
transceiver controller. Android application transceiver is used to decode the received
signal with the Bluetooth module. The controller contrasts these signals and the put away
program orders in it and convert them into voice strings. The voice strings are then used to
run the servo engines for the ideal interval of time. The microcontroller, sends directions,
which when executed, helps in working of the engine driver. The yield of the Arduino
goes to the engine driver IC and it controls the specific engine. A DC power supply is
required to run the system. The DC power supply feeds the Microcontroller and the
Bluetooth module.
Advantages:
The Robot is small in size, therefore less space required.
We can access the robot vehicle from the distance of meters as we are using WIFI
for the connection between robot and the server PC.
As we are uscamera which is attach to the robot so it will capture video which will
be used for security.
Low power consumption.
No accident is done by improper driving of people and also available for elderly
and disabled people.
Through our Design and implementation of our proposed system, we are able to achieve the
following as results:
Robot is controlled through voice commands given by the user who is operating
the project.
These voice command needs to be given through an android app which is installed
on the users android mobile.
Speech recognition is done within the android app and then a respective command
is sent to the voicecontrolled robot vehicle.
Microcontroller fitted on the Vehicle decodes these commands and gives
an appropriate command to the motors connected to the vehicle.
.
Conclusion:
The proposed framework of our project shows that how a robot can be control utilizing
Bluetooth. The voice controlling orders are effectively transmitted through Bluetooth
innovation and the desired activities effectively happen. This task lessens human
endeavours at spots or circumstances where human intercessions are troublesome. Such
frameworks can be brought into utilization at spots, for example, businesses, military
and guard, investigate purposes, and so forth.
References:
https://bit.ly/3oSBJi5
https://youtu.be/6kg5rJcFVuA
https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8
&ved=2ahUKEwiUnvv9yK78AhVHzaQKHaGSAoMQFnoECA4QAQ&url=https%3A%2
F%2Fwww.instructables.com%2FROBOT-CAR-Bluetooth-Controlled-Obstacle-
Avoidance-%2F&usg=AOvVaw0gRKwofRZ7IPRWNVZ_0T5M
#include <Servo.h>
#include <AFMotor.h>
// B -//
char value;
int speedCar=255;
boolean lightFront =
false; boolean lightBack =
false; boolean S_light =
false;
// O //
int distance;
int Left;
int Right;
int L = 0;
int R = 0;
int L1 =
0; int R1
= 0;
// Defines //
#define Echo A0
#define Trig A1
#define S_motor 10
#define F_LED A4
#define B_LED A5
#define SL_LED A2
#define SR_LED A3
#define spoint 90
// Motors //
Servo servo;
AF_DCMotor motor1(1);
AF_DCMotor
motor2(2);
AF_DCMotor
motor3(3);
AF_DCMotor
motor4(4);
void setup() {
Serial.begin(9600);
pinMode(Trig,OUTPUT);//Trig A1
pinMode(Echo,INPUT);//Echo A0
pinMode(F_LED,OUTPUT);//F_LED A4 pin
pinMode(B_LED,OUTPUT);//B_LED A5 pin
pinMode(SL_LED,OUTPUT);//SL_LED A2
pin pinMode(SR_LED,OUTPUT);//SR_LED
A3 pin servo.attach(S_motor);
}
void loop() {
// Change_Mode //
//blutooth_mode();
//obstacle_mode();
voice_control();
// Blutooth_Mode //
void blutooth_mode(){
if (Serial.available() > 0)
{ value = Serial.read();
Stop(); //Initialize with motors stopped.
switch (value) {
case 'F':forward();break;
case 'B':backward();break;
case 'L':left();break;
case 'R':right();break;
case 'I':forwardRight();break;
case 'G':forwardLeft();break;
case 'J':backwardRight();break;
case 'H':backwardLeft();break;
case 'S':Stop();break;
case '0':speedCar = 75;break;
case '1':speedCar = 100;break;
case '2':speedCar = 125;break;
case '3':speedCar = 150;break;
case '4':speedCar = 175;break;
case '5':speedCar = 200;break;
case '6':speedCar = 220;break;
case '7':speedCar = 230;break;
case '8':speedCar = 240;break;
case '9':speedCar = 250;break;
case 'q':speedCar = 255;break;
case 'W':lightFront = true;break;
case 'w':lightFront =
false;break; case 'U':lightBack =
true;break; case 'u':lightBack =
false;break; case 'X':S_light =
true;break; case 'x':S_light =
false;break;
}}
// Obstacle_Mode //
void obstacle_mode(){
distance = ultrasonic();
if (distance <= 12) {
Stop();
backward();
delay(100);
Stop();
L = leftsee();
servo.write(spoint);
delay(200);
R = rightsee();
servo.write(spoint);
if (L < R) {
O_right();
delay(200);
Stop();
delay(200);
} else if (L > R) {
O_left();
delay(500);
Stop();
delay(200);
}
} else {
forward();
}
// Voice_Control //
void voice_control(){
if (Serial.available() > 0) {
value = Serial.read();
Serial.println(value);
if (value == '^') {
forward();
digitalWrite(SL_LED, HIGH);
digitalWrite(SR_LED,
HIGH);
} else if (value == '-') {
backward();
} else if (value == '<') {
L = leftsee();
servo.write(spoint);
if (L >= 10 ) {
O_left();
delay(500);
Stop();
} else if (L < 10) {
Stop();
}
} else if (value == '>') {
R = rightsee();
servo.write(spoint);
if (R >= 10 ) {
O_right();
delay(500);
Stop();
} else if (R < 10) {
Stop();
}
} else if (value == '*') {
Stop();
}
} else if (value == '!') {
{digitalWrite(F_LED, HIGH);
}
} else if (value == '@') {
{digitalWrite(F_LED, LOW);
}
} else if (value == '+') {
{digitalWrite(B_LED, HIGH);
}
} else if (value == '_') {
{digitalWrite(B_LED, LOW);
}
}
// Ultrasonic //
int ultrasonic(){
digitalWrite(Trig,LOW);
delayMicroseconds(4);
digitalWrite(Trig,HIGH);
delayMicroseconds(10);
digitalWrite(Trig,LOW);
long t =
pulseIn(Echo,HIGH); long
cm= t / 29/ 2;
return cm;
}
void forward()
{
motor1.run(FORWARD);
motor2.run(FORWARD);
motor3.run(FORWARD);
motor4.run(FORWARD);
motor1.setSpeed(speedCar);
motor2.setSpeed(speedCar);
motor3.setSpeed(speedCar);
motor4.setSpeed(speedCar);
forwardview();
}
void backward()
{
motor1.run(BACKWARD);
motor2.run(BACKWARD);
motor3.run(BACKWARD);
motor4.run(BACKWARD);
motor1.setSpeed(speedCar);
motor2.setSpeed(speedCar);
motor3.setSpeed(speedCar);
motor4.setSpeed(speedCar);
digitalWrite(B_LED,HIGH);
}
void left()
{
motor1.run(BACKWARD);
motor2.run(BACKWARD);
motor3.run(FORWARD);
motor4.run(FORWARD);
motor1.setSpeed(speedCar);
motor2.setSpeed(speedCar);
motor3.setSpeed(speedCar);
motor4.setSpeed(speedCar);
digitalWrite(SL_LED, HIGH);
leftview();
}
void O_left()
{
motor1.run(BACKWARD);
motor2.run(BACKWARD);
motor3.run(FORWARD);
motor4.run(FORWARD);
motor1.setSpeed(speedCar);
motor2.setSpeed(speedCar);
motor3.setSpeed(speedCar);
motor4.setSpeed(speedCar);
digitalWrite(SL_LED, HIGH);
void right()
{
motor1.run(FORWARD);
motor2.run(FORWARD);
motor3.run(BACKWARD);
motor4.run(BACKWARD);
motor1.setSpeed(speedCar);
motor2.setSpeed(speedCar);
motor3.setSpeed(speedCar);
motor4.setSpeed(speedCar);
digitalWrite(SR_LED, HIGH);
rightview();
}
void O_right()
{
motor1.run(FORWARD);
motor2.run(FORWARD);
motor3.run(BACKWARD);
motor4.run(BACKWARD);
motor1.setSpeed(speedCar);
motor2.setSpeed(speedCar);
motor3.setSpeed(speedCar);
motor4.setSpeed(speedCar);
digitalWrite(SR_LED, HIGH);
}
void forwardRight()
{
motor1.run(FORWARD);
motor2.run(FORWARD);
motor3.run(FORWARD);
motor4.run(RELEASE);
motor1.setSpeed(speedCar);
motor2.setSpeed(speedCar);
motor3.setSpeed(speedCar);
}
void forwardLeft()
{
motor1.run(RELEASE);
motor2.run(FORWARD);
motor3.run(FORWARD);
motor4.run(FORWARD);
motor1.setSpeed(speedCar);
motor2.setSpeed(speedCar);
motor4.setSpeed(speedCar);
}
void backwardRight()
{
motor1.run(BACKWARD);
motor2.run(BACKWARD);
motor3.run(RELEASE);
motor4.run(BACKWARD);
motor1.setSpeed(speedCar);
motor2.setSpeed(speedCar);
motor4.setSpeed(speedCar);
digitalWrite(B_LED,HIGH);
}
void backwardLeft()
{
motor1.run(BACKWARD);
motor2.run(RELEASE);
motor3.run(BACKWARD);
motor4.run(BACKWARD);
motor1.setSpeed(speedCar);
motor2.setSpeed(speedCar);
motor3.setSpeed(speedCar);
digitalWrite(B_LED,HIGH);
}
void Stop()
{
motor1.run(RELEASE);
motor2.run(RELEASE);
motor3.run(RELEASE);
motor4.run(RELEASE);
}
int rightsee(){
servo.write(20);
delay(500);
Left = ultrasonic();
return Left;
}
int leftsee(){
servo.write(180);
delay(500);
Right = ultrasonic();
return Right;
}
int leftview(){
servo.write(180);
int rightview(){
servo.write(20);
}
int forwardview(){
servo.write(spoint);
}