Arduino Bluetooth Car

by Ramatronics Laboratory in Circuits > Arduino

22082 Views, 50 Favorites, 0 Comments

Arduino Bluetooth Car

IMG_20220813_121248.jpg
IMG_20220813_151557.jpg
IMG_20220813_120654.jpg
IMG_20220813_120728.jpg
IMG_20220813_120808.jpg
IMG_20220813_121248.jpg
Arduino Blutooth Car_bb_page-0001.jpg

In this project we are going to make a bluetooth Controlled Robot Car using Arduino. Although remote controlled robot cars that are available in the market are controlled by an RF remote, But this is the time of android phones. So I decided to make a wireless bluetooth controlled robot car with arduino. To control this robot car we do not require any kind of RF remote, This car can be controlled by any one that uses android phone. So let's make this awesome project.

Supplies

IMG_20220813_145515_1.jpg
IMG_20220813_144649.jpg
IMG_20220813_143406.jpg
IMG_20220813_144310.jpg
IMG_20220813_143902.jpg
IMG_20220813_144358.jpg


List of the hardware to make this project.


http://www.quartzcomponents.com

  1. Arduino UNO

https://quartzcomponents.com/products/arduino-uno-r3-atmega328p-arduino-compatible-no-cable?_pos=2&_sid=659b2f70c&_ss=r

  1. Adafruit Motor Shield

https://quartzcomponents.com/search?type=product&q=motor+shied

  1. 4-Gear Motors

https://quartzcomponents.com/products/dual-shaft-dc-geared-motor-300-rpm?_pos=1&_sid=afc7b413b&_ss=r

  1. 4-Wheels

https://quartzcomponents.com/products/robot-wheel-65mm-for-dc-geared-motor-pack-of-2?_pos=3&_sid=fbe7b7e34&_ss=r

  1. HC-05 Bluetooth Module

https://quartzcomponents.com/products/hc-05-bluetooth-module?_pos=2&_sid=1c56fff69&_ss=r

  1. 3-Li-ion Batteries

https://quartzcomponents.com/products/18650-li-ion-2600mah-rechargeable-battery-hongli?_pos=5&_sid=d0598844a&_ss=r

  1. Switch

https://quartzcomponents.com/products/2-pin-spst-on-off-mini-rocker-switch-2a-250v?_pos=3&_sid=ee946d931&_ss=r

  1. Jumper wires (female to female)

https://quartzcomponents.com/products/male-to-female-connecting-wires-jumper-wires-set-of-10?_pos=2&_sid=bc93fa0b6&_ss=r

  1. Ribbon Wire

https://quartzcomponents.com/products/ribbon-cable-multi-strand-cable-1-meter?_pos=1&_sid=d19c2f948&_ss=r

  1. MDF Board

not available

  1. USB cable (that arduino Uno supports)

https://quartzcomponents.com/products/arduino-uno-programming-cable?_pos=5&_sid=3c9516795&_ss=r

  1. Fevicol (glue)

https://quartzcomponents.com/products/hot-melt-glue-gun-100w?_pos=2&_sid=56651f388&_ss=r

  1. Double Sided Tape

https://quartzcomponents.com/products/white-sponge-double-sided-acrylic-foam-adhesive-tapes?_pos=3&_sid=02fc4724d&_ss=r

  1. an Aluminum L-shaped strip with an screw

Cut a Small Sheet From MDF

In step first, we cut the MDF board to get a smaller rectangular sheet of MDF with area(15cm X 10cm). After this we drill two holes on this sheet to pass the wires from lower side to upper side.

Soldering Wires to Gear Motors

In step 2, we cut 8, 5cm long wires from ribbon wire cable and solder these wires to the terminal of gear motors.

Fixing Gear Motors on MDF Sheet

IMG_20220813_142715.jpg
IMG_20220813_142748.jpg
IMG_20220813_142638.jpg

In step 3, we fix the gear motors on the 15x10 MDF sheet with Glue or Fevicol. we can take the help of given image to know how to fix the motors on the sheet.

Connecting Arduino Uno and Motor Shield Together

IMG_20220813_145515_1.jpg
IMG_20220813_145454_1.jpg

In step 4, we fix the Adafruit motor shield on the Arduino Uno as shown in the given picture.

Placing Arduino Uno and Motor Shield on Chassis

IMG_20220813_145900_1.jpg
IMG_20220813_145920_1.jpg

In step 5, we fix the Arduino and Adafruit motor shield on the chassis with the help of double sided tape as shown in the above images.

Connecting Gear Motors to Motor Shield

IMG_20220813_150124.jpg
IMG_20220813_150337.jpg

In step 6, we connect the wires of the gear motors to Adafruit motor shield. For this we also need an screw driver to rotate the screws of the terminal blocks. you can take the help of circuit diagram or the given images to make proper connections between gear motors and Adafruit motor shield.

Mounting the Battery Pack

IMG_20220813_150545.jpg
IMG_20220813_150821_1.jpg

In step 7, we fix the battery pack on the chassis with the help of double sided tape. we also solder the +Ve wire of the battery pack to one of the terminal of the on-off switch and take another piece of wire and solder its one end with the second remaining terminal of the switch and another end is connected the the +Ve supply pin of the motor shield.

further connect the -Ve wire of the battery pack to the -ve supply terminal of the motor shield. As shown in the given image.

Mounting the HC-05 Module

IMG_20220813_151411.jpg

In step 8, we fix the L-shaped aluminum on the chassis with the help of an screw and screw driver. After the attach our HC-05 bluetooth module to it with the help of double sided tape, we connect the HC-05 module with adafruit motor shield using jumper wires, as shown.

Connectiong Wheels to Car

IMG_20220813_120946_1.jpg
IMG_20220813_121014_1.jpg

In step 9, we connects the 4 wheels to the shafts of the gear motors as shown in the images

Programming

IMG_20220813_152643.jpg

In this last step we have to program the arduino Uno board with Arduino IDE so we connect our robot car to laptop or computer with an USB cable. Before uploading the sketch on the Uno board we remove the two jumper wires that is connected to the TX. and RX. pin of the arduino Uno. It is necessary otherwise our arduino IDE gives us a programming error. After successfully uploading the ketch, again connect the two wires(that we have removed) on their places. Now our Bluetooth car is ready to test and the only thing that is remained is to install the Bluetooth Car app in our android phone from play store. After installing the app on your android phone, switch on the power button of your robot car and turn on the Bluetooth of your android phone and pair it with the Bluetooth of our Car and after pairing with the Bluetooth now Everything is ready.

Downloading the Android App From Google Play Store

Screenshot (39).png
Screenshot (40).png
Screenshot (41).png

To operate the bluetooth car with android phone. we need to download an app form the google play store. After downloading the app install it in your android phone.

Link: https://play.google.com/store/apps/details?id=braulio.calle.bluetoothRCcontroller

Code

#include <AFMotor.h>

AF_DCMotor motor1(1, MOTOR12_1KHZ);
AF_DCMotor motor2(2, MOTOR12_1KHZ);
AF_DCMotor motor3(3, MOTOR34_1KHZ);
AF_DCMotor motor4(4, MOTOR34_1KHZ);

char command;

void setup()
{
Serial.begin(9600);
}

void loop(){
if(Serial.available() > 0){
command = Serial.read();
Stop();
switch(command){
case 'F':
forward();
break;
case 'B':
back();
break;
case 'L':
left();
break;
case 'R':
right();
break;
}
}
}

void forward()
{
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 back()
{
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()
{
motor1.setSpeed(255);
motor1.run(BACKWARD);
motor2.setSpeed(255);
motor2.run(BACKWARD);
motor3.setSpeed(255);
motor3.run(FORWARD);
motor4.setSpeed(255);
motor4.run(FORWARD);
}

void right()
{
motor1.setSpeed(255);
motor1.run(FORWARD);
motor2.setSpeed(255);
motor2.run(FORWARD);
motor3.setSpeed(255);
motor3.run(BACKWARD);
motor4.setSpeed(255);
motor4.run(BACKWARD);
}

void Stop()
{
motor1.setSpeed(0);
motor1.run(RELEASE);
motor2.setSpeed(0);
motor2.run(RELEASE);
motor3.setSpeed(0);
motor3.run(RELEASE);
motor4.setSpeed(0);
motor4.run(RELEASE);
}