Professional Documents
Culture Documents
University of Engineering and Technology Lahore: Voice Control Robot & Obstacle Avoidance Project
University of Engineering and Technology Lahore: Voice Control Robot & Obstacle Avoidance Project
Introduction:
The robot will be based on microcontroller Arduino Uno because of its versatile features
along with numerous advantages. The system will utilize Bluetooth technology and
Standard communication interface known as SPI interface. Bluetooth uses radio waves with
safe, less power consuming device to connect and exchange data between devices
without using of any kind of physical contact like wires and cable . SPI interface is a
synchronous serial information processutilized by microcontrollers for interacting along
with one or more peripheral devices swiftly through limited ranges.
Working Principle:
The movement of the proposed robot will be controlled by the voice command of the
user. The user will use an android operated smart phone to give voice command. The
command can be fetched using an app which will convert the voice command into text.
The phone will be connected to the microcontroller using a Bluetooth module. After
conversation of the voice command into text the app will send necessary data to the
microcontroller using Bluetooth of the phone and microcontroller will receive the data
using Bluetooth module. According to the command, the robot will move forward, backward,
left, right or fully autonomous. For driving the robot there will be four geared DC motors
with gripped tyre which will be operated by the help of DC motor driver. An ultrasonic sensor
will be employed for obstacle detection during autonomous mode. Arduino Uno will send
signals according to reading of the ultrasonic sensor to provide data about any obstacle in
front of the robot within a specific range. There will be a command for stopping the robot at
instan.
Components Required:
Arduino Uno
Arduino Cable
Motor Driver Module (L293D)
Motors – 4
Robot Chassis
Wheels – 4
Proximity IR Sensor
Bluetooth module (HC-05)
Connecting wires
18650 battery and connector
DC Switch
Arduino Mobile App
Ultrasonic Sensor
Servo Motor
Hardware Details:
Arduino Uno
Arduino is an Open-source-electronic-prototyping-base for simple used hardware and software
in the field of micro-controlling. Arduino Uno has 14 digital I/O pins and 6 analog I/O pins
Circuit Diagram:
Working:
Code:
// Arduino Obstacle Avoidance + Voice Control Robot
#include <AFMotor.h>
#include <NewPing.h>
#include<Servo.h>
#define TRIGGER_PIN A1
#define ECHO_PIN A0
#define IR A5
Servo myservo;
String voice;
void setup() {
Serial.begin(9600);
myservo.attach(10);
myservo.write(90);
pinMode(IR, INPUT);
void loop() {
//Serial.println(IR1);
if(Serial.available()>0) {
voice="";
delay(2);
voice = Serial.readString();
delay(2);
Serial.println(voice);
left();
left();
right();
forward();
backward();
void forward() {
Stop();
voice="";
}else {
motor1.setSpeed(255);
motor1.run(FORWARD);
motor2.setSpeed(255);
motor2.run(FORWARD);
motor3.setSpeed(255);
motor3.run(FORWARD);
motor4.setSpeed(255);
motor4.run(FORWARD);
}
}
void backward() {
if(IR_Sensor == 0) {
Stop();
voice="";
}else {
motor1.setSpeed(255);
motor1.run(BACKWARD);
motor2.setSpeed(255);
motor2.run(BACKWARD);
motor3.setSpeed(255);
motor3.run(BACKWARD);
motor4.setSpeed(255);
motor4.run(BACKWARD);
void left() {
myservo.write(180);
delay(500);
myservo.write(90);
delay(500);
motor1.run(BACKWARD);
motor1.setSpeed(255);
motor2.run(BACKWARD);
motor2.setSpeed(255);
motor3.run(FORWARD);
motor3.setSpeed(255);
motor4.run(FORWARD);
motor4.setSpeed(255);
delay(700);
motor1.run(RELEASE);
motor2.run(RELEASE);
motor3.run(RELEASE);
motor4.run(RELEASE);
void right() {
myservo.write(0);
delay(500);
myservo.write(90);
delay(500);
motor1.run(FORWARD);
motor1.setSpeed(255);
motor2.run(FORWARD);
motor2.setSpeed(255);
motor3.run(BACKWARD);
motor3.setSpeed(255);
motor4.run(BACKWARD);
motor4.setSpeed(255);
delay(700);
motor1.run(RELEASE);
motor2.run(RELEASE);
motor3.run(RELEASE);
motor4.run(RELEASE);
void Stop() {
motor1.run(RELEASE);
motor2.run(RELEASE);
motor3.run(RELEASE);
motor4.run(RELEASE);
Final Image: