SlideShare a Scribd company logo
KIET Group of Institutions
Robotic Car Controlled over
Bluetooth with Obstacle Avoidance
SURYA PRATAP
ECE DEPARTMENT
1900290310175 Ph..7500613027
Introduction
 Robotic is the branch of electrical engineering,
mechanical engineering and computer science that deals
with the design, construction, operation, and application of
robot, as well as computer system for their control, sensory
feedback, and information processing.
 This is a robot car that can be remotely controlled using a
Bluetooth terminal mobile application and has the
capability to avoid the collision with the obstacles.
Hardware Components
 Arduino Uno (1)
 Ultrasonic Sensor-HC-SR04 (1)
 Motor Driver IC-L298N (2)
 Dc Motor (4)
 Bluetooth REES52 HC-05 (1)
 Car Chassis (4)
 12v Rechargeable Battery (1)
 Jumper Wires Male Female (30)
 Switch (2)
 Passive Buzzer (1)
 Red and Blue LED (5)
 Charging Female Switch (1)
 Resistance 220ohm (5)
 Diode (2)
Arduino Uno
The Arduino Uno is a microcontroller board based on the ATmega328 (datasheet). It has
14 digital input/output pins (of which 6 can be used as PWM), 6 analog inputs, a 16
MHz ceramic resonator , dc current per I/O 40mA, flash memory 32Kb, clock speed
16MHz. It also has 2KB of SRAM and 1 KB of EEPROM.
The board can operate on an external supply of 6 to 20 volts. If supplied with
less than 7V, however, the 5V pin may supply less than 5V and the board may be
unstable. If using more than 12V, the voltage regulator may overheat and damage the
board. The recommended range is 7 to 12V.
Ultrasonic Sensor
The Ultrasonic sensor works on the same principles as a radar
system. It can convert electrical energy into acoustic wave and
vice versa. The acoustic wave signal is an ultrasonic wave
traveling at a frequency above 40kHz. It has working voltage 5V,
working current 15mA, Max range 4m and Min range 2cm ,
Measuring angle 15 degree.
L298N Motor Driver
This L298N Motor Driver is a high power motor driver for
driving DC and Stepper motors. This module consists of
an L298 motor driver IC and a 78M05 5V regulator,
resistors, capacitor, Power LED.
We can apply Input voltage 3.2V-40Vdc in this module. It
has Power supply 5V-35V, and peak current 2amp,
operating current range 0-36mA.
Bluetooth HC-05
Bluetooth Communication is a 2.4GHz frequency based RF Communication with a range of
approximately 10 meters. It is one of the most popular and most frequently used low range
communication for data transfer. It come with sex pins namely: VCC, GND, TX, RX, EN and
STATE. This module works on a logic level of 3.3V regulator is used on the board.
HC-05 module has Baud rate: 9600 with 8 data bits, no parity and 1 stop bit.
Module can be configured in two modes of operation:
 In Command Mode, At commands for configuring various settings and parameter of
the module like get firmware information, change UART baud rate , set it as either
master or slave.
 In Data Mode, In this mode, the module is used for communication with other
