Bluetooth Control RC Tank + Android + Arduino


17,967

39

23

Just another person who loves making DIY project.

May peace be upon you

This is my first instructable. It is about controlling your rc tank via bluetooth instead of using radio frequency. There are many project like this but this is my way. hahaha

I started to think that I am so lazy to bring the controller of the rc tank. So I got the idea to make one that can be controlled by my smartphone. The big advantage is that you can add whatever feature to your tank and the smartphone is the thing you bring anywhere anytime.

Here are the main things that I used.

1) Bluetooth module HC-06

2) L298N Motor driver

3) Arduino Uno or Nano

4) RC Tank

5) smartphone with bluetooth

6) Android Controller app

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Preparing Android Application

By using MIT App Inventor, I have build a simple application that send a command in ASCII to the Arduino via Bluetooth. The app use of canvas, image, label, button, clock and bluetooth connectivity. It consists of 13 different command image (canvas).

As we press and hold the command image (canvas), the data is send until we release it. The data is then compared with the Arduino coding. If the data is same, then an action is taken. If not same, no action taken.

download the app below and install it on your phone.

jeneral.apk

and if you want to add some more features, you can download .aia format below. Open the MIT App Inventor and import the folder.

AndruinoBlu.aia

Step 2: Remove the Existance Circuit

Carefully remove the circuit inside the tank. But be sure that you labelled them first as they might be use in the future. For easier, take the picture of the circuit connection.

Step 3: The Arduino Circuit

Note that as I read through some websites, the Pin Rx of the Arduino should be connected to voltage divider first to get a value about 3.3V before connect it to Tx of the Bluetooth module. But I have directly connect them together and until now there is no problem happen yet... wahahha

For testing, you can replace the motor with LED or other output.

Step 4: Pairing Smartphone With Bluetooth Module

After connected all the wires, turn on the Arduino. You will notice that the Bluetooth module is now flashing. This is because it is not connected to other device yet.

Then go to your smartphone, turn ON bluetooth and search for the module. The name of the module is "HC-06". Pair the module and if it ask for the password, it is "1234".

Step 5: Uploading Arduino Coding

Copy and paste into Arduino IDE.

Now, it is time to upload the coding into Arduino.

Dont forget to disconnect the Rx and Tx wires during uploading. If not, the uploading will fail.


After uploading done, reconnect the wires again.

Step 6: Testing

Now you have reached the final stage.

Activate the bluetooth on your smartphone. Then, open the app that you have installed earlier.

Click the button "select device"

A list of bluetooth device will appear and choose your Bluetooth module. In this case, HC-06.

wait a moment and if the connection is successful, the Bluetooth module will stay lighting and it will pop out

"the device is connected"

Press any image from 13 different them. You will see there is an action take place on your RC tank. Test all of them.

Step 7: Put Them Nicely in Your RC Tank

This is the way to make your RC Tank neat and tidy. Depend on your creativity.

I used the recycle item as much as possible such as:

-the aluminum plate remnants

-USB female, internal hard disk casing from damage laptop

-audio jack male and female from broken radio and microphone

-some jumper wire from broken electrical appliance

Step 8: Video

Microcontroller Contest

Participated in the
Microcontroller Contest

First Time Author Challenge

Participated in the
First Time Author Challenge

