0% found this document useful (0 votes)
32 views25 pages

Lab Report (Robotics)

Uploaded by

Zahid Hasan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views25 pages

Lab Report (Robotics)

Uploaded by

Zahid Hasan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Lab Report

Course Name:Robotics and Automation Lab


Course Code: CSE-4102

Submitted by:

Zahid Hasan (19CSE037)

Session: 2018-19
4th Year, 1st Semester.
Computer Science and Engineering
University of Barishal, Barishal

Submitted to:

Dr. Rahat Hossain Faisal


Associate Professor
Computer Science and Engineering
University of Barishal, Barishal.
Sunday, 24 March, 2024
INDEX

# Experiment Name Page No

1 Arduino Line Follower Car 02

2 RFID Door Lock 07


3 Obstacle Avoiding Car 13

4 Bluetooth Control Car 19

1
Name of the Experiment: Arduino Line Follower Car

Objective

The project's goal is to create a Line Follower Robot (LFR) that can track
black lines on contrasting surfaces on its own by using an Arduino Uno
and infrared sensors. The goal is to develop a flexible LFR that can adjust
to various line-following situations by utilizing accurate sensor input and
strong Arduino-based control systems. The goal of this project is to
develop a dependable and effective line-tracking system, demonstrating
the practical uses of Arduino-based robots.

Description of the Problem

The autonomous detection of black lines on contrasting surfaces is a need for


the Line Follower automobile. The robot is equipped with infrared sensors
that are used to execute its duty. These sensors detect changes in surface
reflectivity, which helps the robot follow the line's path precisely.

Required Components

1. Arduino UNO
2. Motor Driver Shield
3. IR Sensor (2x)
4. TT Gear Motor (4x)
5. 18650 Li-on Battery (2x)
6. 18650 Battery Holder
7. Jumper Wires
8. Acrylic Sheet
9. DC Power Switch
10. Wheels (4x)

Description of The Components

➢ Arduino UNO: The brains of the line follower automobile are found on
this popular microcontroller board. It uses preprogrammed commands
to control different parts.

➢ Motor Driver Shield: An expansion board called the Motor Driver Shield

2
➢ communicates with the Arduino UNO to control motor movement.
H-bridge circuits are usually included to drive motors in both directions.
Wheels (4x): Components providing traction and enabling movement in
different directions.

➢ IR Sensor (2x): The contrast between the black line and the
surrounding surface is picked up by these infrared sensors. By giving
the Arduino UNO feedback, they allow autonomous path following.

➢ TT Gear Motors: The car is propelled forward by these DC motors with


gearboxes because of their strong torque and low rotation speed.

➢ 18650 Li-on Batteries: With their great energy density, these


rechargeable lithium-ion batteries can power electronics and motors.

➢ 18650 Battery Holder: crafted to safely accommodate and attach


18650 batteries, guaranteeing efficient battery management and a
simple installation process.

➢ jumper Wires: These flexible wires, which have connectors on both


ends, link components electrically and make it easier to communicate
with the Arduino UNO.

➢ Acrylic Sheet: This material, which is used to build the chassis, offers
a strong, lightweight framework that holds components together.

➢ DC Power Switch: For safety and energy efficiency, this mechanical


switch regulates the flow of electricity to the vehicle and allows for
easy on/off operation.

➢ Wheels: They give the robot traction and allow it to move. They aid in
surface motion and are usually fastened to the TT Gear Motors' shafts.

Circuit Design

3
Implementation:

Part 1 - Theoretical

❖ Hardware Setup: Assemble the robotic car with motors, wheels,


sensors (like IR sensors), and Arduino.
❖ Arduino Programming: Write code to read sensor data and control
motors to follow the line.
❖ Line Following Algorithm: Develop algorithms for maintaining the car's
position relative to the line.
❖ Testing and Debugging: Test the car on a track, debug any issues in
sensor readings or motor control.
❖ Optimization and Enhancement: Optimize code, experiment with sensor
configurations, and add features like obstacle avoidance.
❖ Documentation: Document the project details for reference and share
results with others.

4
Part 2-Coding:

