Nothing Special   »   [go: up one dir, main page]

Es Project Report 06

Download as pdf or txt
Download as pdf or txt
You are on page 1of 23

EMBEDDED SYSTEMS-1 LAB

Semester Project
Gesture Control Car

Submitted by :
Umair Rana 2022_MC_08
Zain Ahmad 2022_MC_19
Munizah Qasim 2022_MC_36

Submitted to :
Sir Shujat Ali

22.05.2024

Department of Mechatronics and Control, UET Lahore.


Introduction:
The hand gesture control car project represents a cutting-edge application of sensor technology and
microcontroller programming. This innovative project aims to revolutionize traditional car control
mechanisms by enabling users to steer and maneuver a car through intuitive hand gestures. By
harnessing the power of gesture recognition technology and wireless communication, this project offers
a hands-free and interactive driving experience. The integration of the MPU 6050 sensor for motion
tracking, coupled with the ESP32 for wireless connectivity, showcases the seamless synergy between
hardware and software components. Through this project, we delve into the realm of IoT and smart
devices, paving the way for future advancements in gesture-controlled systems.

Contents:
1. Components.
2. Overview.
3. Gesture Recognition.
4. Wireless Communication.
5. Motor Controlling.
6. Software Implementation.
7. Diagram and PCB Formation.
8. Testing and Results.
9. Challenges and Solutions.
10. References.
11. Bill of Material.

Components:
1. TM4C123GH6PM:
The TM4C123GH6PM microcontroller, part of the Tiva C Series from Texas Instruments, is a
powerful ARM Cortex-M4-based device designed for embedded applications. With a clock speed of up to
80 MHz and a wide range of peripherals, including ADCs, PWM modules, and communication interfaces,
the TM4C123GH6PM offers versatility and performance for various projects. Its integrated memory,
GPIO pins, and onboard USB controller make it ideal for developing IoT devices, robotics, and control
systems. The microcontroller's low power consumption and high computational capabilities make it a
popular choice among developers for creating efficient and feature-rich embedded solutions.

University of Engineering and Technology, Lahore


Pins Used:
GND: For ground.
PB0-PB3: For Motor Driver.
PC6-PC7 (UART3): For Bluetooth Module HC-05.
PD3: For Potentiometer reading.
VCC: For Voltage Source.
Source for TIVA: 9V battery and 7805 Voltage Regulator.

Fig.1(Pinout diagram of TM4C123GH6PM)

2. ESP32-WROOM-32:
The ESP32-WROOM-32 is a popular Wi-Fi and Bluetooth module based on the ESP32 chip
from Espressif Systems. It offers dual-core processing power with a clock speed of up to 240 MHz,
making it suitable for a wide range of IoT applications. The module includes built-in Wi-Fi and Bluetooth
connectivity, allowing for seamless wireless communication. With a rich set of peripherals, such as
GPIO, ADC, SPI, I2C, and UART interfaces, the ESP32-WROOM-32 provides flexibility for various
projects. Its low power consumption and support for deep sleep modes make it an energy-efficient
choice for battery-operated devices. Developers appreciate the ESP32-WROOM-32 for its ease of use,
robust features, and cost-effectiveness in IoT projects.
Pins Used:
GPIO21: SDA of MPU6050..
GPIO22: SCL of MPU6050.

University of Engineering and Technology, Lahore


VCC: Voltage Source.
GND: Ground Source.
GPIO16: Rx of HC-05(Sender Module).
GPIO17: Tx of HC-05(Receiver Module).
GPIO21: SDA of MPU6050
GPIO22: SCL of MPU6050
GPIO4: Output of Potentiometer