Bluetooth device example data transfer happens in this mode.
Circuit Diagram
AssemblingThe Part
Assembling the Chassis Wire ConnectionsSoldering
Ready For Uploading the Code
#define light_FR 14 //LED Front Right pin A0 for Arduino Uno
#define light_FL 15 //LED Front Left pin A1 for Arduino Uno
#define light_BR 16 //LED Back Right pin A2 for Arduino Uno
//#define light_BL 17 LED Back Left pin A3 for Arduino Uno
#define horn_Buzz 18 //Horn Buzzer pin A4 for Arduino Uno
#define ENA_m1 5 // Enable/speed motor Front Right
#define ENB_m1 6 // Enable/speed motor Back Right
#define ENA_m2 10 // Enable/speed motor Front Left
#define ENB_m2 11 // Enable/speed motor Back Left
#define IN_11 2 // L298N #1 in 1 motor Front Right
#define IN_12 3 // L298N #1 in 2 motor Front Right
#define IN_13 4 // L298N #1 in 3 motor Back Right
#define IN_14 7 // L298N #1 in 4 motor Back Right
#define IN_21 8 // L298N #2 in 1 motor Front Left
#define IN_22 9 // L298N #2 in 2 motor Front Left
#define IN_23 12 // L298N #2 in 3 motor Back Left
#define IN_24 13 // L298N #2 in 4 motor Back Left
Arduino Code
int command; //Int to store app command
state.
int speedCar = 100;
int speedCarM = 95;// 50 - 255.
int speed_Coeff = 4;
const int trigPin = A5;
const int echoPin = A3;
// defines variables
long duration;
int distance;
int safetyDistance;
boolean lightFront = false;
boolean lightBack = false;
boolean horn = false;
void setup() {
pinMode(light_FR, OUTPUT);
pinMode(light_FL, OUTPUT);
pinMode(light_BR, OUTPUT);
pinMode(light_BR, OUTPUT);
pinMode(horn_Buzz, OUTPUT);
pinMode(ENA_m1, OUTPUT);
pinMode(ENB_m1, OUTPUT);
pinMode(ENA_m2, OUTPUT);
pinMode(ENB_m2, OUTPUT);
pinMode(IN_11, OUTPUT);
pinMode(IN_12, OUTPUT);
pinMode(IN_13, OUTPUT);
pinMode(IN_14, OUTPUT);
pinMode(IN_21, OUTPUT);
pinMode(IN_22, OUTPUT);
pinMode(IN_23, OUTPUT);
pinMode(IN_24, OUTPUT);
pinMode(trigPin, OUTPUT); // Sets the
trigPin as an Output
pinMode(echoPin, INPUT); // Sets the
echoPin as an Input
Serial.begin(9600);
}
void goAhead(){
digitalWrite(IN_11, HIGH);
digitalWrite(IN_12, LOW);
analogWrite(ENA_m1, speedCar);
digitalWrite(IN_13, LOW);
digitalWrite(IN_14, HIGH);
analogWrite(ENB_m1, speedCar);
digitalWrite(IN_21, LOW);
digitalWrite(IN_22, HIGH);
analogWrite(ENA_m2, speedCar);
digitalWrite(IN_23, HIGH);
digitalWrite(IN_24, LOW);
analogWrite(ENB_m2, speedCar);
}
void goBack(){
digitalWrite(IN_11, LOW);
digitalWrite(IN_12, HIGH);
analogWrite(ENA_m1, speedCar);
digitalWrite(IN_13, HIGH);
digitalWrite(IN_14, LOW);
analogWrite(ENB_m1, speedCar);
digitalWrite(IN_21, HIGH);
digitalWrite(IN_22, LOW);
analogWrite(ENA_m2, speedCar);
digitalWrite(IN_23, LOW);
digitalWrite(IN_24, HIGH);
analogWrite(ENB_m2, speedCar);
}
void goBackM(){
digitalWrite(IN_11, LOW);
digitalWrite(IN_12, HIGH);
analogWrite(ENA_m1, speedCarM);
digitalWrite(IN_13, HIGH);
digitalWrite(IN_14, LOW);
analogWrite(ENB_m1, speedCarM);
digitalWrite(IN_21, HIGH);
digitalWrite(IN_22, LOW);
analogWrite(ENA_m2, speedCarM);
digitalWrite(IN_23, LOW);
digitalWrite(IN_24, HIGH);
analogWrite(ENB_m2, speedCarM);
}
void goRight(){
digitalWrite(IN_11, LOW);
digitalWrite(IN_12, HIGH);
analogWrite(ENA_m1, speedCar);
digitalWrite(IN_13, HIGH);
digitalWrite(IN_14, LOW);
analogWrite(ENB_m1, speedCar);
digitalWrite(IN_21, LOW);
digitalWrite(IN_22, HIGH);
analogWrite(ENA_m2, speedCar);
digitalWrite(IN_23, HIGH);
digitalWrite(IN_24, LOW);
analogWrite(ENB_m2, speedCar);
}
void goLeft(){
digitalWrite(IN_11, HIGH);
digitalWrite(IN_12, LOW);
analogWrite(ENA_m1, speedCar);
digitalWrite(IN_13, LOW);
digitalWrite(IN_14, HIGH);
analogWrite(ENB_m1, speedCar);
digitalWrite(IN_21, HIGH);
digitalWrite(IN_22, LOW);
analogWrite(ENA_m2, speedCar);
digitalWrite(IN_23, LOW);
digitalWrite(IN_24, HIGH);
analogWrite(ENB_m2, speedCar);
}
void goAheadRight(){
digitalWrite(IN_11, HIGH);
digitalWrite(IN_12, LOW);
analogWrite(ENA_m1, speedCar/speed_Coeff);
digitalWrite(IN_13, LOW);
digitalWrite(IN_14, HIGH);
analogWrite(ENB_m1, speedCar/speed_Coeff);
digitalWrite(IN_21, LOW);
digitalWrite(IN_22, HIGH);
analogWrite(ENA_m2, speedCar);
digitalWrite(IN_23, HIGH);
digitalWrite(IN_24, LOW);
analogWrite(ENB_m2, speedCar);
}
void goAheadLeft(){
digitalWrite(IN_11, HIGH);
digitalWrite(IN_12, LOW);
analogWrite(ENA_m1, speedCar);
digitalWrite(IN_13, LOW);
digitalWrite(IN_14, HIGH);
analogWrite(ENB_m1, speedCar);
digitalWrite(IN_21, LOW);
digitalWrite(IN_22, HIGH);
analogWrite(ENA_m2, speedCar/speed_Coeff);
digitalWrite(IN_23, HIGH);
digitalWrite(IN_24, LOW);
analogWrite(ENB_m2, speedCar/speed_Coeff);
}
void goBackRight(){
digitalWrite(IN_11, LOW);
digitalWrite(IN_12, HIGH);
analogWrite(ENA_m1, speedCar/speed_Coeff);
digitalWrite(IN_13, HIGH);
digitalWrite(IN_14, LOW);
analogWrite(ENB_m1, speedCar/speed_Coeff);
digitalWrite(IN_21, HIGH);
digitalWrite(IN_22, LOW);
analogWrite(ENA_m2, speedCar);
digitalWrite(IN_23, LOW);
digitalWrite(IN_24, HIGH);
analogWrite(ENB_m2, speedCar);
}
void goBackLeft(){
digitalWrite(IN_11, LOW);
digitalWrite(IN_12, HIGH);
analogWrite(ENA_m1, speedCar);
digitalWrite(IN_13, HIGH);
digitalWrite(IN_14, LOW);
analogWrite(ENB_m1, speedCar);
digitalWrite(IN_21, HIGH);
digitalWrite(IN_22, LOW);
analogWrite(ENA_m2, speedCar/speed_Coeff);
digitalWrite(IN_23, LOW);
digitalWrite(IN_24, HIGH);
analogWrite(ENB_m2, speedCar/speed_Coeff);
}
void stopRobot(){
digitalWrite(IN_11, LOW);
digitalWrite(IN_12, LOW);
analogWrite(ENA_m1, speedCar);
digitalWrite(IN_13, LOW);
digitalWrite(IN_14, LOW);
analogWrite(ENB_m1, speedCar);
digitalWrite(IN_21, LOW);
digitalWrite(IN_22, LOW);
analogWrite(ENA_m2, speedCar);
digitalWrite(IN_23, LOW);
digitalWrite(IN_24, LOW);
analogWrite(ENB_m2, speedCar);
}
void loop(){
// Clears the trigPin
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
// Sets the trigPin on HIGH state for 10 micro
seconds
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
// Reads the echoPin, returns the sound wave travel
time in microseconds
duration = pulseIn(echoPin, HIGH);
// Calculating the distance
distance= duration*0.034/2;
safetyDistance = distance;
if (Serial.available() > 0) {
command = Serial.read();
stopRobot(); //Initialize with motors stopped.
if (lightFront) {digitalWrite(light_FR, HIGH);
digitalWrite(light_FL, HIGH);}
if (!lightFront) {digitalWrite(light_FR, LOW);
digitalWrite(light_FL, LOW);}
if (lightBack) {digitalWrite(light_BR, HIGH);
digitalWrite(light_BR, HIGH);}
if (!lightBack) {digitalWrite(light_BR, LOW);
digitalWrite(light_BR, LOW);}
if (horn) {digitalWrite(horn_Buzz, HIGH);}
if (!horn) {digitalWrite(horn_Buzz, LOW);}
if (safetyDistance <= 20){
digitalWrite(light_BR, HIGH);
digitalWrite(horn_Buzz, HIGH);
delay(500);
goBackM();
delay(750);
}
else{
switch (command) {
case 'F':goAhead();break;
case 'B':goBack();break;
case 'L':goLeft();break ;
case 'R':goRight();break;
case 'I':goAheadRight();break;
case 'G':goAheadLeft();break;
case 'J':goBackRight();break;
case 'H':goBackLeft();break;
case '0':speedCar = 100;break;
case '1':speedCar = 115;break;
case '2':speedCar = 130;break;
case '3':speedCar = 145;break;
case '4':speedCar = 160;break;
case '5':speedCar = 175;break;
case '6':speedCar = 190;break;
case '7':speedCar = 205;break;
case '8':speedCar = 220;break;
case '9':speedCar = 235;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 'V':horn = true;break;
case 'v':horn = false;break;
}
}
}
}
Android Application
Forward
Backward
Front Light Back Light Horn Acceleratio
Right
Left
https://www.pdfdrive.com/beginning-c-for-arduino-learn-c-programming-for-
the-arduino-e156890686.html
https://www.instructables.com/ROBOT-CAR-Bluetooth-
Controlled-Obstacle-Avoidance-/
https://www.arduino.cc/
https://www.youtube.com/watch?v=fJWR7dBu
c18&list=PLGs0VKk2DiYw-L-RibttcvK-
WBZm8WLEP
Books:
Arduino Links:
https://www.pdfdrive.com/arduino-programming-with-net-and-sketch-
e40130578.html
Reference
MOOC Course 1
MOOC Course 2
THANK
YOU