Code
[Link](200);
//line detected by both sensors
[Link](200);
if(analogRead(lefts) <= 400 && analogRead(rights)
<= 400){ //declaring pin types

//stop all motors pinMode(lefts,INPUT);

[Link](RELEASE); pinMode(rights,INPUT);

[Link](RELEASE); //begin serial communication

[Link](RELEASE); [Link](9600);

[Link](RELEASE); }

//defining motors

AF_DCMotor motor1(frontLeftMotor, void loop(){


MOTOR12_8KHZ);
//printing values of the sensors to the serial
AF_DCMotor motor2(frontRightMotor, monitor
MOTOR12_8KHZ);
[Link]("Left Sensor: ");
AF_DCMotor motor3(rearLeftMotor,
MOTOR12_8KHZ); [Link](analogRead(lefts));

AF_DCMotor motor4(rearRightMotor, [Link]("Right Sensor: ");


MOTOR12_8KHZ);
[Link](analogRead(rights));

void setup() {

//setting the speed of motors

}
[Link](200);

//line detected by left sensor


[Link](200);

else if(analogRead(lefts) <= 400 &&


5
analogRead(rights) > 400){
[Link](BACKWARD);
//turn left
}
[Link](BACKWARD);
//no line detected by both sensors
[Link](FORWARD);
else {
[Link](BACKWARD);
//move forward
[Link](FORWARD);
[Link](FORWARD);
}
[Link](FORWARD);
//line detected by right sensor
[Link](FORWARD);
else if(analogRead(lefts) > 400 &&
analogRead(rights) <= 400){ [Link](FORWARD);

//turn right }

[Link](FORWARD); }

[Link](BACKWARD);

[Link](FORWARD);

//including the libraries

#include <AFMotor.h>

//defining pins and variables

#define lefts A4

#define rights A5

#define frontLeftMotor 1

#define frontRightMotor 2

#define rearLeftMotor 3

#define rearRightMotor 4

6
Results

Input

Surface reflectivity fluctuations are directed by infrared sensors.

Output

By processing sensor inputs and regulating motor operations, the Arduino


enables the robot to travel autonomously backwards on the contracting
surface.

Name of the Experiment: RFID Door Lock

Objective

This project's goal is to create and put into place an RFID door lock system that can
authorize access using radio frequency identification (RFID). Our goal is to develop a
safe and practical door-locking system that improves access control and does away
with conventional keys by employing RFID technology.

7
Description of The Experiment

Conventional locks, such as key-based electronic systems or mechanical locks, have


drawbacks in terms of ease and security, such as the possibility of misplaced or
duplicate keys. By employing RFID technology for safe, contactless authentication,
the suggested RFID door lock system seeks to solve these problems. But creating a
dependable system requires overcoming obstacles such as robust authentication,
hardware integration, security protocols, and system dependability:

➢ RFID Authentication: To implement RFID authentication, the right RFID tags


and readers must be chosen. Software that can interpret RFID data and verify
access rights must also be developed. While blocking attempts by
unauthorized users to access the system, it must correctly identify permitted
users.

➢ Hardware Integration: Careful consideration of physical dimensions, power


needs, and compatibility with existing door hardware is necessary when
integrating RFID readers and actuators (such as solenoid locks or servo
motors) with the door mechanism.

➢ Security: It is crucial to guarantee the security of the RFID door lock system
to stop unwanted access. To protect against potential risks like cloning or
RFID signal interception, precautions including encryption of RFID data, the
use of access control lists, and frequent security audits must be taken.

➢ User Interface: Practical usability requires creating an easy-to-use interface


for adding or removing RFID credentials, monitoring system activity, and
adjusting access rights.. This may involve developing a dedicated mobile or
web application or integrating with existing access control systems.

➢ Reliability and Maintenance: Strong and dependable, the RFID door lock
system should be able to withstand a variety of environmental factors and
manage a large number of access requests. Establishing routine maintenance
and troubleshooting methods can help to quickly address any hardware or
software issues.

Required Components

1. Arduino UNO
2. Arduino Power Supply
3. Breadboard & Jumpers
4. RC522 RFID Sensor
5. Micro Servo
6. LEDs
7. Resistors
8. 3D Printer & Filament
8
Description Of Components

❖ Arduino UNO: Versatile microcontroller board for programming and controlling


electronic projects.

❖ Arduino Power Supply: Provides a stable power source for Arduino UNO and
connected components.

❖ Breadboard & Jumpers: Prototyping tools for creating temporary circuits and
connecting electronic components.

❖ RC522 RFID Sensor: RFID module for reading and authenticating RFID tags or
cards.

❖ Micro Servo: Small motor for controlling the locking mechanism of the door.

❖ LEDs: Light-emitting diodes used for indicating system status or providing visual
feedback.

❖ Resistors: Electronic components used to limit current flow or adjust voltage


levels.

❖ 3D Printer & Filament: Tools for fabricating custom parts or enclosures for the
RFID door lock system.

Circuit Design

9
Implementation:

Part 1 - Theoretical

The RFID door lock system operates on the principle of RFID technology, where each
authorized user is assigned a unique identifier stored on an RFID card. The RC522
RFID sensor reads these identifiers and, upon verification, triggers the Micro Servo
to unlock the door. LEDs provide visual indicators of the door's status, enhancing
user feedback.

Experimental Setup

● Connect RFID sensor, LEDs, and Micro Servo to Arduino UNO via jumpers and

breadboard.

● Power Arduino UNO using Arduino Power Supply.

● Program Arduino to read RFID card data and manage Micro Servo.

● Optionally, create custom lock mechanism using 3D printer.

Procedure

​ RFID Registration: Associate RFID cards with users.

​ Locking: Servo unlocks door with valid RFID.

​ LEDs: Show lock status (red = locked, green = unlocked).

​ 3D Lock (Optional): Print custom lock for servo integration.

​ Testing: Verify system with cards; check LEDs and servo.

Operation

RFID card detected, Arduino verifies against registered users, activates

servo for door unlocking, LEDs indicate lock status.

10
Part 2:
digitalWrite(redLEDPin, LOW);
delay(200);
Code digitalWrite(greenLEDPin, LOW);
#include <SPI.h>
[Link](3);
#include <RFID.h>
#include <Servo.h>

RFID rfid(10, 9); //D10:pin of tag [Link](lockPos); //Move servo


reader SDA. D9:pin of tag reader RST into locked position
unsigned char status;
unsigned char str[MAX_LEN]; //MAX_LEN is
16: size of the array

String accessGranted [2] = {"310988016", [Link]("Place card/tag near


"19612012715"}; //RFID serial numbers to reader...");
grant access to }
int accessGrantedSize = 2;
//The number of serial numbers void loop()

Servo lockServo; //Servo for locking


mechanism
{
int lockPos = 15; //Locked position
limit if ([Link](PICC_REQIDL, str) ==
MI_OK) //Wait for a tag to be placed near
the reader
{
int unlockPos = 75; //Unlocked position
[Link]("Card found");
limit
String temp = "";
boolean locked = true;
//Temporary variable to store the read RFID
number
int redLEDPin = 5;
if ([Link](str) == MI_OK)
int greenLEDPin = 6;
//Anti-collision detection, read tag serial
number
void setup()
{
{
[Link]("The card's ID number is :
[Link](9600); //Serial monitor is ");
only required to get tag ID numbers and
for (int i = 0; i < 4; i++) //Record and
for troubleshooting
display the tag serial number {
[Link](); //Start SPI
temp = temp + (0x0F & (str[i] >> 4));
communication with reader
temp = temp + (0x0F & str[i]); }
[Link](); //initialization
[Link] (temp);
checkAccess (temp); //Check if the
identified tag is an allowed to open
tag
}
pinMode(redLEDPin, OUTPUT); //LED startup [Link](str); //Lock card to
sequence prevent a redundant read, removing the line
pinMode(greenLEDPin, OUTPUT); will make the sketch read cards continually
digitalWrite(redLEDPin, HIGH); }
delay(200); [Link]();
digitalWrite(greenLEDPin, HIGH); }
delay(200);

11
//Green LED sequence
void checkAccess (String temp) delay(200);
//Function to check if an identified tag is digitalWrite(greenLEDPin, LOW);
registered to allow access delay(200);
{ digitalWrite(greenLEDPin, HIGH);
boolean granted = false; delay(200);
for (int i=0; i <= (accessGrantedSize-1); digitalWrite(greenLEDPin, LOW);
i++) //Runs through all tag ID numbers delay(200);
registered in the array
{
if(accessGranted[i] == temp)
}
//If a tag is found then open/close the
}
lock
if (granted == false) //If the tag is not
{
found
[Link] ("Access Granted");
{
granted = true;
[Link] ("Access Denied");
if (locked == true) //If the lock is
digitalWrite(redLEDPin, HIGH);
closed then open it
//Red LED sequence
{
delay(200);
[Link](unlockPos);
digitalWrite(redLEDPin, LOW);
locked = false;
} delay(200);
digitalWrite(redLEDPin, HIGH);
else if (locked == false) //If the lock
is open then close it delay(200);
digitalWrite(redLEDPin, LOW);
{
delay(200);
[Link](lockPos); locked
= true; }
} }
digitalWrite(greenLEDPin, HIGH);

Results:

Part 1 - Input

The RFID Door Lock system operates by detecting RFID tags near the
RFID reader. Upon initialization, the Arduino board waits for a tag to be
detected. When a tag is found, its ID number is compared against a list
of permitted access tags. If a match is found, the door lock mechanism
is activated to either lock or unlock the door, based on its current
state. This process ensures that only authorized individuals can gain
access to the locked area.

Part 2 - Output

The RFID Door Lock system utilizes an Arduino board to manage RFID tag detection

12
and access control. It communicates the status of the RFID detection process
through the serial monitor. When an allowed access tag is detected, the door lock
mechanism is activated accordingly, either locking or unlocking the door. LED
indicators provide visual feedback, with a green LED sequence indicating access
granted and a red LED sequence for access denied. Additionally, the door lock servo
moves to the appropriate position based on the detected tag's access status. Finally,
status messages indicating "Access Granted" or "Access Denied" are printed to the
serial monitor, reflecting the outcome of the RFID tag check. This comprehensive
system ensures secure access control with both visual and serial feedback
mechanisms.

Name of the Experiment: Obstacle Avoiding Car

Objective

Create and build a robotic vehicle that can navigate itself and avoid obstacles. Use
sensor-based navigation algorithms to ensure safety. Analyze and experiment with
systems to determine their performance, providing useful information for robotics
and sensor technology applications.

Description of The Experiment

Integrating sensors like ultrasonic or infrared with a mobile robotic platform enables
autonomous obstacle detection and navigation, surpassing limitations of predefined
paths or manual intervention in conventional systems.

Key aspects of the problem include:

❖ Sensor Integration: Selecting and integrating sensors capable of accurately


detecting obstacles in the car's path.

❖ Algorithm Development: Designing algorithms to process sensor data and


make real-time decisions to navigate around obstacles.

❖ Mechanical Design: Creating a robust and agile robotic platform capable of


executing complex maneuvers.

❖ Testing and Evaluation: Conduct experiments to evaluate the performance of


the obstacle avoidance system in various scenarios, including different types

13
of obstacles and environmental conditions.

Required Component

1. Arduino UNO
2. Motor Driver Shield
3. Wheels (4x)
4. TT Gear Motor (4x)
5. Servo Motor
6. Ultrasonic Sensor
7. 18650 Li-on Battery (2x)
8. 18650 Battery Holder
9. Male and Female Jumper Wire
10. Acrylic Sheet
11. DC Power Switch

Description of The Components

I. Arduino UNO: Versatile microcontroller board for controlling electronic


projects.
II. Motor Driver Shield: Enables control of motors with Arduino, simplifying
motor interfacing.
III. Wheels (4x): Essential components providing traction for the robotic car.
IV. TT Gear Motor (4x): Compact motors with high torque for driving the wheels.
V. Servo Motor: Provides precise control for specific movements, like steering.
VI. Ultrasonic Sensor: Detects obstacles by emitting and receiving ultrasonic
waves.
VII. 18650 Li-ion Battery (2x): Rechargeable power source for the robotic car.
VIII. 18650 Battery Holder: Holds and connects the Li-ion batteries securely.
IX. Male and Female Jumper Wire: Enables easy and secure connections between
components.
X. Acrylic Sheet: Structural material for building the chassis of the robotic car.
XI. DC Power Switch: Manually controls power supply to the robotic car for
convenience and safety.

14
Circuit Design:

Implementation:

Part 1 - Theoretical

The Obstacle Avoiding Car utilizes ultrasonic sensing and motor control

principles. The Ultrasonic Sensor emits waves, measuring bounce-back

time to calculate obstacle distance. Arduino UNO processes data,

directing TT Gear Motors for navigation. Servo Motor aids in obstacle

detection and avoidance.

Experimental Setup:

1. Assemble chassis with acrylic sheet, wheels, and TT Gear Motors.

15
2. Connect the Ultrasonic Sensor, Servo Motor, and TT Gear Motors to

Arduino using Jumper Wires.

3. Attach the Motor Driver Shield to Arduino.

4. Connect the DC Power Switch to the power supply.

5. Insert 18650 Li-on Batteries into the Battery Holder.

Procedure:

1. Position the Ultrasonic Sensor on the Servo Motor for 180-degree

scanning.

2. Program Arduino to read Ultrasonic Sensor data and control TT Gear

Motors.

3. Implement code to control the Servo Motor for obstacle detection.

4. Connect power supply components for stable power.

Operation:

1. The Servo Motor rotates, enabling the Ultrasonic Sensor to scan for

obstacles.

2. If an obstacle is detected, Arduino commands TT Gear Motors to

navigate and avoid it.

3. Car continuously scans and navigates, demonstrating real-time

obstacle avoidance.

Part 2 - Coding

Code install the necessary library//


//AFMotor Library
[Link]
//OBSTACLE AVOIDING CAR// r shield/library-install //
// Before uploading the code you have to //NewPing Library

16
[Link]
NewPing//
//Servo Library
delay(100);
}
[Link]
libraries/[Link] // void loop() {
// To Install the libraries, go to int distanceR = 0;
sketch >> Include Library >> Add .ZIP int distanceL = 0;
File >> Select the Downloaded ZIP files delay(40);
From the Above links //
if(distance<=15)
{
#include <AFMotor.h> moveStop();
#include <NewPing.h> delay(100);
#include <Servo.h> moveBackward();
delay(300);
#define TRIG_PIN A0 moveStop();
#define ECHO_PIN A1 delay(200);
#define MAX_DISTANCE 200 distanceR = lookRight(); delay(200);
#define MAX_SPEED 190 // sets speed of distanceL = lookLeft(); delay(200);
DC motors
#define MAX_SPEED_OFFSET 20 if(distanceR>=distanceL) {
turnRight();
NewPing sonar(TRIG_PIN, ECHO_PIN, moveStop();
MAX_DISTANCE); }else
{
AF_DCMotor motor1(1, MOTOR12_1KHZ); turnLeft();
AF_DCMotor motor2(2, MOTOR12_1KHZ); moveStop();
AF_DCMotor motor3(3, MOTOR34_1KHZ); }
AF_DCMotor motor4(4, MOTOR34_1KHZ);
}else
Servo myservo;
{
moveForward();
boolean goesForward=false;
}
distance = readPing();
int distance = 100;
}
int speedSet = 0;