Be the First to Share

    Recommendations

    • Made with Math Contest

      Made with Math Contest
    • Multi-Discipline Contest

      Multi-Discipline Contest
    • Robotics Contest

      Robotics Contest

    23 Discussions

    0
    None
    danihot26

    Question 4 weeks ago on Step 3

    Hello Jeneral, im making a bigger metal tank, using 2 servos mg996 for main engine, and futaba 3003 for turret, i dont know about this, im learning. i wanted to know if a can change the l298n for Double bridge H Driver L298n Motor Dc Arduino Arm Avr https://www.tiendavirtual.com/MLA-732294746-doble-puente-h-driver-l298n-motor-dc-arduino-l298-avr-arm-_JM?quantity=1#position=2&type=item&tracking_id=497e8573-660b-4939-bca7-17a0bba54e19 and if the connections would need 1 or 2 of these and how can i connect them to an arduino uno, cause i cant find the l298n in my country, dont know if it is because its old or something. i would love to do the same as you did, plis help me.

    2 answers
    0
    None
    jeneraldanihot26

    Answer 4 weeks ago

    Hello Danihot26

    The connection can be found in the link you provided. Im not sure about this module pinout. But based on the picture, it used three PWM inputs and one digital input. If you want to add another l298n module, you can use arduino uno pinout 3,5,6 for PWM and just choose any one digital output.

    Screenshot_20190915_230617.jpg
    0
    None
    danihot26jeneral

    Reply 4 weeks ago

    can you plis tellme what im doing wrong, cause is not working, and i try and i try and yet it doesnt work... the bluetooth controler is an H5 not an H6

    WhatsApp Image 2019-09-16 at 12.45.50 (4).jpegWhatsApp Image 2019-09-16 at 12.45.50 (3).jpegWhatsApp Image 2019-09-16 at 12.45.50 (2).jpegWhatsApp Image 2019-09-16 at 12.45.50 (1).jpegWhatsApp Image 2019-09-16 at 12.45.50.jpeg
    0
    None
    Aadhav2304

    2 years ago

    I am not able to get the L298N Motor Driver Module.Please help......

    1 reply
    0
    None
    jeneralAadhav2304

    Reply 2 years ago

    https://www.sparkfun.com/products/9479

    You can buy online on website above

    But i suggest you to go to your nearest electronic shop. Just give them the module number l298n and they will find it for you

    0
    None
    totowp

    3 years ago

    Hey jeneral... can you give me information how to matching button in canvas (appinvertor) and pinOUT (arduino). ?

    because i want add some button for moving relays.. thanks..

    I see that

    w = forward

    d = backward

    q = left

    e = right

    how to setting the STATE ?

    0
    None
    jeneraljordan the tamago

    Reply 3 years ago

    owh.. that tank i bought it online from somewhere in malaysia. it is heng long brand made in china.

    0
    None
    FulkitN

    3 years ago

    Sir please can you please send me fritzing diagram of your connection
    As i am a beginer this diagram i am able understand it

    1 reply
    0
    None
    jeneralFulkitN

    Reply 3 years ago

    I am very sorry for late reply because I am busy on my works lately. I think the drawing i made using microsoft word is already straight forward. One more thing, i am not familiar with fritzig software. Hahaha

    0
    None
    KronoNautjeneral

    Reply 4 years ago on Introduction

    I was able to jump back into this project after being busy with other things for a few months. I was able to get the lower half working via the usb cable to the Arduino. Next step is to hook up the upper half, then the bluetooth module. Step by step it is coming together.

    bttanklower.jpg
    0
    None
    KronoNautKronoNaut

    Reply 4 years ago on Introduction

    I got it to work. I had trouble with the communication between my Arduino and the Bluetooth. Fixed that by combining your sketch with the Sparkfun Bluetooth test sketch by Jim Lindblom. I am putting together my documentation and will be posting it on instructables. You were a great inspiration.

    0
    None
    HumzaU

    4 years ago on Introduction

    Hi, i am making a slightly modified version of this (basically a car without the turret and horn, just a basic forward, backward, left and right function car). I tried to slightly change your code for the arduino uno but... Arduino gives me the following errors... I have no previous experience with this type of coding however i can easily get a general feeling of they work.

    "sketch_feb10b.ino:1:21: error: pitches.h: No such file or directory

    sketch_feb10b.ino: In function 'void loop()':

    sketch_feb10b:23: error: 'state' was not declared in this scope

    sketch_feb10b:26: error: 'state' was not declared in this scope"

    the changes i made to the code are:

    "

    #include "pitches.h"

    int motor1Pin1 = 12;

    int motor1Pin2 = 11;

    int motor2Pin1 = 10;

    int motor2Pin2 = 9;

    void setup() {

    // sets the pins as outputs:

    pinMode(motor1Pin1, OUTPUT);

    pinMode(motor1Pin2, OUTPUT);

    //pinMode(enable1Pin, OUTPUT);

    pinMode(motor2Pin1, OUTPUT);

    pinMode(motor2Pin2, OUTPUT);

    Serial.begin(9600);

    }

    void loop() {

    //if some date is sent, reads it and saves in state

    if(Serial.available() > 0){

    state = Serial.read();

    }

    // forward

    if (state == 'w') {

    digitalWrite(motor1Pin1, HIGH);

    digitalWrite(motor1Pin2, LOW);

    digitalWrite(motor2Pin1, LOW);

    digitalWrite(motor2Pin2, HIGH);

    }

    // left

    else if (state == 'e') {

    digitalWrite(motor1Pin1, HIGH);

    digitalWrite(motor1Pin2, LOW);

    digitalWrite(motor2Pin1, HIGH);

    digitalWrite(motor2Pin2, LOW);

    }

    // right

    else if (state == 'q') {

    digitalWrite(motor1Pin1, LOW);

    digitalWrite(motor1Pin2, HIGH);

    digitalWrite(motor2Pin1, LOW);

    digitalWrite(motor2Pin2, HIGH);

    }

    // backward

    else if (state == 'd') {

    digitalWrite(motor1Pin1, LOW);

    digitalWrite(motor1Pin2, HIGH);

    digitalWrite(motor2Pin1, HIGH);

    digitalWrite(motor2Pin2, LOW);

    }

    // Stop

    else {

    digitalWrite(motor1Pin1, LOW);

    digitalWrite(motor1Pin2, LOW);

    digitalWrite(motor2Pin1, LOW);

    digitalWrite(motor2Pin2, LOW);

    noTone(13);

    }

    delay(100);

    }"

    Could you please help me where i have gone wrong this is for a school project thanks >.<

    1 reply
    0
    None
    jeneralHumzaU

    Reply 4 years ago on Introduction

    ​sorry for late reply..
    I have uploaded the new tank.ino code..
    If you dont want to use horn function, you can remove
    "#include "pitches.h"

    0
    None
    paulware

    4 years ago on Introduction

    Peace.

    Good call using the MIT app inventor. I had no prior exposure. I would really like to use (and modify) your .aia file. When I follow the link, however I am offered an application which doesn't match your example. Could you update the .aia link or perhaps offer a link to a different site (like github).

    Much appreciated!

    Paul