Fig.2(Pinout Diagram of ESP32-WROOM-32

3. MPU-6050:
The MPU-6050 is a popular 6 Degree of Freedom (6DoF) accelerometer and gyroscope sensor
module commonly used in motion tracking and orientation sensing applications. It combines a 3-axis
gyroscope and a 3-axis accelerometer in a single chip, providing accurate motion tracking capabilities.
The MPU-6050 offers high precision and low noise performance, making it suitable for
applications such as gesture recognition, gaming controllers, and robotics. Its I2C interface allows for
easy integration with microcontrollers like the TM4C123GH6PM and ESP32. The MPU-6050's compact
size, low power consumption, and versatile functionality make it a go-to choice for projects requiring
motion sensing capabilities.
● Acceleration along the X axis = (Accelerometer X axis raw data/16384) g.
● Acceleration along the Y axis = (Accelerometer Y axis raw data/16384) g.
● Acceleration along the Z axis = (Accelerometer Z axis raw data/16384) g.
● Angular velocity along the X axis = (Gyroscope X axis raw data/131) °/s.
● Angular velocity along the Y axis = (Gyroscope Y axis raw data/131) °/s.

University of Engineering and Technology, Lahore


● Angular velocity along the Z axis = (Gyroscope Z axis raw data/131) °/s.

Fig.3(Pinout Diagram of MPU-6050)

4. Gear Motors:
Gear motors combine a motor with a gearbox to provide increased torque and reduced speed
output. They are commonly used in applications requiring high torque at low speeds, such as robotics
and industrial machinery. Gear motors offer better efficiency and precision compared to standard
motors by leveraging gear reduction mechanisms. These motors come in various gear ratios to suit
different torque and speed requirements in diverse projects. By integrating a motor and gearbox, gear
motors simplify the design process and improve overall system performance in many applications.

University of Engineering and Technology, Lahore


Fig.4(Gear Motor for wheel rotation)

5. HC-05:
The HC-05 is a popular Bluetooth module used for wireless communication, particularly in projects
involving Arduino and other microcontrollers. Here are some key points about the HC-05 module:
Technical Specifications: The HC-05 operates at an operating voltage of 4V to 6V (typically +5V). It
is a serial Bluetooth module that can be used as a serial (RX/TX) pipe, allowing for the transmission of
serial streams ranging from 9600 to 115200 bps.
Commercial Series: The HC-05 Bluetooth module belongs to the commercial series of Bluetooth
module boards. It features an LED indicator light and uses a 150mA and 3.3V regulation chip. It is
commonly available for purchase online.
Master or Slave Configuration: The HC-05 module can be used in either a master or slave
configuration, depending on the project requirements. It provides flexibility in establishing wireless
communication between devices.
Wireless Communication: The HC-05 module enables wireless communication between devices,
allowing for the transmission of data, commands, or control signals without the need for physical wires
or cables.
Compatibility: The HC-05 module is widely compatible with various microcontrollers and development
boards, making it a versatile choice for wireless communication projects.

Fig.4(HC-05 Bluetooth Module for Wireless Communication)

6. L298N Motor Driver:


The L298N motor driver is a popular dual H-bridge module that can control two DC motors or
one stepper motor. It can drive motors with a voltage range of 5V to 35V and a maximum current of 2A
per channel. The L298N module is widely used in robotics, automation, and DIY projects due to its ease
of use and reliability. It allows for both direction and speed control of motors through PWM signals from

University of Engineering and Technology, Lahore


microcontrollers like Arduino or Raspberry Pi. The built-in protection diodes help prevent damage to the
driver when the motor is turned off, making it a versatile choice for various motor control applications.

Fig.6(Pinout Diagram of L298N Motor Driver)

7. Battery Cell:
A 3.7V battery cell is commonly used in various portable electronic devices. It is a rechargeable
lithium-ion cell known for its energy density and stable voltage output. These cells are widely used in
smartphones, tablets, drones, and other gadgets requiring a reliable power source. The 3.7V rating
signifies the nominal voltage output of the battery cell. Proper handling and charging practices are
essential to maximize the lifespan and performance of 3.7V battery cells. Multiple Cells are used in
series to increase voltage

Overview:
A hand gesture control car is a type of remote-controlled car that can be operated using hand gestures
instead of traditional remote controls. It utilizes gesture recognition technology to interpret the
movements of the user's hand and translate them into commands for the car.
Gesture Recognition: Hand gesture control cars use a sensor to detect and interpret the hand
movements of the user. These movements are then translated into specific commands for the car, such
as moving forward, backward, turning left or right, and stopping.
Intuitive Control: The use of hand gestures makes controlling the car more intuitive and interactive.
Users can simply wave their hands or make specific gestures to control the car's movements, adding a
fun and immersive experience.
Wireless Connectivity: Hand gesture control cars typically use wireless connectivity, such as
Bluetooth or Wi-Fi, to establish a connection between the car and the user's hand gestures. This allows
for greater freedom of movement and eliminates the need for physical wires or cables.

University of Engineering and Technology, Lahore


Versatility: Hand gesture control cars come in various sizes and designs, ranging from small toy cars to
larger hobby-grade models. They can be used both indoors and outdoors, providing entertainment for
people of all ages.
Additional Features: Some hand gesture control cars may offer additional features such as LED lights,
sound effects, and customizable settings. These features enhance the overall experience and allow for
personalization.

Gesture Recognition:
To recognize gestures using the MPU6050 sensor in a project like a Hand Gesture Control Car, the
accelerometer and gyroscope data from the MPU6050 are typically used. Here's how the process
generally works:
Data Acquisition: The MPU6050 sensor measures acceleration and angular velocity along three axes
using its built-in accelerometer and gyroscope. This data is collected in real-time as the sensor detects
motion and orientation changes.
Gesture Mapping: Specific gestures are mapped to patterns in the sensor data. For example, a gesture
like moving the hand up could correspond to a certain pattern of acceleration and angular velocity
values captured by the MPU6050.
Signal Processing: The raw sensor data is processed to extract relevant features that represent
different gestures. Algorithms can be applied to analyze the data and identify patterns that correspond
to specific hand movements.
Gesture Recognition: Machine learning algorithms for pattern recognition techniques are employed
to recognize the gestures based on the processed sensor data. These algorithms can classify the
gestures by comparing the extracted features to pre-defined gesture patterns.
Command Generation: Once a gesture is recognized, the system generates corresponding commands
for the Hand Gesture Control Car. These commands are then sent to the car's control system to execute
the desired movement, such as moving forward, backward, turning, or stopping.

Wireless Communication:
Bluetooth or Wi-Fi: Wireless technologies such as Bluetooth or Wi-Fi are commonly used to establish
a connection between the hand gesture input device and the car's control unit. Bluetooth Low Energy
(BLE) is often preferred for its energy efficiency and ease of implementation.

University of Engineering and Technology, Lahore


Real-Time Communication: Wireless connection enables real-time communication between the hand
gesture sensor and the car, allowing for immediate response to the user's gestures. This ensures a
seamless and interactive control experience.
Remote Control: Wireless connection eliminates the need for physical wires or cables, providing the
user with greater freedom to move and interact with the Hand Gesture Control Car from a distance.
Reliability: A stable and reliable wireless connection is essential to ensure consistent control of the
car based on the user's gestures. Signal strength, interference, and latency should be considered to
maintain reliable communication.
Range: The range of the wireless connection determines how far the user can control the car.
Depending on the technology used, the range may vary, so choosing the appropriate wireless protocol is
crucial for the project's requirements.

Motor Controlling:
After receiving gesture information from the sensor, motor control in a Hand Gesture Control Car
project involves translating the recognized gestures into specific commands to control the car's
movements.
Mapping Gestures to Actions: Each recognized gesture is mapped to a corresponding action or
movement command for the car, such as moving forward, backward, turning left or right, or stopping.
PWM Control: Pulse Width Modulation (PWM) signals are commonly used to control the speed of DC
motors in response to the gesture commands. By adjusting the duty cycle of the PWM signals, the
motors' speed and direction can be controlled.
H-Bridge Motor Driver: An H-Bridge motor driver, such as the L298N mentioned earlier, is often used
to interface with the motors and control their direction of rotation. By sending signals to the H-Bridge,
the motors can be driven forward or backward.
Microcontroller Integration: A microcontroller, such as TIVA or Arduino, processes the gesture
information and generates the corresponding motor control signals based on the recognized gestures.
These signals are then sent to the motor driver for execution.

Working:
We engineered a sophisticated system for wireless control of a car through gesture recognition. The
setup involved utilizing an ESP32 WROOM 32 module paired with an HC-05 Bluetooth module to
establish a reliable communication link for signal transmission. On the receiving end, another HC-05
module was interfaced with a TM4C123GH6PM microcontroller, which processed the incoming signals

University of Engineering and Technology, Lahore


to interpret corresponding gestures. These gestures were mapped to specific commands such as
forward, backward, left, or right movements to navigate the car in desired directions. The seamless
integration of Bluetooth technology facilitated the wireless transmission of signals between the
modules, ensuring real-time communication.

The ESP32 WROOM 32 paired with HC-05 module served as the transmitter, sending signals to the
HC-05 module connected to the TM4C123GH6PM microcontroller. This microcontroller implemented an
algorithm to encode the signals received and accurately determine the intended gestures. By translating
these gestures into actionable commands, the system effectively controlled the motor of the car,
enabling precise movement based on the recognized gestures. The robust communication protocol and
efficient processing capabilities of the microcontroller ensured smooth and responsive operation of the
gesture-controlled car, showcasing the seamless integration of hardware and software components in
this innovative project.

In the project's initial phase, the gyroscope utilized the x, y, and z axes to compute pitch and roll angles,
enabling the identification of specific movements or gestures. These calculated gestures were then
transmitted to the ESP32 WROOM 32 module, which encoded them into chosen alphabets.
Subsequently, the encoded alphabet signal was sent using the HC-05 Bluetooth module. On the
receiving end, another HC-05 module captured the transmitted signal and forwarded it to the
TM4C123GH6PM microcontroller. The microcontroller decoded the signal, interpreted the
corresponding gesture, and executed the relevant operation by activating specific pins to control the
direction of the motor to control the car accordingly. This seamless process showcased the integration
of sensor data processing, wireless communication, and motor control to enable gesture-based
manipulation of the car's movement.

Sender Side Code:


#include <Wire.h>
#include <Adafruit_MPU6050.h>
#include <Adafruit_Sensor.h>
#include <HardwareSerial.h>

Adafruit_MPU6050 mpu;
HardwareSerial BTSerial(2); // Use UART2 for the HC-05 (GPIO16 RX, GPIO17 TX)

University of Engineering and Technology, Lahore


#define SDA_PIN 21 // Connect MPU6050 SDA pin to GPIO 21 or pin D21 of ESP
#define SCL_PIN 22 // Connect MPU6050 SCL pin to GPIO 22 or pin D22 of ESP
#define POT_PIN 04 // Analog pin for potentiometer (GPIO4 on ESP32)

void setup() {
Serial.begin(9600); // Initialize Serial for debugging
BTSerial.begin(9600, SERIAL_8N1, 16, 17); // Initialize UART2 for HC-05 at 9600 baud rate

Wire.begin(SDA_PIN, SCL_PIN); // Initialize I2C communication with MPU6050

if (!mpu.begin()) {
Serial.println("Failed to initialize Adafruit MPU6050!");
while (1);
}

Serial.println("Adafruit MPU6050 and HC-05 Bluetooth initialized successfully.");


}

void loop() {
// Read the potentiometer value
int potValue = analogRead(POT_PIN); // Read the potentiometer value (0-4095 for 12-bit ADC)
int delayTime = map(potValue, 0, 4095, 500, 2000); // Map the potentiometer value to delay time
(500 to 2000 ms)

// Read MPU6050 data


sensors_event_t accelEvent, gyroEvent, tempEvent;
mpu.getEvent(&accelEvent, &gyroEvent, &tempEvent);

// Calculate pitch and roll


int pitch = -(atan2(accelEvent.acceleration.x, sqrt(accelEvent.acceleration.y *
accelEvent.acceleration.y + accelEvent.acceleration.z * accelEvent.acceleration.z)) * 180.0) / M_PI;
int roll = (atan2(accelEvent.acceleration.y, accelEvent.acceleration.z) * 180.0) / M_PI;

// Determine gesture based on pitch and roll


char gesture;

if (pitch > 10) {


gesture = 'F'; // Forward

University of Engineering and Technology, Lahore


} else if (pitch < -10) {
gesture = 'B'; // Backward
} else if (roll > 10) {
gesture = 'R'; // Right
} else if (roll < -10) {
gesture = 'L'; // Left
} else {
gesture = 'S'; // Stop or neutral
}

// Send gesture over HC-05 Bluetooth


BTSerial.write(gesture);
Serial.print("Sending gesture over Bluetooth: ");
Serial.println(gesture);

// Apply the delay based on the potentiometer value


delay(delayTime);
}

Receiver Side Code:


// This code is written by Group 6 for Embedded Systems 1 lab

#define RED_LED RED_LED


#define GREEN_LED GREEN_LED
#define BLUE_LED BLUE_LED

int pin_1 = PE_3; // initializing gpios for controlling motor directions


int pin_2 = PE_2;
int pin_3 = PE_1;
int pin_4 = PE_0;
int enA = PB_1; // gpios for PWM
int enB = PB_0;
int potPin = PD_3; // pin for accepting analog signal (for potentiometer)

void setup() {
// Initialize the onboard LEDs and GPIOs

University of Engineering and Technology, Lahore


pinMode(RED_LED, OUTPUT);
pinMode(GREEN_LED, OUTPUT);
pinMode(BLUE_LED, OUTPUT);
pinMode(pin_1, OUTPUT);
pinMode(pin_2, OUTPUT);
pinMode(pin_3, OUTPUT);
pinMode(pin_4, OUTPUT);
pinMode(potPin, INPUT);

// Initialize UART3 for communication with HC-05


Serial3.begin(9600);

// Start serial communication for debugging


Serial.begin(9600);
}

void loop() {
// Update PWM value based on potentiometer
int potValue = analogRead(potPin); // Read the potentiometer value (0-4095 for 12-bit ADC)
int pwmValue = map(potValue, 0, 4095, 0, 255); // Map the range to 0-255 for PWM

// Debugging: Print the potentiometer and PWM values


Serial.print("Potentiometer Value: ");
Serial.print(potValue);
Serial.print("\t PWM Value: ");
Serial.println(pwmValue);

analogWrite(enA, pwmValue); // Write PWM value to enA


analogWrite(enB, pwmValue); // Write PWM value to enB

if (Serial3.available()) {
char command = Serial3.read();
processCommand(command);
}
}

void processCommand(char command) {


switch (command) {

University of Engineering and Technology, Lahore


case 'L':
digitalWrite(pin_1, HIGH); // Set pins for Right command HIGH
digitalWrite(pin_2, LOW); // Ensure other pins are LOW
digitalWrite(pin_3, LOW);
digitalWrite(pin_4, LOW); //OPTIONAL
digitalWrite(RED_LED, LOW);
digitalWrite(GREEN_LED, LOW);
digitalWrite(BLUE_LED, HIGH);
break;
case 'F':
digitalWrite(pin_2, LOW); // Set pins for forward command
digitalWrite(pin_1, HIGH); // Ensure other pins are LOW
digitalWrite(pin_3, HIGH);
digitalWrite(pin_4, LOW);
digitalWrite(RED_LED, LOW);
digitalWrite(GREEN_LED, HIGH);
digitalWrite(BLUE_LED, LOW);
break;
case 'B':
digitalWrite(pin_4, HIGH); // Set pins for backward command HIGH
digitalWrite(pin_1, LOW); // Ensure other pins are LOW
digitalWrite(pin_2, HIGH);
digitalWrite(pin_3, LOW);
digitalWrite(RED_LED, HIGH);
digitalWrite(GREEN_LED, LOW);
digitalWrite(BLUE_LED, LOW);
break;
case 'R':
digitalWrite(pin_3, HIGH); // Set pins for left command HIGH
digitalWrite(pin_1, LOW); // Ensure other pins are LOW
digitalWrite(pin_2, LOW); //OPTIONAL
digitalWrite(pin_4, LOW);
digitalWrite(RED_LED, HIGH);
digitalWrite(GREEN_LED, HIGH);
digitalWrite(BLUE_LED, HIGH);
break;
case 'S':
digitalWrite(pin_3, LOW);

University of Engineering and Technology, Lahore


digitalWrite(pin_1, LOW);
digitalWrite(pin_2, LOW);
digitalWrite(pin_4, LOW);
digitalWrite(RED_LED, LOW);
digitalWrite(GREEN_LED, LOW);
digitalWrite(BLUE_LED, LOW);
break;
default:
// Do nothing for unrecognized commands
break;
}
}

Software Implementation:
ESP32 WROOM 32:
ESP32 WROOM 32 development can be done using the popular Arduino IDE, making it
accessible to a wide range of developers. Arduino IDE provides a user-friendly environment for
programming ESP32 WROOM 32 boards with its simplified coding structure. Developers can leverage
Arduino libraries and a vast community support to enhance their ESP32 projects on the WROOM 32
variant. The compatibility of Arduino IDE with ESP32 WROOM 32 simplifies the setup and coding
process for IoT and embedded projects. Arduino IDE offers a seamless integration with ESP32 WROOM
32, enabling rapid prototyping and development of diverse applications.
The ESP32 WROOM 32 initially receives sensor data from the MPU6050 accelerometer and gyroscope.
This data is used to calculate the pitch and roll angles representing the device's orientation. Based on
these angles, specific gestures such as forward, backward, left, right, or stop are determined. Once the
gestures are identified, the ESP32 WROOM 32 encodes this information into a specific alphabet or
character corresponding to each gesture. The encoded gesture data is then sent wirelessly through the
HC-05 Bluetooth module. The HC-05 module transmits the alphabet signals to the receiving end using
Bluetooth communication. On the receiving end, another HC-05 module captures the alphabet signals
and transfers them to the TM4C123GH6PM microcontroller. The TM4C123GH6PM reads the received
signals and interprets them to perform the corresponding operations. This process enables the
TM4C123GH6PM to activate specific pins controlling the direction of the motor,, translating the user's
gestures into actionable commands for motor control.
TIVA C Series:

University of Engineering and Technology, Lahore


Energia is an open-source electronics prototyping platform that enables programming for
Texas Instruments LaunchPad development kits, offering a simplified approach similar to the Arduino
IDE. With Energia, developers can easily code and debug projects for TI microcontrollers such as
MSP430 and Tiva C Series LaunchPads, fostering rapid development cycles.
On the other hand, KEIL provides a robust integrated development environment (IDE) primarily used for
coding and debugging ARM-based microcontrollers. KEIL's feature-rich environment offers advanced
debugging tools and optimizations to streamline embedded software development for various ARM
Cortex-M architectures.
While Energia focuses on simplicity and ease of use for TI LaunchPads, KEIL caters to more intricate
projects with its comprehensive toolset and support for ARM processors. Combining Energia for TI
LaunchPad development and KEIL for ARM microcontrollers provides a versatile ecosystem for creating
embedded systems with varying complexities.

Block Diagram:

Fig.7(Block Diagram)

PCB Formation:
PCB formation for a hand gesture car involves designing the printed circuit board (PCB) using software
like Proteus. This process requires meticulous planning, layout design, and component placement to
ensure the hand gesture car functions correctly. Designing a PCB for such a project involves a
significant amount of hard work in identifying and rectifying real-time errors that may arise during the
design phase. It includes multiple steps such as schematic design, PCB layout, routing, component

University of Engineering and Technology, Lahore


placement, and testing to ensure the PCB functions as intended. Each step in the formation process
plays a crucial role in the overall functionality and success of the hand gesture car project.

Fig.8(Schematic Diagram)

Fig.9(PCB Layout)

University of Engineering and Technology, Lahore


Fig.10(Printed Layout)

Testing and Results:


MPU6050 sensor:
The MPU6050 sensor was securely connected to the microcontroller board (e.g., ESP32 WROOM32) on
a breadboard following the wiring diagram provided in the sensor's datasheet. Essential libraries for
interfacing with the MPU6050 sensor, such as "Wire.h" and "MPU6050.h" were installed on the
microcontroller to facilitate communication with the sensor. A test code was developed to initialize the
MPU6050 sensor, read gyroscope data, and display the values on the serial monitor. The code utilized
MPU6050 library functions to retrieve gyroscope data along the X, Y, and Z axes. After uploading the
code to the microcontroller, the serial monitor in the Arduino IDE was opened to observe the gyroscope
readings. The sensor's response to rotations along different axes was monitored to ensure accurate
gyroscope data output. The sensor's consistency in responding to changes in orientation was confirmed
through thorough testing.
HC-05 Bluetooth Module:
The HC-05 module was connected to the microcontroller board, ensuring proper wiring for power,
ground, and communication. The module was paired with a smartphone device to establish a wireless
connection. Test code was written to enable serial communication between the microcontroller and the
HC-05 module. Data transfer tests were conducted to verify the module's ability to send and receive
information wirelessly. The module's functionality, including range, stability, and data integrity, was
evaluated to ensure reliable Bluetooth communication in the project.

L298N Motor Driver:


The L298N Motor Driver was connected to the microcontroller and motors as per the datasheet
guidelines. Proper power supply connections were ensured to drive the motors and the motor driver
effectively. Test code was written to control the speed and direction of the motors connected to the
L298N driver. The motors were run at various speeds and directions to validate the motor driver's
functionality. Current and voltage measurements were taken to ensure the motor driver was operating
within safe limits during testing.

Challenges and Solutions:


1. HC-05 Bluetooth Module.
The challenge we encountered while using the HC-05 Bluetooth module was that it
exhibited a behavior of continuously running on a single line instead of properly receiving

University of Engineering and Technology, Lahore


commands from the sender device. This made it challenging to receive user commands and
accurately interpret them for reading.
2. NRF24L01.
A common issue encountered while using the NRF24L01 wireless communication module is
Interference. One of the challenges is dealing with interference from other wireless devices
operating on similar frequencies, which can lead to signal disruptions and unreliable
communication.
3. Receiver end.
A problem commonly faced at the receiver end of a project can be signal loss. Signal loss due to
interference, distance, or obstacles can disrupt communication between the transmitter and
receiver, leading to incomplete or corrupted data reception. Ensuring a stable and reliable signal
reception is crucial to prevent this issue.
4. Motor Direction.
A common issue that can cause problems with motor directions is incorrect wiring. Incorrectly
wiring the motor driver to the motors or reversing the polarity can result in the motors spinning in
the wrong direction. Double-checking the wiring connections and ensuring they are properly
aligned can help resolve this problem.
5. Communication Protocol.
Initially faced challenges in selecting the appropriate communication protocol for the project.
After careful consideration,we decided to implement UART for reliable data transmission. Utilizing
UART proved effective in facilitating seamless communication between the devices involved in the
gesture recognition and motor control system.
6. Necessary Libraries.
Initially encountered difficulties in locating suitable libraries for the project requirements.
Through extensive research and perseverance, we eventually identified the necessary libraries. The
diligent effort invested in the search ultimately led to the discovery of the appropriate libraries,
enabling successful implementation of the project functionalities.

Solutions:

● HC-05 Issue Resolution:


○ Confirmed and adjusted the configuration settings of the HC-05 module to facilitate smooth
communication.

University of Engineering and Technology, Lahore


○ Ensured secure and accurate connections between the HC-05 module and the microcontroller or
other devices.
○ Utilized debugging tools to monitor data flow and pinpoint and resolve communication breakdowns.
○ Updated the firmware of the HC-05 module to the latest version for compatibility with the
connected devices.
● NRF24L01 Communication Issue Resolution:
○ Provided a stable power supply to the NRF24L01 module to minimize signal interference.
○ Aligned the address configurations on both the transmitter and receiver sides for seamless
communication.
○ Optimized antenna positioning to enhance signal strength and reception of the NRF24L01 modules.
○ Implemented data integrity checks and error correction mechanisms for ensuring reliable
communication.
○ We decided to use HC-05 Bluetooth module instead of NRF24L01
● UART Coding Issue Resolution:
○ Matched the baud rates on both the transmitter and receiver sides to establish effective
communication.
○ Integrated error handling mechanisms in the UART code to address unexpected data or
communication challenges.
○ Employed flow control protocols to regulate data flow between the transmitter and receiver for
improved communication.
● Motor Direction Control Issue Resolution:
○ Verified and corrected any wiring discrepancies between the motor driver and motors to ensure
proper alignment.
○ Adjusted the motor connections' polarity to rectify any incorrect motor spinning directions.
○ Configured the motor driver accurately to interpret control signals and steer motors in the
intended direction.
○ Thoroughly tested and calibrated the motor direction control system to ensure precise motor
responses to input commands.

Reference and Bill of Material:


● BT Based Voice\ Remote Controlled Car Using TIVA MC : 5 Steps (with Pictures) - Instructables
● TM4C129XNCZAD: How to enable UART1 ? - Arm-based microcontrollers forum

University of Engineering and Technology, Lahore


● https://github.com/MEDHAT-ALHADDAD/Gesture-controlled-wireless-Car
● ESP32 Pinout and ESP-WROOM-32 Pinout
● HC-05 Bluetooth Interfacing with TM4C123G Tiva C Launchpad – Keil uvision
● HC-05 Bluetooth Module Pinout
● L298N Motor Driver Module Pinout, Datasheet, Features & Specs
● Nano ESP32 | Arduino Documentation
● https://chat.openai.com/
● mpu 6050 arduino tutorial for beginners
● Testing HC05 module with Arduino

Bill of Materials

Sr No. Components Description Unit Qt Total Vendor Info Status


Price y

1 TIVA 32-bit 13000 1 13000 E-Pro (Shop Active


Microcontroller No.1A, Ground
floor, Al Khalil
(ARM Cortex) Center, 16 Hall
road Lahore)
(04237233587)

2 ESP32 32-bit 1150 1 1150 E-Pro (Shop Active


WROOM-32 Microcontroller No.1A, Ground
floor, Al Khalil
Center, 16 Hall
road Lahore)
(04237233587)

3 Motor Driver L298N (DC Motor 380 2 760 E-Pro (Shop 1-Active
Driver) No.1A, Ground 1-Not
floor, Al Khalil
Double H-Bridge Center, 16 Hall Used
Max Power(25W) road Lahore)
(04237233587)
(0-36mA)
(5-35V)

4 Gyroscope MPU6050 3-axis 400 1 400 IC Shop (16-A, Active


The IC shop,
Sensor gyroscope, 3-axis Kacha Hall Rd,
Data market,
accelerometer Lahore, Punjab
(3.9mA) 54000)
(3.3-5V) (0322 4401074)

University of Engineering and Technology, Lahore


5 Batteries 9V+3.7V(18650) 100 1 830 E-Pro (Shop 4-Active
(rechargeable) + + No.1A, Ground
floor, Al Khalil
(1500mAh) 180 4x Center, 16 Hall
road Lahore)
(04237233587)

6 Car Chassis Plastic Car 1750 1 1750 IC Shop (16-A, Active


The IC shop,
Chassis 4WD Kacha Hall Rd,
Data market,
Lahore, Punjab
54000)
(0322 4401074

7 Bluetooth HC-05 750 2 1500 E-Pro (Shop Active


Module (Voltage 4-6V) No.1A, Ground
floor, Al Khalil
(Range 100m) Center, 16 Hall
(Current 30mA) road Lahore)
(04237233587)

8 Breadboard MB102 210 1 210 E-Pro (Shop Inactive


(830 holes) No.1A, Ground
floor, Al Khalil
Center, 16 Hall
road Lahore)
(04237233587)

9 R-F Module 433Mhz R-F 200 1 200 E-Pro (Shop Inactive


module No.1A, Ground
floor, Al Khalil
(0.5-5V) Center, 16 Hall
(4mA) road Lahore)
(04237233587)

10 Motor Driver L293D(Dual H- 400 1 400 IC Shop (16-A, Inactive


The IC shop,
Bridge) Kacha Hall Rd,
Data market,
(600mA-1.2A) Lahore, Punjab
(4.5-36V) 54000)
(0322 4401074

11 Jumper Wires M2M, F2M, F2F 200 1 200 E-Pro (Shop Inactive
No.1A, Ground
⌀0.5mm floor, Al Khalil
Center, 16 Hall
road Lahore)
(04237233587)

12 Voltage 7805 Voltage 30 2 60 E-Pro (Shop Inactive


Regulator Regulator No.1A, Ground
floor, Al Khalil

University of Engineering and Technology, Lahore


Output(5V) Center, 16 Hall
road Lahore)
Input(7-35V) (04237233587)
(~1A)

13 Cell Holder 3-Cell Plastic 150 1 150 E-Pro (Shop Active


Holder No.1A, Ground
floor, Al Khalil
Center, 16 Hall
road Lahore)
(04237233587)

14 Battery Clip 9V Battery Clip 20 1 20 E-Pro (Shop Inactive


No.1A, Ground
floor, Al Khalil
Center, 16 Hall
road Lahore)
(04237233587)

15 PCB 13.5x8.4 cm 180 2 360 E-Pro (Shop 1-Active


PCB formation No.1A, Ground 1-wasted
floor, Al Khalil
with FeCl3 Center, 16 Hall
road Lahore)
(04237233587)

Grand Total - 20990 Active


/-- Material
Bill=
19340/-
-

University of Engineering and Technology, Lahore

You might also like