More Related Content

What's hot

Advanced motion controls dr101ee15a40ldc
Advanced motion controls dr101ee15a40ldcAdvanced motion controls dr101ee15a40ldc
Advanced motion controls dr101ee15a40ldc
Electromate
 
CHART FOR PROJECT
CHART FOR PROJECTCHART FOR PROJECT
CHART FOR PROJECT
Debahuti Bhattacharya
 
Interfacing Bluetooth Modules with 8051 Microcontroller
Interfacing Bluetooth Modules with 8051 MicrocontrollerInterfacing Bluetooth Modules with 8051 Microcontroller
Interfacing Bluetooth Modules with 8051 Microcontroller
Pantech ProLabs India Pvt Ltd
 
Advanced motion controls dr101ee30a40ldc
Advanced motion controls dr101ee30a40ldcAdvanced motion controls dr101ee30a40ldc
Advanced motion controls dr101ee30a40ldc
Electromate
 
ARM COMPLETE DETAIL PART 4
ARM COMPLETE DETAIL PART 4ARM COMPLETE DETAIL PART 4
ARM COMPLETE DETAIL PART 4
NOWAY
 
Advanced motion controls dq112ee15a40ldc
Advanced motion controls dq112ee15a40ldcAdvanced motion controls dq112ee15a40ldc
Advanced motion controls dq112ee15a40ldc
Electromate
 
Ppt
PptPpt
Advanced motion controls dq111ee40a8bdc
Advanced motion controls dq111ee40a8bdcAdvanced motion controls dq111ee40a8bdc
Advanced motion controls dq111ee40a8bdc
Electromate
 
Advanced motion controls dq111ee30a40ldc
Advanced motion controls dq111ee30a40ldcAdvanced motion controls dq111ee30a40ldc
Advanced motion controls dq111ee30a40ldc
Electromate
 
Touch Switch (Smart Switches) by arduino Project report file
Touch Switch (Smart Switches) by arduino  Project  report fileTouch Switch (Smart Switches) by arduino  Project  report file
Touch Switch (Smart Switches) by arduino Project report file
imkanhaiyalal
 
Advanced motion controls dq111se40a8bdc h
Advanced motion controls dq111se40a8bdc hAdvanced motion controls dq111se40a8bdc h
Advanced motion controls dq111se40a8bdc h
Electromate
 
An Introduction to Robotics and Embedded System
An Introduction to Robotics and Embedded SystemAn Introduction to Robotics and Embedded System
An Introduction to Robotics and Embedded System
Peeyush Sahu CAPM®
 
RoboticCarKit_MANUAL
RoboticCarKit_MANUALRoboticCarKit_MANUAL
RoboticCarKit_MANUAL
Elijah Barner
 
VIPA SLIO Introduction
VIPA SLIO IntroductionVIPA SLIO Introduction
VIPA SLIO Introduction
Jimmy Hsu
 
Bluetooth controlled robot
Bluetooth controlled robotBluetooth controlled robot
Bluetooth controlled robot
UVSofts Technologies
 
Advanced motion controls dq111ee20a8bdc qd1
Advanced motion controls dq111ee20a8bdc qd1Advanced motion controls dq111ee20a8bdc qd1
Advanced motion controls dq111ee20a8bdc qd1
Electromate
 
PM16 Technical Specification 20022013
PM16 Technical Specification 20022013PM16 Technical Specification 20022013
PM16 Technical Specification 20022013
Rimsky Cheng
 
Meier_ECET365_Manual_LI
Meier_ECET365_Manual_LIMeier_ECET365_Manual_LI
Meier_ECET365_Manual_LI
jmeier72
 
OPAL-RT RT14: New hardware presentation
OPAL-RT RT14: New hardware presentationOPAL-RT RT14: New hardware presentation
OPAL-RT RT14: New hardware presentation
OPAL-RT TECHNOLOGIES
 
Advanced motion controls mc1xdzpc01
Advanced motion controls mc1xdzpc01Advanced motion controls mc1xdzpc01
Advanced motion controls mc1xdzpc01
Electromate
 

What's hot (20)

Advanced motion controls dr101ee15a40ldc
Advanced motion controls dr101ee15a40ldcAdvanced motion controls dr101ee15a40ldc
Advanced motion controls dr101ee15a40ldc
 
