loading

After trying to remote tracked robot by IR remote control.I have proceed to control same robot platform by Bluetooth

Arduino controller via Android application.This method is more reliable,longer distance,pretty Android application enhancement.

Same principle,low cost play and home level technical skill.Programming khownledge is not necessary.

Thanks for free download Arduino Bluetooth RC Car from Google play.

Project more : http://hobbywitch666.blogspot.com

You can purchase electronic parts from Aliexpress, Banggood, ebay,etc.

Step 1: Materials and Tools

Materials

1.Tamiya Track and wheel set.

2.Tamiya Gear box - Individual drive-two motors.

3.Tamiya perforated plastic plate.

4.Dupont wires 200 mm.

5.Arduino UNO.

6.HC-06 Bluetooth module for Arduino.

7.L298N Dual H-Bridge motor drive module.

8. 2-LEDs(Different color)

9. 2-Resistor 1 kohm. 1/4 watt.

10.Piezo buzzer.

11.Battery 5-12V.

Tools

1.Screw driver.

2.Plier.

Step 2: Mechanical Assembly & Electrical Connecting

1.Assembly Track and wheel set as manual instruction.

2.Install Arduino UNO controller ,LEDs ,Buzzer,L298N motor drive module and battery on chassis.

3.Wiring all components together as circuit diagram.(In diagram,It's another motor drive module, I cannot find L298N device.)

Arduino pins to HC-06 :

0 - Rx

1 - Tx

2 - State

Arduino pins to L298N motor drive module :

10 - ENA

9 - IN1

8 - IN2

7 - IN3

6 - IN4

5 - ENB

Connect Arduino GND pin and L298N motor drive module GND.

Arduino pins to L298N motor drive module :
Connect power output to Motor A and B

Connect battery to Arduino controller and L298N drive module (can use battery up to 12V.)

Arduino pins to other parts :

Front light LED - 3

Back light LED - 4

Piezo buzzer - 12

Step 3: The Sketch Code and Android Application

Arduino sketch code :

1.Down load and install attached main sketch.

2.Upload sketch to Arduino controller.(Before click upload ,it's necessary to take HC-06 Bluetooth 5V. power off)

3.Open Arduino software serial monitor to see output.

Smart phone/Tablet Android application installation :

1.Use Android smart phone to install "Arduino Bluetooth RC Car" free application from Google play store.

2.Pair Bluetooth communication between smart phone and HC-06.

2.1 Scan device and pair.Password of HC-06 is "1234" from factory.

2.2 After paired ,open application and choose BT connection menu on application to connect between devices.

2.3 If communication complete,green light will appear.If communication not complete,red light will blink.Try to pair device again.

Test each functions on application to find wrong wiring or any mistakes during installation.Normally,software have been tested many times.It should not have any problems.

Let's enjoy!

Can you check following circuit diagram,that correct or not?<br>Don't forget to connect the Ground between UNO and L298N.<br>The battery main power cable have to connect at L298N +12V terminal and GND terminal.<br>I wonder the serial monitor did not print anything.It mean the command from smartphone did not input BT and UNO.<br>See attached files.
<p>may i try ardiuno sheild for my board?</p>
I have re-built the circuit again,I found a new problem that BT HC-06 cannot communicate to smartphone,I have search that someone advice to connect 3.3V to EN or KEY pin of HC-06 to activate.And I succeed to communicate with the App and run it perfectly.(See the VDO at https://youtu.be/eUb5EDz3PSQ )<br><br>About the shield, I think you have to modify the sketch according to the instruction of the shield's brand you will use.But I suggest to correct your existing project first.
<p>I uploaded it successfully.and i paired it with my smartphone.but it dosent move.why is that?</p>
Can you open serial monitor to see what step it's doing ?<br>If you push forward it printed &quot;forward&quot; then it should go.<br>if motors quiet,there many possible problem of circuit connection.Can you check or take a photo?<br><br>PS.When the app on ready the light must be green.
<p>when i pushed forward it doesnt print anything.i cheked l298 motor driver board and it works perfectly.ardiuno board is also working perfectly.this is my robot--</p>
<p>I wonder the monitor did not show anything,If the sketch uploaded correctly.It means no input to controller to execute.Can you check the circuit diagram there are something wrong between BT module UNO and L298N or not.</p><p>Perhap,you can try interchanging Tx and Rx at BT pin,possibly wrong data input to output.</p><p>See attached files.</p>
Could you check the phone paired with BT module or not ,It would ask password that usually 1234 or 0000?<br>If the device status unpaired the app will show red circle.
<p>yeah i checked it all.then i checked my Bluetooth module with a hyper terminal bluetooth app.then i figured out this.i can send any texts to my phone via ardiuno serial monitor.But i cant send any texts to the serial monitor vi my phone.Is that a problem in Bluetooth module?</p>
bro <br>when I upload the code &quot; An error occurred while uploading the sketch&quot; comes<br>which version u used for coding??<br>or any other solution!??
problem solved I used 1.6.9
Yeh,use Arduino classic is better.
Geared motor and 360 degree Servo for robotic application.
another confusion<br>if I don't have those wheels and set can u use other motors and plzz say what is the rpm and voltage of motor I have to use
You can apply on two geared wheel with one free swivel wheel.It acts like tracked robot. L298N can drive motor from 3-6V. This tiny robot use DC motors not over 6V. no problem.
*can i
if I don't want buzzer and led can I remove it?? without changing code??
You do not install hardware,no effect at all,no need to modify sketch.
if I don't need only buzzer
<p>my code cant open</p>
<p>/*******************************************************************/</p><p> /* Written by Pason Tanpaiboon // 14-01-2016 V.1.3</p><p> /* Project: Tracked Robot via Arduino Bluetooth with Android Smartphone</p><p> /* 29/2/2016 change input sketch-delay control solving</p><p> /* 29/2/2016 modify command step</p><p>/*******************************************************************/</p><p>//Buzzer / Speaker to Arduino UNO Pin 12</p><p> const int buzzer = 12 ; </p><p>//Bluetooth (HC-06 JY-MCU) State pin on pin 2 of Arduino</p><p> const int BTState = 2;</p><p> const int pinfrontLights = 3; //Pin that activates the Front lights.</p><p> const int pinbackLights = 4; //Pin that activates the Back lights. </p><p> int state;</p><p> int vSpeed=255; // Default speed, from 0 to 255</p><p>/****************************************************************/</p><p>//Motor based on L298N motor drive module</p><p>// motor A</p><p>int enA = 10;</p><p>int in1 = 9;</p><p>int in2 = 8;</p><p>// motor B</p><p>int enB = 5;</p><p>int in3 = 7;</p><p>int in4 = 6;</p><p>String readString;</p><p>/*****************************************************************/</p><p> void setup() {</p><p> pinMode(pinfrontLights, OUTPUT); </p><p> pinMode(pinbackLights, OUTPUT); </p><p> pinMode(buzzer, OUTPUT); </p><p> pinMode(BTState, INPUT); </p><p> pinMode(enA, OUTPUT);</p><p> pinMode(enB, OUTPUT);</p><p> pinMode(in1, OUTPUT);</p><p> pinMode(in2, OUTPUT);</p><p> pinMode(in3, OUTPUT);</p><p> pinMode(in4, OUTPUT);</p><p> // Initialize serial communication at 9600 bits per second:</p><p> Serial.begin(9600);</p><p>}</p><p>void loop() {</p><p>/***********************************Bluetooth**********************************************/</p><p> //Stop car when connection lost or bluetooth disconnected</p><p> if(digitalRead(BTState)==LOW) { </p><p> state='S'; </p><p> }</p><p> //Save income data to variable 'state'</p><p> if(Serial.available() &gt; 0){ </p><p> state = Serial.read(); </p><p> delay(15);</p><p> }</p><p> //Chars '0' - '9' have an integer equivalence of 48 - 57, accordingly.</p><p> else if((state &gt;= 48) &amp;&amp; (state &lt;= 57))</p><p> { </p><p> //Subtracting 48 changes the range from 48-57 to 0-9.</p><p> //Multiplying by 28 changes the range from 0-9 to 0-255(L298N max speed)</p><p> vSpeed = (state - 48)*28.3; </p><p> // yellowCar.SetSpeed_4W(velocity);</p><p> Serial.println(vSpeed);</p><p> }</p><p> /***********************Forward****************************/</p><p> //If state is equal with letter 'F', car will go forward!</p><p> if (state == 'F') {</p><p> // turn on motor A </p><p> digitalWrite(in1, HIGH);</p><p> digitalWrite(in2, LOW);</p><p> analogWrite(enA, vSpeed);</p><p> // turn on motor B</p><p> digitalWrite(in3,HIGH);</p><p> digitalWrite(in4, LOW);</p><p> analogWrite(enB, vSpeed);</p><p> Serial.println(&quot;Going forward&quot;);</p><p> }</p><p> /**********************Forward Left************************/</p><p> //If state is equal with letter 'G', car will go forward left</p><p> if (state == 'G') {</p><p> // turn on motor A </p><p> digitalWrite(in1, HIGH);</p><p> digitalWrite(in2, LOW);</p><p> analogWrite(enA, vSpeed);</p><p> // turn on motor B</p><p> digitalWrite(in3, LOW);</p><p> digitalWrite(in4, LOW);</p><p> analogWrite(enB, vSpeed);</p><p> Serial.println(&quot;Forward left&quot;);</p><p> }</p><p> /**********************Forward Right************************/</p><p> //If state is equal with letter 'I', car will go forward right</p><p> if (state == 'I') {</p><p> // turn on motor A </p><p> digitalWrite(in1, LOW);</p><p> digitalWrite(in2, LOW);</p><p> analogWrite(enA, vSpeed);</p><p> // turn on motor B</p><p> digitalWrite(in3, HIGH);</p><p> digitalWrite(in4, LOW);</p><p> analogWrite(enB, vSpeed);</p><p> Serial.println(&quot;Going forward-right&quot;);</p><p> }</p><p> /***********************Backward****************************/</p><p> //If state is equal with letter 'B', car will go backward</p><p> if (state == 'B') {</p><p> // turn on motor A</p><p> digitalWrite(in1, LOW);</p><p> digitalWrite(in2, HIGH);</p><p> analogWrite(enA, vSpeed);</p><p> // turn on motor B</p><p> digitalWrite(in3, LOW);</p><p> digitalWrite(in4, HIGH);</p><p> analogWrite(enB, vSpeed);</p><p> Serial.println(&quot;Going backward&quot;); </p><p> }</p><p> /**********************Backward Left************************/</p><p> //If state is equal with letter 'H', car will go backward left</p><p> if (state == 'H') {</p><p> // turn on motor A</p><p> digitalWrite(in1, LOW);</p><p> digitalWrite(in2, HIGH);</p><p> analogWrite(enA, vSpeed);</p><p> // turn on motor B</p><p> digitalWrite(in3, LOW);</p><p> digitalWrite(in4, LOW);</p><p> analogWrite(enB, vSpeed);</p><p> Serial.println(&quot;Going backward-left&quot;); </p><p> }</p><p> /**********************Backward Right************************/</p><p> //If state is equal with letter 'J', car will go backward right</p><p> if (state == 'J') {</p><p> // turn on motor A</p><p> digitalWrite(in1, LOW);</p><p> digitalWrite(in2, LOW);</p><p> analogWrite(enA, vSpeed);</p><p> // turn on motor B</p><p> digitalWrite(in3, LOW);</p><p> digitalWrite(in4, HIGH);</p><p> analogWrite(enB, vSpeed);</p><p> Serial.println(&quot;Going backward-right&quot;); </p><p> }</p><p> /***************************Left*****************************/</p><p> //If state is equal with letter 'L', wheels will turn left</p><p> if (state == 'L') {</p><p> // turn on motor A</p><p> digitalWrite(in1, HIGH);</p><p> digitalWrite(in2, LOW);</p><p> analogWrite(enA, vSpeed);</p><p> // turn on motor B</p><p> digitalWrite(in3, LOW);</p><p> digitalWrite(in4, HIGH);</p><p> analogWrite(enB, vSpeed);</p><p> Serial.println(&quot;Rotating left&quot;); </p><p> }</p><p> /***************************Right*****************************/</p><p> //If state is equal with letter 'R', wheels will turn right</p><p> if (state == 'R') {</p><p> // turn on motor A</p><p> digitalWrite(in1, LOW);</p><p> digitalWrite(in2, HIGH);</p><p> analogWrite(enA, vSpeed);</p><p> // turn on motor B</p><p> digitalWrite(in3, HIGH);</p><p> digitalWrite(in4, LOW);</p><p> analogWrite(enB, vSpeed);</p><p> Serial.println(&quot;Rotating right&quot;); </p><p> }</p><p> /************************front Lights*****************************/</p><p> //If state is equal with letter 'W', turn front leds on </p><p> if (state == 'W') {</p><p> digitalWrite(pinfrontLights, HIGH); </p><p> Serial.println(&quot;Frontlight on&quot;);</p><p> }</p><p> if (state == 'w') {</p><p> digitalWrite(pinfrontLights, LOW); </p><p> Serial.println(&quot;Frontlight off&quot;); </p><p> }</p><p> /************************Back Lights*****************************/</p><p> //If state is equal with letter 'W', turn front leds on </p><p> if (state == 'U') {</p><p> digitalWrite(pinbackLights, HIGH); </p><p> Serial.println(&quot;Backlight on&quot;); </p><p> }</p><p> if (state == 'u') {</p><p> digitalWrite(pinbackLights, LOW); </p><p> Serial.println(&quot;Backlight off&quot;); </p><p> }</p><p> /**********************Horn sound***************************/</p><p> //If state is equal with letter 'V', play (or stop) horn sound</p><p> if (state == 'V'){</p><p> tone(buzzer, 1000);//Speaker on </p><p> Serial.println(&quot;Horn on&quot;); </p><p> }</p><p> if (state == 'v'){</p><p> noTone(buzzer); //Speaker off </p><p> Serial.println(&quot;Horn off&quot;); </p><p> }</p><p> /************************Stop*****************************/</p><p> //If state is equal with letter 'S', stop the car</p><p> if (state == 'S'){</p><p> // turn on motor A</p><p> digitalWrite(in1, LOW);</p><p> digitalWrite(in2, LOW);</p><p> analogWrite(enA, vSpeed);</p><p> // turn on motor B</p><p> digitalWrite(in3, LOW);</p><p> digitalWrite(in4, LOW);</p><p> analogWrite(enB, vSpeed);</p><p> }</p><p>}//void loop()end</p>
<p>can some one paste the code for me please</p>
<p>Before uploading ,take bluetooth power pin off,nevertheless error will occur.</p>
<p>I got this message while try to upload the code..</p><p><br>exit status 1<br>'BTState' was not declared in this scope</p><p>I dont know how to solve this. Need your kindly advice Sir. </p>
After few times Try n Error uploading..now I succesfully uploaded the code. Thanks.
Just got HC-06 and realized that it have no ' State' pin which need to connect Hc-06 to Arduino. HC-06 have 4 pins. Do I have to add new pin for State pin in Hc06?
<p>You can solder one more pin at the state hole.Mine also done too.</p>
<p>You can try I think it should work exactly.</p>
<p>can i use hc 05</p>
Bro do I need to use the abive bluetooth controller app or I can use any other app too.........if I can use any other app then would I need to do any change in the code ..........plzzzzzzzzzz help
Yes,it can do but you have to study the App.that you want to use and adapt the sketch.Like in attached sketch command &quot;F&quot; order to go forward.Other app. may use &quot;A&quot; to go forward.
<p>I once built a large remote tank (many, many years ago), but the batteries never lasted long. So I took the batteries from our military radio and form fitted it in steed and I could not run fast enough to keep up.</p><p>Question; you are useing a 9 volt, what if we up that to say a 12v or even 18v and add a camera? [maybe a BB gun, remote arm, tazer, speaker and mic for comm.... too much huh, well maybe just a camera then]</p>
<p>This tracked robot ,I used 7.2 LIPO batt.It's too much powerful for motor 130.I have a 1/16 M26 tank installed FPV using 7.2V Nicd Batt.Have BB gun,smoke fumer,sound.Never have problem with battery.How big is your tank?What's the motor size?</p>
Good info, thanks.
Back then (1975ish) it was the TAMIYA 1/16 R/C Leopard 2 A6 Main Battle Tank, powered by 2 high-torque Type 540 motors and a 7.2v battery. Converting it to use a 12 v NiCad made it rip up the grass and even be able to go 2/3 submerged for a short time. No guns or lights then but the ramming power made all others run in fear. I added cut down tacks to the treads for grip and could climb most any surface. Man I miss that thing. Of course since then it is long gone but hopefully soon to have a come back as my grandsons get old enough.
<p>I think Tamiya motor 540 only 6V. 12V supply could damage electronic speed control.May be motors too.But you can find Tamiya spare in ebay if you want to resurrect it.</p>
<p>hc-06 not State ?</p>
What's the question meaning?
<p>Great work</p>
Thank you friend.
may I use hc-05?<br>
I think it should be Yes.If it has pin STATE Rx Tx Vcc GND.

About This Instructable

5,016views

137favorites

License:

More by nipon4666:How to Build 8 Channel Transmitter nrf24l01 Arduino How to Control Tracked Robot Via 3-Channel RC Transmitter + Arduino How to Control Tracked Robot Via Joystick NRF24L01 Module Arduino Part2 Rx 
Add instructable to: