Arduino Bluetooth controlled Robot using L298n Motor Driver Android App

(Last Updated On: July 9, 2019)

Bluetooth controlled Robot

Description:

Bluetooth Controlled Robot- In this Tutorial, you will learn how to make an Arduino Bluetooth controlled Robot Car using L298N Motor Driver and An Android Cell Phone Application.

The application is designed in Android studio, with the help of this application the Robot car can be wirelessly controlled using your Android Cell Phone. The Application Download link is given below. This project is based on my previous two tutorials.


Bluetooth Arduino: Pin Code and Name changing using AT commands

Bluetooth controlled Robot

https://www.electroniclinic.com/bluetooth-arduino-pin-code-and-name-changing-using-at-commands/

In this tutorial, I explained how to change the name of the Bluetooth module and how to change the Pin code or password using the AT commands. This Tutorial covers everything you want to learn about the HC-05 Bluetooth Module. If you are using a Bluetooth module for the first time then I highly recommend you should watch this Tutorial.

Arduino L298N Motor Driver Interfacing and Programming:

 

While in this project I explained, how to assemble the robot parts and how to use the L298N motor driver to control the forward, Left, Right, and Reverse movement. In this tutorial, I also explained how to control the speed of a dc motor using the pulse width modulation. If you are a beginner and you have never used the Bluetooth module and L298N motor driver then I recommend you should first watch these tutorials and then you can resume from here.


In this Tutorial based on the Bluetooth Controlled Robot, I will only talk about the modifications which are

  1. Bluetooth module (HC-05) interfacing with Arduino
  2. Arduino Programming and finally number
  3. Testing

Let’s get started!!!!

The components and tools used in this project can be purchased from Amazon, the components Purchase links are given below:

Arduino Uno: https://amzn.to/2tVz1vu
Mega 2560: https://amzn.to/2ze1kdu
Robot Car chassis kit: https://amzn.to/2tTpkgo
L298N dual H-Bridge motor driver: https://amzn.to/2XF4sam
Bluetooth Module: Hc-05: https://amzn.to/2CMHNiN
9v battery: https://amzn.to/2EXlhWS
330 ohm resistors pack: https://amzn.to/2NtlAeh
5v 2A adaptor: https://amzn.to/2GsNfcw
2n2222 npn transistors: https://amzn.to/2EmXsIb
10k Resistor: https://amzn.to/2KTd6OW
lm7805 Voltage Regulator: https://amzn.to/2IZEl5x
330-ohm resistors pack: https://amzn.to/2NtlAeh
female DC power jack socket: https://amzn.to/2KEo1gt
470 uf capacitors: https://amzn.to/2xDCOzf
5×7 cm vero board: https://amzn.to/2OHGbvn
female headers: https://amzn.to/2zqmtiJ
connection wires: https://amzn.to/2DpBuW7
Super Starter kit for Beginners: https://amzn.to/2KJvmKG
Jumper Wires: https://amzn.to/2KMoVXs
Bread Board: https://amzn.to/2MS4q8X
12v Adaptor: https://amzn.to/2Ntr6h1
PCB plate: https://amzn.to/2IUwpCt
Variable Supply: https://amzn.to/2MT4Qfj
Digital Multimeter: https://amzn.to/2Nvft9i
Vero Board / strip board: https://amzn.to/2MTf9jD
Soldering iron kit: “best” You guys should definitely purchase this: https://amzn.to/2zfoNuJ
Solder wire: https://amzn.to/2ufUMWf
Wire Stripper: https://amzn.to/2KOqxfU
wire cutter: https://amzn.to/2ucIq14
PCB small portable drill machine: https://amzn.to/2Nu62XF

Bluetooth Controlled Robot Interfacing:

Bluetooth controlled Robot

All the connections are exactly the same as explained in my previous tutorials the links are given above. The only modification that I did is the addition of the HC-05 Bluetooth module.

The connections are explained in the Video, which is given at the end.

The VCC wire of the Bluetooth module is connected with the 5 volts.

The green wire is the ground wire and is connected with the Arduino’s ground.

The white wire is the TX wire and is connected with pin number 2 of the Arduino.

The yellow wire is the Rx wire and is connected with the Arduino’s pin number 3.


Bluetooth controlled Robot

During the testing, I used a 12v adaptor over here. This is the DC female Power Jack. after I am satisfied with the testing then I will simply disconnect the 12v adaptor and turn on this button



Bluetooth controlled Robot

And will use batteries to power up the robot car. For the complete explanation, you can watch a video tutorial given at the end of this Article. Now let’s have a look at the programming.

Download Application: robot


Bluetooth Controlled Robot Arduino Programming:

This is the modified version of the code which I used in my previous tutorial “Arduino L298N dc motor control code” Link to the video Tutorial is given Above.  In this project, I added the softwareserial.h which is a header file specially created for making multiple serial ports. As you know in Arduino we have only one serial port which is on pin number 0 and pin number 1, which are the RX and TX pins, as I always say never use the Arduino’s default serial port for the communication with other modules, use the Arduino’s default serial port only for the debugging purposes. We can use the SoftwareSerial library to create another Serial port.

I defined some commands, 92 means forward, 79 means left, 71 means right, 91 means reverse and 10 means stop. These are the commands which the android application will send to the Arduino.


if the Bluetooth module hasn’t received any data/command from the android cell phone application then simply stay here and wait for the command.

if the Bluetooth module has received data from the android cell phone application, then simple store that data in variable data. Then the received command is compared with all the predefined commands and turn on and turn off the motors accordingly



 

Other Related Projects:

Wireless Joystick controlled Robot Car using Arduino, 433Mhz RF, and L298N Motor Driver

https://www.electroniclinic.com/wireless-joystick-controlled-robot-car-using-arduino-433mhz-rf-and-l298n-motor-driver/

Arduino IOT Project: Nodemcu ESP8266 wifi Robot Car “L298N motor driver + Blynk + Joystick”

https://www.electroniclinic.com/arduino-iot-project-nodemcu-esp8266-wifi-robot-car-l298n-motor-driver-blynk-joystick/

Safe distance maintaining Car to Avoid accident using Ultrasonic Sensor

https://www.electroniclinic.com/safe-distance-maintaining-car-to-avoid-accident-using-ultrasonic-sensor/

Arduino Bluetooth controlled Robot Car using L298n Motor Driver & Android App

Watch Video Tutorial:

Recommended For You

About the Author: Engr Fahad

My name is Shahzada Fahad and I am an Electrical Engineer. I have been doing Job in UAE as a site engineer in an Electrical Construction Company. Currently, I am running my own YouTube channel "Electronic Clinic", and managing this Website. My Hobbies are * Watching Movies * Music * Martial Arts * Photography * Travelling * Make Sketches and so on...

Leave a Reply