CHART FOR PROJECT
CHART FOR PROJECTCHART FOR PROJECT
CHART FOR PROJECT
 
Interfacing Bluetooth Modules with 8051 Microcontroller
Interfacing Bluetooth Modules with 8051 MicrocontrollerInterfacing Bluetooth Modules with 8051 Microcontroller
Interfacing Bluetooth Modules with 8051 Microcontroller
 
Advanced motion controls dr101ee30a40ldc
Advanced motion controls dr101ee30a40ldcAdvanced motion controls dr101ee30a40ldc
Advanced motion controls dr101ee30a40ldc
 
ARM COMPLETE DETAIL PART 4
ARM COMPLETE DETAIL PART 4ARM COMPLETE DETAIL PART 4
ARM COMPLETE DETAIL PART 4
 
Advanced motion controls dq112ee15a40ldc
Advanced motion controls dq112ee15a40ldcAdvanced motion controls dq112ee15a40ldc
Advanced motion controls dq112ee15a40ldc
 
Ppt
PptPpt
Ppt
 
Advanced motion controls dq111ee40a8bdc
Advanced motion controls dq111ee40a8bdcAdvanced motion controls dq111ee40a8bdc
Advanced motion controls dq111ee40a8bdc
 
Advanced motion controls dq111ee30a40ldc
Advanced motion controls dq111ee30a40ldcAdvanced motion controls dq111ee30a40ldc
Advanced motion controls dq111ee30a40ldc
 
Touch Switch (Smart Switches) by arduino Project report file
Touch Switch (Smart Switches) by arduino  Project  report fileTouch Switch (Smart Switches) by arduino  Project  report file
Touch Switch (Smart Switches) by arduino Project report file
 
Advanced motion controls dq111se40a8bdc h
Advanced motion controls dq111se40a8bdc hAdvanced motion controls dq111se40a8bdc h
Advanced motion controls dq111se40a8bdc h
 
An Introduction to Robotics and Embedded System
An Introduction to Robotics and Embedded SystemAn Introduction to Robotics and Embedded System
An Introduction to Robotics and Embedded System
 
RoboticCarKit_MANUAL
RoboticCarKit_MANUALRoboticCarKit_MANUAL
RoboticCarKit_MANUAL
 
VIPA SLIO Introduction
VIPA SLIO IntroductionVIPA SLIO Introduction
VIPA SLIO Introduction
 
Bluetooth controlled robot
Bluetooth controlled robotBluetooth controlled robot
Bluetooth controlled robot
 
Advanced motion controls dq111ee20a8bdc qd1
Advanced motion controls dq111ee20a8bdc qd1Advanced motion controls dq111ee20a8bdc qd1
Advanced motion controls dq111ee20a8bdc qd1
 
PM16 Technical Specification 20022013
PM16 Technical Specification 20022013PM16 Technical Specification 20022013
PM16 Technical Specification 20022013
 
Meier_ECET365_Manual_LI
Meier_ECET365_Manual_LIMeier_ECET365_Manual_LI
Meier_ECET365_Manual_LI
 
OPAL-RT RT14: New hardware presentation
OPAL-RT RT14: New hardware presentationOPAL-RT RT14: New hardware presentation
OPAL-RT RT14: New hardware presentation
 
Advanced motion controls mc1xdzpc01
Advanced motion controls mc1xdzpc01Advanced motion controls mc1xdzpc01
Advanced motion controls mc1xdzpc01
 

Similar to Robotic Car Controlled over Bluetooth with Obstacle Avoidance

Obstacle detection Robot using Ultrasonic Sensor and Arduino UNO
Obstacle detection Robot using Ultrasonic Sensor and Arduino UNOObstacle detection Robot using Ultrasonic Sensor and Arduino UNO
Obstacle detection Robot using Ultrasonic Sensor and Arduino UNO
Sanjay Kumar
 
Design and Development of a prototype of AGV
Design and Development of a prototype of AGVDesign and Development of a prototype of AGV
Design and Development of a prototype of AGV
KUNJBIHARISINGH5
 
Arduino Based Collision Prevention Warning System
Arduino Based Collision Prevention Warning SystemArduino Based Collision Prevention Warning System
Arduino Based Collision Prevention Warning System
Madhav Reddy Chintapalli
 
Obstacle avoiding Robot
Obstacle avoiding RobotObstacle avoiding Robot
Obstacle avoiding Robot
Rasheed Khan
 
Arduino Programming Basic
Arduino Programming BasicArduino Programming Basic
Aircraft Anti collision system using ZIGBEE Communication
Aircraft Anti collision system using ZIGBEE CommunicationAircraft Anti collision system using ZIGBEE Communication
Aircraft Anti collision system using ZIGBEE Communication
PavanKalyan314
 
Arduino windows remote control
Arduino windows remote controlArduino windows remote control
Arduino windows remote control
VilayatAli5
 
WIRELESS GESTURED CONTROLLED ROBOT USING ACCELEROMETER
WIRELESS GESTURED CONTROLLED ROBOT USING ACCELEROMETERWIRELESS GESTURED CONTROLLED ROBOT USING ACCELEROMETER
WIRELESS GESTURED CONTROLLED ROBOT USING ACCELEROMETER
LOKENDAR KUMAR
 
438050190-presentation-for-arduino-driven-bluetooth-rc-cr.pptx
438050190-presentation-for-arduino-driven-bluetooth-rc-cr.pptx438050190-presentation-for-arduino-driven-bluetooth-rc-cr.pptx
438050190-presentation-for-arduino-driven-bluetooth-rc-cr.pptx
VenuVenupk1431
 
Remote Operated Spy Robot Circuit
Remote Operated Spy Robot CircuitRemote Operated Spy Robot Circuit
Remote Operated Spy Robot Circuit
laibaNoor60
 
Gesture Robot car.pptx
Gesture Robot car.pptxGesture Robot car.pptx
Gesture Robot car.pptx
KevinMichaelRajBPSGC
 
Touchpad Monitored Car
Touchpad Monitored CarTouchpad Monitored Car
Touchpad Monitored Car
IOSR Journals
 
