Arduino + Bluetooth Controlled Tank

by makersplace in Circuits > Arduino

10193 Views, 80 Favorites, 0 Comments

Arduino + Bluetooth Controlled Tank

F1ACI5XIT5S6WN3.jpeg

I build this tank to learn how to program, how motors, servos, Bluetooth and Arduino works and i build one with making research from internet. Now i decided to make my own Instructables, for people who need to help about build an Arduino tank.

Here is the video: Arduino + Bluetooth controlled Tank


Basically, the system works like;

Bluetooth sends data from the phone(with Arduino RC application, numbers or characters can be sent as data to hc06 )to Arduino and Arduino starts servo and motors for the data.

Things You Need

IMG_7243.JPG
IMG_7245.JPG
IMG_7258.JPG
IMG_7264.JPG
IMG_7277.JPG
  • 1x arduino uno r3

  • 1x arduino uno motor driver shield

  • 2x 180 rotation micro servos
  • 1x Tamiya tank tracks
  • 1x Tamiya universal plate set
  • 1xTamiya twin motor gear box X1
  • 1x PowerBank (mine is 10400mAh it can change)
  • 1x HC 06 bluetooth module about 2.5 cm circuit board spacer( you can find it from old circuits or pc)
  • Some wire
  • More than 2 male and female header pin connector
  • Soldering iron
  • Hot glue gun ,hot silicone gun (same thing)
  • Soldering wire
  • Circuit board
  • usb cable
  • android phone
  • straw

After You Build Your Tanks Body

IMG_7244.JPG
IMG_7246.JPG
IMG_7248.JPG
IMG_7249.JPG
IMG_7250.JPG
IMG_7251.JPG

After you build the Tamiya set solder some wires on your motors. And screw your Arduino into the spacers, as shown.

Plug your motor driver correctly into your Arduino and solder two female head pin connector to pin 0(RX) and 1 (TX).

make the motor connections to the motor driver

Tanks Barrel

57dbf8b94936d4af8b000a4f.jpeg
IMG_7256.JPG
57dbf8e9937ddb91a0000d1a.jpeg

with some hot silicon glue two servos as shown in photos. connect the servos to the motor shield.

ground servo goes to SER1

up and down servo goes to SER2

Battery

IMG_7258.JPG
IMG_7259.JPG
IMG_7260.JPG
IMG_7264.JPG
IMG_7265.JPG
IMG_7266.JPG

Cut two small pieces of the circuit board for your power bank and glue it to the battery. as shown

Cut your USB cable and solder it to the motor shields 5v and ground. MAKE SURE YOU ARE SOLDERING CORRECTLY. (VCC to VCC ground to ground)

Bluetooth Connection

IMG_7272.JPG
IMG_7273.JPG
IMG_7274.JPG

Cut your Male and female header pin connectors male side and solder it to the 5v and ground to the motor shield.

for me, green is VCC red is GND

  • NOTE: WHILE YOU UPLOADING THE CODE MAKE SURE THAT YOUR BLUETOOTH IS NOT CONNECTED ARDUINO ANYWAY.

Connect;

  • arduino's rx to hc 06's tx
  • arduino's tx to hc 06's rx

Glue the PowerBank

IMG_7261.JPG
IMG_7275.JPG
IMG_7276.JPG
IMG_7262.JPG
IMG_7267.JPG

Put some hot glue on the circuit boards and glue it to the Arduino. Test your Arduino with plugging the USB to the power bank(make sure your power bank is open or charged).

Also if you want you can glue another circuit board for your Bluetooth module it's too easy and more beautiful

Uploading the Code

IMG_7268.JPG
IMG_7269.JPG
IMG_7270.JPG

Download the code and upload it to your Arduino.

  • Small notes:

sayac means counter in Turkish

durum is status

Servo sagsol;
Servo yukari;

these are also;

Servo rightleft;

Servo up;

  • CODE HAS A PROBLEM ABOUT THE BARREL IF YOU SOLVE IT PLEASE WRITE IT TO THE COMMENTS!!!

for example;

<p>if(durum == '5'){<br>         <br>         while(durum == '5'){<br>               <br>        sayac++;<br>        if(sayac>180)<br>        {<br>          sagsol.write(180);<br>          }<br>          if(sayac<0)<br>        {<br>          sagsol.write(0);<br>          }<br>        delay(50);<br>              <br>       sagsol.write(sayac);<br>       break;<br>       <br>       }<br>     }</p>
  • It keeps counting while you press another button in your phone and int gets bigger,

can we limit the integer if we can please write it to the comments?

limit like 0 to 180.

Adding the Straw As Barrel

IMG_7278.JPG
IMG_7279.JPG
IMG_7280.JPG

Cut the straw before the twisted part and put it into the servo

Using the Android

IMG_7281.JPG
IMG_7282.JPG
IMG_7283.JPG
IMG_7285.JPG
IMG_7286.JPG
IMG_7289.JPG
IMG_7290.JPG
IMG_7295.JPG
IMG_7296.JPG
IMG_7297.JPG
IMG_7298.JPG

Download the Arduino RC app in google play https://play.google.com/store/apps/details?id=eu.j...

power your tank

open the application

press process

press HC 06 device

wait...

when Arduino is connected to phone Bluetooth module stops blinking

open controller mode

make your settings these are my settings. it can change if you connected wrong motor cables to the motor shield but changing the numbers or code you can get the true one.

You Are Ready to Go

IMG_7293.JPG