Bluetooth Controlled Robot Using Arduino and Android

When a group of engineers at Ericsson invented in 1994 the Bluetooth technology, probably no one could not have imagined the impact on connecting people and things. They don’t imagine that makes happy millions of makers. They don’t even know how happy the roboticists are. Anyone can use the technology to build a robot controlled at a touch of a button while nobody worries about wires.

Like many of you, I want to prototype things. Robots that make me happy. One of them is a remote controlled tank robot.

Let’s start to learn how to use the Bluetooth technology to control the speed and direction of a tank robot platform at a touch of a button.

The hardware parts

The key part of this project is the Bluetooth module. Since I use an Arduino UNO, I need a Bluetooth module Arduino compatible. A few months ago, I wrote an article about the Bluetooth modules Arduino compatible with a range of several meters.

Since I have to be in a proximity area to control the robot, a Bluetooth module with a range of 5 meters is enough. I don’t have large rooms in my apartment, so any of these wireless modules can reach this range.

For this project, I use an HC-06 Bluetooth module. This is a slave module that works perfectly with Arduino UNO.

Next, I have to focus on the mobile platform.

The robot tank is a hacked TS – 50 Mini Bluetooth Tank Robot Smart Car Kit. I remove the original Bluetooth module (a Keyestudio Bluetooth module) and the servo motor with the ultrasonic sensor. I don’t need these parts anymore.

The motor driver is a Keyestudio shield with an L298P H-Bridge. You can use any driver capable of feeding the DC motors.

Most motor drivers use two pins for directions of a DC motor. The Keyestudio motor drive shield uses one pin for the direction of the motor.

If you will use a motor driver with two pins to set the direction of a DC motor, you have to add two more lines in the Arduino sketch.

My Arduino code is like this:

The code for two pins to set the direction of a DC motor should be like this:

The kit has two rechargeable 3.7V Li-Ion batteries. These two batteries can feed the DC motors, the motor driver, the Arduino board and the HC-06 Bluetooth module.

How to connect the Bluetooth module and Arduino

The motor driver shield doesn’t complicate the connection between Arduino UNO and HC-06. I use four male-to-male jumper wires to setting up the hardware.

I connect the VCC pin to the 3.3V output on the Arduino board, the GND pin to a GND pin of the Arduino, the TX pin of the Bluetooth module to pin 9 of Arduino UNO, and the RX pin of HC-06 to pin 10 of the Arduino board.

This is how the connection looks:

The Android application

The remote control is an Android smartphone. The commands that I sent from the smartphone is usually done via an Android application. The application is designed to enable the Bluetooth features of the device and make the connection with the Bluetooth module attached to the robot.

I use the same Android application that I used to control a servo motor with a Bluetooth module, Arduino, and Android. It is called Arduino Bluetooth Controller.

You can download the Android application for free. Open the application, scan for Bluetooth devices, enter the PIN number of the Bluetooth module and make the connection between smartphone and robot.

For this tutorial, I use in application the “Controller Mode” for commands.

I set up the application to send commands like “1” to move forward, “2” to move backward, “3” to move left, and “4” to move the robot tank to the right.

The Arduino sketch

The Arduino sketch is simple and uses four blocks to control forward, backward, left and right the robot tank. The default case is to stop the robot.

Share:

Related Posts

Don't Miss Out!

Get the latest news, tutorials, reviews and more direct to your inbox when you subscribe!