Touchpad Monitored Car
Touchpad Monitored Car Touchpad Monitored Car
Touchpad Monitored Car
IOSR Journals
 
Fire Fighting Robot
Fire Fighting RobotFire Fighting Robot
Fire Fighting Robot
Saadullah74
 
Bluetooth controled robot
Bluetooth controled robotBluetooth controled robot
Bluetooth controled robot
Stuart Stuart
 
IRJET- Automated Elevator-An Attentive Elevator to Elevate using Speech Recog...
IRJET- Automated Elevator-An Attentive Elevator to Elevate using Speech Recog...IRJET- Automated Elevator-An Attentive Elevator to Elevate using Speech Recog...
IRJET- Automated Elevator-An Attentive Elevator to Elevate using Speech Recog...
IRJET Journal
 
QuickSilver Controls QCI-DS018 QCI-D2-IG8
QuickSilver Controls QCI-DS018 QCI-D2-IG8QuickSilver Controls QCI-DS018 QCI-D2-IG8
QuickSilver Controls QCI-DS018 QCI-D2-IG8
Electromate
 
IRJET- Intelligent Security and Monitoring System for Vehicle
IRJET- Intelligent Security and Monitoring System for VehicleIRJET- Intelligent Security and Monitoring System for Vehicle
IRJET- Intelligent Security and Monitoring System for Vehicle
IRJET Journal
 
Office automation system using arduino
Office automation system using arduinoOffice automation system using arduino
Office automation system using arduino
Ashfaqul Haque John
 
Contactless digital tachometer using microcontroller
Contactless digital tachometer using microcontroller Contactless digital tachometer using microcontroller
Contactless digital tachometer using microcontroller
IJECEIAES
 

Similar to Robotic Car Controlled over Bluetooth with Obstacle Avoidance (20)

Obstacle detection Robot using Ultrasonic Sensor and Arduino UNO
Obstacle detection Robot using Ultrasonic Sensor and Arduino UNOObstacle detection Robot using Ultrasonic Sensor and Arduino UNO
Obstacle detection Robot using Ultrasonic Sensor and Arduino UNO
 
Design and Development of a prototype of AGV
Design and Development of a prototype of AGVDesign and Development of a prototype of AGV
Design and Development of a prototype of AGV
 
Arduino Based Collision Prevention Warning System
Arduino Based Collision Prevention Warning SystemArduino Based Collision Prevention Warning System
Arduino Based Collision Prevention Warning System
 
Obstacle avoiding Robot
Obstacle avoiding RobotObstacle avoiding Robot
Obstacle avoiding Robot
 
Arduino Programming Basic
Arduino Programming BasicArduino Programming Basic
Arduino Programming Basic
 
Aircraft Anti collision system using ZIGBEE Communication
Aircraft Anti collision system using ZIGBEE CommunicationAircraft Anti collision system using ZIGBEE Communication
Aircraft Anti collision system using ZIGBEE Communication
 
Arduino windows remote control
Arduino windows remote controlArduino windows remote control
Arduino windows remote control
 
WIRELESS GESTURED CONTROLLED ROBOT USING ACCELEROMETER
WIRELESS GESTURED CONTROLLED ROBOT USING ACCELEROMETERWIRELESS GESTURED CONTROLLED ROBOT USING ACCELEROMETER
WIRELESS GESTURED CONTROLLED ROBOT USING ACCELEROMETER
 
438050190-presentation-for-arduino-driven-bluetooth-rc-cr.pptx
438050190-presentation-for-arduino-driven-bluetooth-rc-cr.pptx438050190-presentation-for-arduino-driven-bluetooth-rc-cr.pptx
438050190-presentation-for-arduino-driven-bluetooth-rc-cr.pptx
 
Remote Operated Spy Robot Circuit
Remote Operated Spy Robot CircuitRemote Operated Spy Robot Circuit
Remote Operated Spy Robot Circuit
 
Gesture Robot car.pptx
Gesture Robot car.pptxGesture Robot car.pptx
Gesture Robot car.pptx
 
Touchpad Monitored Car
Touchpad Monitored CarTouchpad Monitored Car
Touchpad Monitored Car
 
Touchpad Monitored Car
Touchpad Monitored Car Touchpad Monitored Car
Touchpad Monitored Car
 
Fire Fighting Robot
Fire Fighting RobotFire Fighting Robot
Fire Fighting Robot
 
Bluetooth controled robot
Bluetooth controled robotBluetooth controled robot
Bluetooth controled robot
 
IRJET- Automated Elevator-An Attentive Elevator to Elevate using Speech Recog...
IRJET- Automated Elevator-An Attentive Elevator to Elevate using Speech Recog...IRJET- Automated Elevator-An Attentive Elevator to Elevate using Speech Recog...
IRJET- Automated Elevator-An Attentive Elevator to Elevate using Speech Recog...
 
QuickSilver Controls QCI-DS018 QCI-D2-IG8
QuickSilver Controls QCI-DS018 QCI-D2-IG8QuickSilver Controls QCI-DS018 QCI-D2-IG8
QuickSilver Controls QCI-DS018 QCI-D2-IG8
 
IRJET- Intelligent Security and Monitoring System for Vehicle
IRJET- Intelligent Security and Monitoring System for VehicleIRJET- Intelligent Security and Monitoring System for Vehicle
IRJET- Intelligent Security and Monitoring System for Vehicle
 
Office automation system using arduino
Office automation system using arduinoOffice automation system using arduino
Office automation system using arduino
 
Contactless digital tachometer using microcontroller
Contactless digital tachometer using microcontroller Contactless digital tachometer using microcontroller
Contactless digital tachometer using microcontroller
 

Recently uploaded

UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICSUNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
vmspraneeth
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
uqyfuc
 
openshift technical overview - Flow of openshift containerisatoin
openshift technical overview - Flow of openshift containerisatoinopenshift technical overview - Flow of openshift containerisatoin
openshift technical overview - Flow of openshift containerisatoin
snaprevwdev
 
smart pill dispenser is designed to improve medication adherence and safety f...
smart pill dispenser is designed to improve medication adherence and safety f...smart pill dispenser is designed to improve medication adherence and safety f...
smart pill dispenser is designed to improve medication adherence and safety f...
um7474492
 
