0% found this document useful (0 votes)
16 views

CODE

This document describes a project to build a Bluetooth-controlled car using an Arduino Uno. It outlines the hardware components needed, including an Arduino Uno, motor driver, DC motors, Bluetooth module, and chassis. It provides steps for assembling the car, writing code to control it via Bluetooth commands, and testing the functionality. The car can be controlled wirelessly to move forward, backward, left, and right. The conclusion states the project was successfully completed and demonstrates using Arduino and Bluetooth for remote control. Future work possibilities include enhanced controls, mobile app integration, sensor integration, and more.

Uploaded by

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

CODE

This document describes a project to build a Bluetooth-controlled car using an Arduino Uno. It outlines the hardware components needed, including an Arduino Uno, motor driver, DC motors, Bluetooth module, and chassis. It provides steps for assembling the car, writing code to control it via Bluetooth commands, and testing the functionality. The car can be controlled wirelessly to move forward, backward, left, and right. The conclusion states the project was successfully completed and demonstrates using Arduino and Bluetooth for remote control. Future work possibilities include enhanced controls, mobile app integration, sensor integration, and more.

Uploaded by

Venu Venupk1431
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

“BLUETOOTH CAR USING ARDUINO UNO”

NAME USN
VENU PK 22BBTCS375
AKSHAY KUMAR A 22BBTCS359
CHANDANA 22BBTCS363
RAKSHITHA S 22BBTCS371

KEY WORDS :
1. **Arduino Uno

2. **Bluetooth Module

3. **SoftwareSerial Library

4. **AT commands

5. **Serial Communication

6. **Bluetooth Pairing

7. **Bluetooth Serial Terminal

8. **Arduino Code

9. **Connections

10. **Data Format

INDRADUCTION
It seems like you're asking about using Arduino Uno for interfacing with Bluetooth. If you're
looking to establish a Bluetooth connection with Arduino Uno, you can use a Bluetooth
module like HC-05 or HC-06. Here's a basic guide on how to set it up:

1. **Hardware Setup:**

1
- Connect the Bluetooth module to the Arduino Uno. Usually, this involves connecting
VCC to 5V, GND to GND, TX of Bluetooth to RX of Arduino, and RX of Bluetooth to TX
of Arduino. Note: RX of one device connects to TX of the other and vice versa.

2. **Programming:**

- Write a sketch (Arduino program) to communicate with the Bluetooth module. You will
need to use the SoftwareSerial library to create a software serial port for communication
because the hardware serial port (pins 0 and 1) is typically used for uploading sketches and
debugging.

OBJECTIVES
1. **Wireless Communication

2. **Remote Control

3. **Data Logging and Monitoring

4. **Robotics

5. **Wearable Devices

6. **Home Automation

METHODOLOGY
Hardware Components:
1. **Arduino Uno**: The microcontroller that will control the car.
2. **Motor Driver**: To control the motors of the car. L298N or L293D are commonly used.
3. **DC Motors**: For driving the wheels of the car.
4. **Bluetooth Module**: HC-05 or HC-06 are commonly used for Bluetooth
communication.
5. **Power Source**: Batteries or a power supply to provide power to the Arduino and
motors.
6. **Chassis and Wheels**: The physical structure of the car
Assembly:
1. **Connect the Motors to the Motor Driver**: Connect the DC motors to the motor driver
according to the datasheet or pinout of your specific motor driver.
2. **Connect Motor Driver to Arduino**: Connect the motor driver's control pins to the
Arduino's digital output pins.

2
3. **Connect Bluetooth Module**: Connect the TX pin of the Bluetooth module to the RX
pin of the Arduino and vice versa. Also, connect the VCC and GND pins appropriately.
4. **Power Supply**: Connect the power source to the Arduino and the motor driver. Make
sure to provide enough power for both the Arduino and the motors.
Programming:
1. **Install Arduino IDE**: Download and install the Arduino IDE from the official website.
2. **Write the Arduino Sketch**: Write the code to control the car. This includes initializing
pins, setting up serial communication for Bluetooth, and interpreting incoming commands.
3. **Test the Code**: Upload the code to the Arduino and test basic functionalities to ensure
everything works as expected.
Bluetooth Communication:
1. **Pair the Bluetooth Module**: Pair your Bluetooth module with your computer or
smartphone. The default pairing code is often '1234' or '0000'.
2. **Send Commands**: Use a Bluetooth terminal app on your smartphone or write a simple
program on your computer to send commands (like 'F' for forward, 'B' for backward, 'L' for
left, 'R' for right) to the Arduino via Bluetooth.

Finalization:
1. **Mount Components**: Securely mount all components onto the chassis of the car.
2. **Test the Car**: Test the car's movement and Bluetooth control to ensure everything is
functioning correctly.
3. **Optimization and Refinement**: Fine-tune the code and hardware as necessary for
better performance and usability.

By following these steps, you should be able to create a basic Bluetooth-controlled car using
an Arduino Uno. Remember to refer to datasheets, tutorials, and examples specific to your
components for detailed guidance.

RESULT AND CONCLUSION


