Bluetooth-Controlled Car With HC-05 Module

by Ameya Angadi in Circuits > Arduino

42 Views, 0 Favorites, 0 Comments

Bluetooth-Controlled Car With HC-05 Module

Cover_Photo-Copy.jpg

Build a car that can be controlled wirelessly via a smartphone using Bluetooth communication.

Supplies

  1. Arduino Uno
  2. HC-05 Module
  3. 12V Rechargeable Battery
  4. White LED
  5. Geared DC Motor
  6. L298N Motor Driver
  7. Jumper Wires

ATTACH MOTORS TO THE BASE

3ded00a3-463d-4431-9785-63391e7dca37.jpg

Attach the motors as shown above

ATTACH ALL THE BOARDS TO THE BASE

703d68dd-8e3d-4682-9ccc-6666b6d6ec45.jpg

Attach the boards according to space available

UPLOAD THE CODE

NOTE - It is advised that Bluetooth module should be attached to Arduino board after uploading code to avoid errors and prevent possible damage to Bluetooth module.

MAKE ALL THE CONNECTIONS

e2bd7838-f0f8-40db-a0f8-d45f28590b00.jpg

Follow the circuit diagram and make all the connections

ATTACH LIGHTS (OPTIONAL)

SELECTING BATTERIES

I have used 3 x 4 volts rechargeable batteries(lead acid) attached in series for powering the project, in case if the project does not work properly try attaching an additional 9 volts battery to the Arduino through the dc jack.

General Instructions

NOTE - If your car powers on and connects to the app but doesn't move (or only turns left and right but not forward or reverse), then the battery might not be providing sufficient power. Please check the battery and replace it with a fully charged one if necessary.

Additionally, ensure all connections are secure and the Bluetooth module is properly paired with your smartphone.

Default name for Bluetooth module is " HC-05 ".

Default password for Bluetooth module is " 0000 " or " 1234 ".


Download the Arduino Car Connect App to control the car via Bluetooth - Click Here To Download

(Sorry, the app is not available on the Google Play Store, kindly download the apk file and install the app.)

(The app is designed on MIT App Inventor and is safe to use.)

(Alternatively, You can download other apps from Play Store, but you will need to change some settings for the car to work.)

TESTING

a) Power on the car.

b) Open the Arduino Car Connect App.

c) Click on the connect button.

d) Press the direction/light buttons to control the car.

Watch the Video:

Bluetooth car with Arduino Uno

For step-by-step instructions about the Arduino Car Connect App and the Car Demo, check out my YouTube video and follow along as we bring this Bluetooth Car to life!

Code

/* BLUETOOTH CAR WITH ARDUINO UNO AND HC-05

THIS CODE DEMONSTRATES CONTROLLING A CAR VIA SMARTPHONE USING BLUETOOTH COMMUNICATION.

NOTE-IT IS ADVISED THAT BLUETOOTH MODULE SHOULD BE ATTACHED TO ARDUINO BOARD AFTER
UPLOADING CODE TO AVOID ERRORS AND PREVENT POSSIBLE DAMAGE TO BLUETOOTH MODULE.

CODE CREATED BY - AMEYA ANGADI
LAST MODIFIED ON - 26/07/2024
VERSION - 1.3
*/

#define led1 = 13
#define in1 = 12
#define in2 = 11
#define in3 = 10
#define in4 = 9

void setup() {
Serial.begin(9600);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
pinMode(12, OUTPUT);
pinMode(13, OUTPUT);
}

void loop() {
if (Serial.available() > 0) {
char inputvalue = char(Serial.read());
if (inputvalue == 'F') {
digitalWrite(12, HIGH);
digitalWrite(11, LOW);
digitalWrite(10, HIGH);
digitalWrite(9, LOW);
}
else if (inputvalue == 'B') {
digitalWrite(12, LOW);
digitalWrite(11, HIGH);
digitalWrite(10, LOW);
digitalWrite(9, HIGH);
}

else if (inputvalue == 'R') {
digitalWrite(12, LOW);
digitalWrite(11, LOW);
digitalWrite(10, HIGH);
digitalWrite(9, LOW);
}

else if (inputvalue == 'L') {
digitalWrite(12, HIGH);
digitalWrite(11, LOW);
digitalWrite(10, LOW);
digitalWrite(9, LOW);
}

else if (inputvalue == 'C') {
digitalWrite(12, LOW);
digitalWrite(11, HIGH);
digitalWrite(10, HIGH);
digitalWrite(9, LOW);
}

else if (inputvalue == 'A') {
digitalWrite(12, HIGH);
digitalWrite(11, LOW);
digitalWrite(10, LOW);
digitalWrite(9, HIGH);
}

else if (inputvalue == 'O') {
digitalWrite(13, HIGH);
}

else if (inputvalue == 's') {
digitalWrite(13, LOW);
}

else if (inputvalue == 'S') {
digitalWrite(12, LOW);
digitalWrite(11, LOW);
digitalWrite(10, LOW);
digitalWrite(9, LOW);
}
}
}

Downloads

Circuit Diagram

ad02652d-b633-4a54-b11f-fe846c076baf.png