Blood finder application project report (1).pdf
Blood finder application project report (1).pdfBlood finder application project report (1).pdf
Blood finder application project report (1).pdf
Kamal Acharya
 
Levelised Cost of Hydrogen (LCOH) Calculator Manual
Levelised Cost of Hydrogen  (LCOH) Calculator ManualLevelised Cost of Hydrogen  (LCOH) Calculator Manual
Levelised Cost of Hydrogen (LCOH) Calculator Manual
Massimo Talia
 
P5 Working Drawings.pdf floor plan, civil
P5 Working Drawings.pdf floor plan, civilP5 Working Drawings.pdf floor plan, civil
P5 Working Drawings.pdf floor plan, civil
AnasAhmadNoor
 
OOPS_Lab_Manual - programs using C++ programming language
OOPS_Lab_Manual - programs using C++ programming languageOOPS_Lab_Manual - programs using C++ programming language
OOPS_Lab_Manual - programs using C++ programming language
PreethaV16
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
ijaia
 
Impartiality as per ISO /IEC 17025:2017 Standard
Impartiality as per ISO /IEC 17025:2017 StandardImpartiality as per ISO /IEC 17025:2017 Standard
Impartiality as per ISO /IEC 17025:2017 Standard
MuhammadJazib15
 
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
DharmaBanothu
 
FULL STACK PROGRAMMING - Both Front End and Back End
FULL STACK PROGRAMMING - Both Front End and Back EndFULL STACK PROGRAMMING - Both Front End and Back End
FULL STACK PROGRAMMING - Both Front End and Back End
PreethaV16
 
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
sydezfe
 
5G Radio Network Througput Problem Analysis HCIA.pdf
5G Radio Network Througput Problem Analysis HCIA.pdf5G Radio Network Througput Problem Analysis HCIA.pdf
5G Radio Network Througput Problem Analysis HCIA.pdf
AlvianRamadhani5
 
Object Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOADObject Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOAD
PreethaV16
 
Assistant Engineer (Chemical) Interview Questions.pdf
Assistant Engineer (Chemical) Interview Questions.pdfAssistant Engineer (Chemical) Interview Questions.pdf
Assistant Engineer (Chemical) Interview Questions.pdf
Seetal Daas
 
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Transcat
 
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdfAsymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
felixwold
 
Null Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAMNull Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAM
Divyanshu
 
Open Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surfaceOpen Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surface
Indrajeet sahu
 

Recently uploaded (20)

UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICSUNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
 
openshift technical overview - Flow of openshift containerisatoin
openshift technical overview - Flow of openshift containerisatoinopenshift technical overview - Flow of openshift containerisatoin
openshift technical overview - Flow of openshift containerisatoin
 
smart pill dispenser is designed to improve medication adherence and safety f...
smart pill dispenser is designed to improve medication adherence and safety f...smart pill dispenser is designed to improve medication adherence and safety f...
smart pill dispenser is designed to improve medication adherence and safety f...
 
Blood finder application project report (1).pdf
Blood finder application project report (1).pdfBlood finder application project report (1).pdf
Blood finder application project report (1).pdf
 
Levelised Cost of Hydrogen (LCOH) Calculator Manual
Levelised Cost of Hydrogen  (LCOH) Calculator ManualLevelised Cost of Hydrogen  (LCOH) Calculator Manual
Levelised Cost of Hydrogen (LCOH) Calculator Manual
 
P5 Working Drawings.pdf floor plan, civil
P5 Working Drawings.pdf floor plan, civilP5 Working Drawings.pdf floor plan, civil
P5 Working Drawings.pdf floor plan, civil
 
OOPS_Lab_Manual - programs using C++ programming language
OOPS_Lab_Manual - programs using C++ programming languageOOPS_Lab_Manual - programs using C++ programming language
OOPS_Lab_Manual - programs using C++ programming language
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
 
Impartiality as per ISO /IEC 17025:2017 Standard
Impartiality as per ISO /IEC 17025:2017 StandardImpartiality as per ISO /IEC 17025:2017 Standard
Impartiality as per ISO /IEC 17025:2017 Standard
 
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
A high-Speed Communication System is based on the Design of a Bi-NoC Router, ...
 
FULL STACK PROGRAMMING - Both Front End and Back End
FULL STACK PROGRAMMING - Both Front End and Back EndFULL STACK PROGRAMMING - Both Front End and Back End
FULL STACK PROGRAMMING - Both Front End and Back End
 
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
一比一原版(uoft毕业证书)加拿大多伦多大学毕业证如何办理
 
5G Radio Network Througput Problem Analysis HCIA.pdf
5G Radio Network Througput Problem Analysis HCIA.pdf5G Radio Network Througput Problem Analysis HCIA.pdf
5G Radio Network Througput Problem Analysis HCIA.pdf
 
Object Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOADObject Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOAD
 
Assistant Engineer (Chemical) Interview Questions.pdf
Assistant Engineer (Chemical) Interview Questions.pdfAssistant Engineer (Chemical) Interview Questions.pdf
Assistant Engineer (Chemical) Interview Questions.pdf
 
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
 
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdfAsymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
 
Null Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAMNull Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAM
 
Open Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surfaceOpen Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surface
 