int lookRight()
void setup() {
{
[Link](50); delay(500);
[Link](10);
int distance = readPing(); delay(100);
[Link](115);
[Link](115); return distance;
delay(2000);
}
distance = readPing();
delay(100);
int lookLeft()
distance = readPing();
{
delay(100);
[Link](170); delay(500);
distance = readPing();
int distance = readPing(); delay(100);
delay(100);
distance = readPing();
[Link](115);
return distance; int readPing() {
delay(100); delay(70);
} int cm = sonar.ping_cm();
if(cm==0)

17
{ [Link](BACKWARD);
cm = 250; [Link](BACKWARD);
} [Link](BACKWARD);
return cm; [Link](BACKWARD);
} for (speedSet = 0; speedSet < MAX_SPEED;
speedSet +=2) // slowly bring the speed up
void moveStop() { to avoid loading down the batteries too
[Link](RELEASE); quickly
[Link](RELEASE); {
[Link](RELEASE); [Link](speedSet);
[Link](RELEASE); [Link](speedSet);
} [Link](speedSet);
[Link](speedSet);
void moveForward() { delay(5);
}
if(!goesForward) }
{
goesForward=true; void turnRight() {
[Link](FORWARD); [Link](FORWARD);
[Link](FORWARD); [Link](FORWARD);
[Link](FORWARD); [Link](BACKWARD);
[Link](FORWARD); [Link](BACKWARD);
for (speedSet = 0; speedSet < MAX_SPEED; delay(500);
speedSet +=2) // slowly bring the speed up [Link](FORWARD);
to avoid loading down the batteries too [Link](FORWARD);
quickly [Link](FORWARD);
{ [Link](FORWARD);
[Link](speedSet); }
[Link](speedSet);
[Link](speedSet); void turnLeft() {
[Link](speedSet); [Link](BACKWARD);
delay(5); [Link](BACKWARD);
} [Link](FORWARD);
} [Link](FORWARD);
} delay(500);
[Link](FORWARD);
[Link](FORWARD);
[Link](FORWARD);
[Link](FORWARD);
void moveBackward() {
}
goesForward=false;

Results:

Part 1 - Input

The "Obstacle Avoiding Car" code utilizes an ultrasonic sensor

18
connected to an Arduino to measure distances. This sensor emits

sound waves that bounce off obstacles and calculates the distance by

measuring the time it takes for the waves to return. This information is

then used to enable the car to navigate and avoid obstacles effectively.

Part 2 - Output

The "Obstacle Avoiding Car" code controls the movement of the car by

interpreting distance readings from the ultrasonic sensor

(sonar.ping_cm()). If the measured distance to an obstacle is 15 cm or

less, the car stops, moves backward, and then turns either left or right

to navigate around the obstacle. Otherwise, if no obstacles are

detected within 15 cm, the car continues moving forward. The output

of the code comprises movement control signals sent to the DC motors

and servo motors to execute these actions.

Name of the Experiment: Bluetooth Control Car

Objective

Design and construct a Bluetooth-controlled robotic car with a user-friendly interface


for remote control via a mobile device. Explore the integration of Bluetooth
technology with robotics and evaluate system performance and responsiveness
through experimentation.

Description of The Problem

19
Key aspects of the problem include:

➢ Hardware Integration: Selecting and integrating Bluetooth modules with the


robotic car's microcontroller (such as Arduino) to establish a wireless
communication link.

➢ Software Development: Designing and implementing a mobile application or


user interface for the Bluetooth control system, enabling users to send
commands to the car.

➢ User Interface Design: Creating an intuitive and user-friendly interface for


controlling the car's movement, direction, and additional features remotely.

➢ Performance Evaluation: Testing the responsiveness and reliability of the


Bluetooth control system through various maneuvers and real-world
scenarios.

Required Components

1. Arduino UNO
2. Arduino Bluetooth Module HC-05
3. 6V DC Geared Motor 180 RPM Dual Shaft (4 pcs)
4. L298N H-Bridge Dual Motor Driver, Stepper Motor Driver
5. Yellow Plastic Mag Wheel Soft Tire (4 pcs)
6. 18650 Li-ion Rechargeable Battery (2 pcs)
7. Battery Holder 2s for 18650 Battery
8. Male and Female Jumper Wires (40 pcs)
9. 6 Inch X 6 Inch Acrylic Sheet
10. On / Off Switch (Mini)

Description of The Components

➢ Arduino UNO: Microcontroller board for programming and controlling the


robotic car's functions.
➢ Arduino Bluetooth Module HC-05: Bluetooth module enabling wireless
communication between the car and a mobile device.
➢ 6V DC Geared Motor 180 RPM Dual Shaft: Motors for driving the wheels of the
robotic car.
➢ L298N H-Bridge Dual Motor Driver: Motor driver for controlling the speed and
direction of the motors.
➢ Yellow Plastic Mag Wheel Soft Tire: Wheels for the robotic car, providing

20
traction and stability.
➢ 18650 Li-ion Rechargeable Battery: Power source for the robotic car, ensuring
portability and longevity.
➢ Battery Holder 2s for 18650 Battery: Holder for securing and connecting the
Li-ion batteries.
➢ Male and Female Jumper Wires: Connectors for establishing electrical
connections between components.
➢ 6 Inch X 6 Inch Acrylic Sheet: Structural material for building the chassis and
body of the robotic car.
➢ On / Off Switch (Mini): Switch for manually controlling the power supply to
the robotic car.

​ .

Circuit Design

21
Implementation:

Part 1 - Theoretical

The Bluetooth Robot Car utilizes wireless communication between

Arduino UNO and a Bluetooth-enabled device. Arduino processes

signals from HC-05 module, controlling DC Geared Motors via L298N

Motor Driver. Motors power wheels for car movement.

Experimental Setup:

1. Assemble chassis with motors and wheels.

2. Connect motors to motor driver.

3. Wire Arduino and Bluetooth module.

4. Connect batteries and include On/Off Switch.

Procedure:

1. Configure Bluetooth Module HC-05 with the device.

2. Wire DC Geared Motors to L298N Motor Driver and Arduino UNO.

3. Integrate 18650 Li-ion Batteries into the power supply.

4. Program Arduino to interpret Bluetooth signals and control motors.

5. Assemble the chassis securely for stability.

Operation:

❖ Establish Bluetooth connection between device and HC-05


Control car wirelessly with paired device via Arduino.
❖ Optional: Implement obstacle avoidance with additional sensors

22
Part 2-Coding

digitalWrite(10,HIGH);

Code

char t;

void setup() {
pinMode(13,OUTPUT); //left motors
forward
}
pinMode(12,OUTPUT); //left motors reverse
pinMode(11,OUTPUT); //right motors
else if(t == 'L'){ //turn right (left
side motors rotate in forward direction,
right side motors doesn't rotate)
digitalWrite(11,HIGH);
}
forward
pinMode(10,OUTPUT); //right motors
else if(t == 'R'){ //turn left (right side
reverse
motors rotate in forward direction, left
pinMode(9,OUTPUT); //Led
side motors doesn't rotate)
[Link](9600);
digitalWrite(13,HIGH);
}
}
else if(t == 'W'){ //turn led on or
void loop() {
off)
if([Link]()){
digitalWrite(9,HIGH);
t = [Link]();
}
[Link](t); else if(t == 'w'){
} digitalWrite(9,LOW);
}
if(t == 'F'){ //move
forward(all motors rotate in forward
else if(t == 'S'){ //STOP (all motors
direction) stop)
digitalWrite(13,HIGH); digitalWrite(13,LOW);
digitalWrite(11,HIGH); digitalWrite(12,LOW);
} digitalWrite(11,LOW);
digitalWrite(10,LOW);
else if(t == 'B'){ //move reverse (all
}
motors rotate in reverse direction)
delay(100);
digitalWrite(12,HIGH);
}

Results:

23
Part 1 - Input

The input for this code is received through the serial communication from a
connected device (like a computer or smartphone) via Bluetooth or USB. The
following are the recognized input characters and their corresponding actions:

F: Move forward (all motors rotate in the forward direction).

B: Move in reverse (all motors rotate in the reverse direction).

L: Turn right (left-side motors rotate forward, right-side motors do not rotate).

R: Turn left (right-side motors rotate forward, left-side motors do not rotate).

W: Turn LED on.

w: Turn LED off.

S: Stop (all motors stop).

Part 2 - Output

The output of the code controls the motors and LED of the robot car based on the
received commands like Left motors rotate forward (for command 'F'), Left motors
rotate reverse(for command 'B'), Right motors rotate forward (for command 'L'),
Right motors rotate reverse (for command 'R'), Stop all motors (for command 'S').
The Bluetooth Robot Car successfully demonstrated wireless control and movement
in response to commands from the paired Bluetooth-enabled device. The integration
of components, including the Arduino UNO, Bluetooth Module, and DC Geared
Motors, provided an effective and responsive robotic system.

24

You might also like