**Result:**
The Bluetooth car project using Arduino Uno has been successfully completed. The car is
controlled wirelessly via a Bluetooth connection from a smartphone or any other Bluetooth-
enabled device. The car can move forward, backward, turn left, and turn right based on the
commands received from the Bluetooth controller.

3
**Conclusion:**
This project demonstrates the integration of hardware components with software
programming to create a simple yet effective Bluetooth-controlled car. By utilizing Arduino
Uno's versatility and the ease of Bluetooth communication, we were able to build a remote-
controlled car that can be operated from a considerable distance wirelessly.

CODE
#include <SoftwareSerial.h>
SoftwareSerial BTSerial(2, 3); // RX | TX
// Motor A
int motor1Pin1 = 4; // Pin 2 on L298N
int motor1Pin2 = 5; // Pin 7 on L298N
int enableMotor1Pin = 6; // Pin 1 on L298N
// Motor B
int motor2Pin1 = 7; // Pin 10 on L298N
int motor2Pin2 = 8; // Pin 15 on L298N
int enableMotor2Pin = 9; // Pin 9 on L298N
char command;
void setup() {
// Define the pins as outputs
pinMode(motor1Pin1, OUTPUT);
pinMode(motor1Pin2, OUTPUT);
pinMode(enableMotor1Pin, OUTPUT);
pinMode(motor2Pin1, OUTPUT);
pinMode(motor2Pin2, OUTPUT);
pinMode(enableMotor2Pin, OUTPUT);
// Set the motor control pins to default values (stop)
digitalWrite(motor1Pin1, LOW);
digitalWrite(motor1Pin2, LOW);
digitalWrite(motor2Pin1, LOW);
digitalWrite(motor2Pin2, LOW);

4
analogWrite(enableMotor1Pin, 0);
analogWrite(enableMotor2Pin, 0);
// Set up Serial communication via Bluetooth
BTSerial.begin(9600);
}
void loop() {
if (BTSerial.available()) {
command = BTSerial.read();
// Control the motors based on the command received
switch (command) {
case 'F': // Forward
digitalWrite(motor1Pin1, HIGH);
digitalWrite(motor1Pin2, LOW);
digitalWrite(motor2Pin1, HIGH);
digitalWrite(motor2Pin2, LOW);
analogWrite(enableMotor1Pin, 255);
analogWrite(enableMotor2Pin, 255);
break;

case 'B': // Backward


digitalWrite(motor1Pin1, LOW);
digitalWrite(motor1Pin2, HIGH);
digitalWrite(motor2Pin1, LOW);
digitalWrite(motor2Pin2, HIGH);
analogWrite(enableMotor1Pin, 255);
analogWrite(enableMotor2Pin, 255);
break;
case 'L': // Left
digitalWrite(motor1Pin1, LOW);

5
digitalWrite(motor1Pin2, HIGH);
digitalWrite(motor2Pin1, HIGH);
digitalWrite(motor2Pin2, LOW);
analogWrite(enableMotor1Pin, 255);
analogWrite(enableMotor2Pin, 255);
break;
case 'R': // Right
digitalWrite(motor1Pin1, HIGH);
digitalWrite(motor1Pin2, LOW);
digitalWrite(motor2Pin1, LOW);
digitalWrite(motor2Pin2, HIGH);
analogWrite(enableMotor1Pin, 255);
analogWrite(enableMotor2Pin, 255);
break;
case 'S': // Stop
digitalWrite(motor1Pin1, LOW);
digitalWrite(motor1Pin2, LOW);
digitalWrite(motor2Pin1, LOW);
digitalWrite(motor2Pin2, LOW);
analogWrite(enableMotor1Pin, 0);
analogWrite(enableMotor2Pin, 0);
break;
}
}
}

SCOPE OF FUATURE WORK


The scope of future work for a Bluetooth-enabled car using an Arduino Uno can be quite
extensive and exciting. Here are some potential areas you could explore:

6
1. **Enhanced Control Mechanisms**: Develop more advanced control mechanisms for the
car, such as implementing PID controllers for smoother operation or integrating sensor data
for autonomous navigation.
2. **Mobile App Integration**: Create a companion mobile app that communicates with the
Arduino Uno via Bluetooth, allowing users to control the car remotely, monitor its status, or
even stream live video from an onboard camera.
3. **Sensor Integration**: Integrate various sensors like ultrasonic sensors for obstacle
detection, IR sensors for line following, or GPS modules for navigation and tracking.
4. **Data Logging and Analysis**: Implement data logging functionality to record sensor
data, motor performance metrics, and other relevant information for analysis and
optimization purposes.
5. **Machine Learning**: Explore machine learning techniques to enhance the car's
capabilities, such as using neural networks for object recognition or reinforcement learning
for autonomous decision-making.
6. **Wireless Communication**: Experiment with different wireless communication
protocols besides Bluetooth, such as Wi-Fi or LoRa, to extend the range or improve the
reliability of communication.
7. **Power Management**: Optimize power consumption and explore alternative power
sources like rechargeable batteries or solar panels to extend operating time.

You might also like