Robotic Car Controlled over Bluetooth with Obstacle Avoidance

  • 1. KIET Group of Institutions Robotic Car Controlled over Bluetooth with Obstacle Avoidance SURYA PRATAP ECE DEPARTMENT 1900290310175 Ph..7500613027
  • 2. Introduction  Robotic is the branch of electrical engineering, mechanical engineering and computer science that deals with the design, construction, operation, and application of robot, as well as computer system for their control, sensory feedback, and information processing.  This is a robot car that can be remotely controlled using a Bluetooth terminal mobile application and has the capability to avoid the collision with the obstacles.
  • 3. Hardware Components  Arduino Uno (1)  Ultrasonic Sensor-HC-SR04 (1)  Motor Driver IC-L298N (2)  Dc Motor (4)  Bluetooth REES52 HC-05 (1)  Car Chassis (4)  12v Rechargeable Battery (1)  Jumper Wires Male Female (30)  Switch (2)  Passive Buzzer (1)  Red and Blue LED (5)  Charging Female Switch (1)  Resistance 220ohm (5)  Diode (2)
  • 4. Arduino Uno The Arduino Uno is a microcontroller board based on the ATmega328 (datasheet). It has 14 digital input/output pins (of which 6 can be used as PWM), 6 analog inputs, a 16 MHz ceramic resonator , dc current per I/O 40mA, flash memory 32Kb, clock speed 16MHz. It also has 2KB of SRAM and 1 KB of EEPROM. The board can operate on an external supply of 6 to 20 volts. If supplied with less than 7V, however, the 5V pin may supply less than 5V and the board may be unstable. If using more than 12V, the voltage regulator may overheat and damage the board. The recommended range is 7 to 12V.
  • 5. Ultrasonic Sensor The Ultrasonic sensor works on the same principles as a radar system. It can convert electrical energy into acoustic wave and vice versa. The acoustic wave signal is an ultrasonic wave traveling at a frequency above 40kHz. It has working voltage 5V, working current 15mA, Max range 4m and Min range 2cm , Measuring angle 15 degree. L298N Motor Driver This L298N Motor Driver is a high power motor driver for driving DC and Stepper motors. This module consists of an L298 motor driver IC and a 78M05 5V regulator, resistors, capacitor, Power LED. We can apply Input voltage 3.2V-40Vdc in this module. It has Power supply 5V-35V, and peak current 2amp, operating current range 0-36mA.
  • 6. Bluetooth HC-05 Bluetooth Communication is a 2.4GHz frequency based RF Communication with a range of approximately 10 meters. It is one of the most popular and most frequently used low range communication for data transfer. It come with sex pins namely: VCC, GND, TX, RX, EN and STATE. This module works on a logic level of 3.3V regulator is used on the board. HC-05 module has Baud rate: 9600 with 8 data bits, no parity and 1 stop bit. Module can be configured in two modes of operation:  In Command Mode, At commands for configuring various settings and parameter of the module like get firmware information, change UART baud rate , set it as either master or slave.  In Data Mode, In this mode, the module is used for communication with other Bluetooth device example data transfer happens in this mode.
  • 8. AssemblingThe Part Assembling the Chassis Wire ConnectionsSoldering Ready For Uploading the Code
  • 9. #define light_FR 14 //LED Front Right pin A0 for Arduino Uno #define light_FL 15 //LED Front Left pin A1 for Arduino Uno #define light_BR 16 //LED Back Right pin A2 for Arduino Uno //#define light_BL 17 LED Back Left pin A3 for Arduino Uno #define horn_Buzz 18 //Horn Buzzer pin A4 for Arduino Uno #define ENA_m1 5 // Enable/speed motor Front Right #define ENB_m1 6 // Enable/speed motor Back Right #define ENA_m2 10 // Enable/speed motor Front Left #define ENB_m2 11 // Enable/speed motor Back Left #define IN_11 2 // L298N #1 in 1 motor Front Right #define IN_12 3 // L298N #1 in 2 motor Front Right #define IN_13 4 // L298N #1 in 3 motor Back Right #define IN_14 7 // L298N #1 in 4 motor Back Right #define IN_21 8 // L298N #2 in 1 motor Front Left #define IN_22 9 // L298N #2 in 2 motor Front Left #define IN_23 12 // L298N #2 in 3 motor Back Left #define IN_24 13 // L298N #2 in 4 motor Back Left Arduino Code
  • 10. int command; //Int to store app command state. int speedCar = 100; int speedCarM = 95;// 50 - 255. int speed_Coeff = 4; const int trigPin = A5; const int echoPin = A3; // defines variables long duration; int distance; int safetyDistance; boolean lightFront = false; boolean lightBack = false; boolean horn = false; void setup() { pinMode(light_FR, OUTPUT); pinMode(light_FL, OUTPUT); pinMode(light_BR, OUTPUT); pinMode(light_BR, OUTPUT); pinMode(horn_Buzz, OUTPUT); pinMode(ENA_m1, OUTPUT); pinMode(ENB_m1, OUTPUT); pinMode(ENA_m2, OUTPUT); pinMode(ENB_m2, OUTPUT); pinMode(IN_11, OUTPUT); pinMode(IN_12, OUTPUT); pinMode(IN_13, OUTPUT); pinMode(IN_14, OUTPUT); pinMode(IN_21, OUTPUT); pinMode(IN_22, OUTPUT); pinMode(IN_23, OUTPUT); pinMode(IN_24, OUTPUT); pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output pinMode(echoPin, INPUT); // Sets the echoPin as an Input Serial.begin(9600); }
  • 11. void goAhead(){ digitalWrite(IN_11, HIGH); digitalWrite(IN_12, LOW); analogWrite(ENA_m1, speedCar); digitalWrite(IN_13, LOW); digitalWrite(IN_14, HIGH); analogWrite(ENB_m1, speedCar); digitalWrite(IN_21, LOW); digitalWrite(IN_22, HIGH); analogWrite(ENA_m2, speedCar); digitalWrite(IN_23, HIGH); digitalWrite(IN_24, LOW); analogWrite(ENB_m2, speedCar); } void goBack(){ digitalWrite(IN_11, LOW); digitalWrite(IN_12, HIGH); analogWrite(ENA_m1, speedCar); digitalWrite(IN_13, HIGH); digitalWrite(IN_14, LOW); analogWrite(ENB_m1, speedCar); digitalWrite(IN_21, HIGH); digitalWrite(IN_22, LOW); analogWrite(ENA_m2, speedCar); digitalWrite(IN_23, LOW); digitalWrite(IN_24, HIGH); analogWrite(ENB_m2, speedCar); } void goBackM(){ digitalWrite(IN_11, LOW); digitalWrite(IN_12, HIGH); analogWrite(ENA_m1, speedCarM); digitalWrite(IN_13, HIGH); digitalWrite(IN_14, LOW); analogWrite(ENB_m1, speedCarM);
  • 12. digitalWrite(IN_21, HIGH); digitalWrite(IN_22, LOW); analogWrite(ENA_m2, speedCarM); digitalWrite(IN_23, LOW); digitalWrite(IN_24, HIGH); analogWrite(ENB_m2, speedCarM); } void goRight(){ digitalWrite(IN_11, LOW); digitalWrite(IN_12, HIGH); analogWrite(ENA_m1, speedCar); digitalWrite(IN_13, HIGH); digitalWrite(IN_14, LOW); analogWrite(ENB_m1, speedCar); digitalWrite(IN_21, LOW); digitalWrite(IN_22, HIGH); analogWrite(ENA_m2, speedCar); digitalWrite(IN_23, HIGH); digitalWrite(IN_24, LOW); analogWrite(ENB_m2, speedCar); } void goLeft(){ digitalWrite(IN_11, HIGH); digitalWrite(IN_12, LOW); analogWrite(ENA_m1, speedCar); digitalWrite(IN_13, LOW); digitalWrite(IN_14, HIGH); analogWrite(ENB_m1, speedCar); digitalWrite(IN_21, HIGH); digitalWrite(IN_22, LOW); analogWrite(ENA_m2, speedCar); digitalWrite(IN_23, LOW); digitalWrite(IN_24, HIGH); analogWrite(ENB_m2, speedCar); }
  • 13. void goAheadRight(){ digitalWrite(IN_11, HIGH); digitalWrite(IN_12, LOW); analogWrite(ENA_m1, speedCar/speed_Coeff); digitalWrite(IN_13, LOW); digitalWrite(IN_14, HIGH); analogWrite(ENB_m1, speedCar/speed_Coeff); digitalWrite(IN_21, LOW); digitalWrite(IN_22, HIGH); analogWrite(ENA_m2, speedCar); digitalWrite(IN_23, HIGH); digitalWrite(IN_24, LOW); analogWrite(ENB_m2, speedCar); } void goAheadLeft(){ digitalWrite(IN_11, HIGH); digitalWrite(IN_12, LOW); analogWrite(ENA_m1, speedCar); digitalWrite(IN_13, LOW); digitalWrite(IN_14, HIGH); analogWrite(ENB_m1, speedCar); digitalWrite(IN_21, LOW); digitalWrite(IN_22, HIGH); analogWrite(ENA_m2, speedCar/speed_Coeff); digitalWrite(IN_23, HIGH); digitalWrite(IN_24, LOW); analogWrite(ENB_m2, speedCar/speed_Coeff); } void goBackRight(){ digitalWrite(IN_11, LOW); digitalWrite(IN_12, HIGH); analogWrite(ENA_m1, speedCar/speed_Coeff); digitalWrite(IN_13, HIGH); digitalWrite(IN_14, LOW);
  • 14. analogWrite(ENB_m1, speedCar/speed_Coeff); digitalWrite(IN_21, HIGH); digitalWrite(IN_22, LOW); analogWrite(ENA_m2, speedCar); digitalWrite(IN_23, LOW); digitalWrite(IN_24, HIGH); analogWrite(ENB_m2, speedCar); } void goBackLeft(){ digitalWrite(IN_11, LOW); digitalWrite(IN_12, HIGH); analogWrite(ENA_m1, speedCar); digitalWrite(IN_13, HIGH); digitalWrite(IN_14, LOW); analogWrite(ENB_m1, speedCar); digitalWrite(IN_21, HIGH); digitalWrite(IN_22, LOW); analogWrite(ENA_m2, speedCar/speed_Coeff); digitalWrite(IN_23, LOW); digitalWrite(IN_24, HIGH); analogWrite(ENB_m2, speedCar/speed_Coeff); } void stopRobot(){ digitalWrite(IN_11, LOW); digitalWrite(IN_12, LOW); analogWrite(ENA_m1, speedCar); digitalWrite(IN_13, LOW); digitalWrite(IN_14, LOW); analogWrite(ENB_m1, speedCar); digitalWrite(IN_21, LOW); digitalWrite(IN_22, LOW); analogWrite(ENA_m2, speedCar); digitalWrite(IN_23, LOW); digitalWrite(IN_24, LOW); analogWrite(ENB_m2, speedCar); }
  • 15. void loop(){ // Clears the trigPin digitalWrite(trigPin, LOW); delayMicroseconds(2); // Sets the trigPin on HIGH state for 10 micro seconds digitalWrite(trigPin, HIGH); delayMicroseconds(10); digitalWrite(trigPin, LOW); // Reads the echoPin, returns the sound wave travel time in microseconds duration = pulseIn(echoPin, HIGH); // Calculating the distance distance= duration*0.034/2; safetyDistance = distance; if (Serial.available() > 0) { command = Serial.read(); stopRobot(); //Initialize with motors stopped. if (lightFront) {digitalWrite(light_FR, HIGH); digitalWrite(light_FL, HIGH);} if (!lightFront) {digitalWrite(light_FR, LOW); digitalWrite(light_FL, LOW);} if (lightBack) {digitalWrite(light_BR, HIGH); digitalWrite(light_BR, HIGH);} if (!lightBack) {digitalWrite(light_BR, LOW); digitalWrite(light_BR, LOW);} if (horn) {digitalWrite(horn_Buzz, HIGH);} if (!horn) {digitalWrite(horn_Buzz, LOW);} if (safetyDistance <= 20){ digitalWrite(light_BR, HIGH); digitalWrite(horn_Buzz, HIGH); delay(500); goBackM(); delay(750); } else{ switch (command) { case 'F':goAhead();break; case 'B':goBack();break; case 'L':goLeft();break ; case 'R':goRight();break;
  • 16. case 'I':goAheadRight();break; case 'G':goAheadLeft();break; case 'J':goBackRight();break; case 'H':goBackLeft();break; case '0':speedCar = 100;break; case '1':speedCar = 115;break; case '2':speedCar = 130;break; case '3':speedCar = 145;break; case '4':speedCar = 160;break; case '5':speedCar = 175;break; case '6':speedCar = 190;break; case '7':speedCar = 205;break; case '8':speedCar = 220;break; case '9':speedCar = 235;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 'V':horn = true;break; case 'v':horn = false;break; } } } }
  • 17. Android Application Forward Backward Front Light Back Light Horn Acceleratio Right Left
  • 18.