In this tutorial we are going to go over building a Arduino robot that can be controlled via bluetooth with an Android phone/tablet. This is a beginners guide that is going to briefly go over the process of wiring and programming your robot.  

Step 1: Build list...

The following is the list of components we are going to use:

1.   Pololu Zumo chassis              http://www.zagrosrobotics.com/shop/item.aspx?itemid=884
2.   DRV8833 dual motor driver    http://www.zagrosrobotics.com/shop/item.aspx?itemid=879
3.   Arduino Uno or compatible     http://www.zagrosrobotics.com/shop/item.aspx?itemid=868
4.  Bluetooth modem                    http://www.zagrosrobotics.com/shop/item.aspx?itemid=883
5.  Android phone or tablet

Along with that list of parts for the robot you are going to need these basic things to build and program your robot

1,   Computer with the Arduino IDE    http://arduino.cc/en/Main/Software
2.   Soldering iron
3.   Some solder and wires

<p>can i use Hc-05 bluetooth modem instead of your bluetooth</p>
<p>Hi!, I have a question:</p><p>Could I use this instead the DRV8833 dual motor driver? </p><p><a href="http://5hertz.com/index.php?main_page=product_info&cPath=99_104&products_id=462" rel="nofollow">http://5hertz.com/index.php?main_page=product_info...</a></p>
hey I'm in the UK and cant get access to all the different components so I have 2 questions. <br>1. could I use this for my Bluetooth modem - http://www.amazon.co.uk/Bluetooth-Module-Wireless-Serial-Arduino/dp/B00DJQ5Q5Q/ref=sr_1_2?ie=UTF8&amp;qid=1388606312&amp;sr=8-2&amp;keywords=bluetooth+slave <br> <br>2.is it possible to use the arduino motor sheild instead of the dual motor drive
ignore the second question I found one that should work.... hopefully
i wana ask that can we communicate b/w android and arduino(any other microcontroller) via usb cable?? bluetooth's data rate is lesser than of usb..
Yes you can use USB. Although for this Instructable, which is only sending simple strings, there is plenty of bandwidth to handle this type of simple control. Plus bluetooth gives us the advantage of not being tethered to the robot. I would suggest reading up on the data sheets for the type of Microcontroller you are using to see what speeds are available and how to incorporate them. Try this link for some information on Maximum baudrates with Arduino- http://forum.arduino.cc/index.php?topic=21497.0 -Atom
Is the dual motor driver needed if I use servos to drive the chassis instead?
No, but you will have to do some modification to the Arduino Sketch in order to get your robot moving. I suggest looking over the Arduino Servo Library - http://arduino.cc/en/reference/servo to get some insight into rewriting the code. -Atom
Will this work with wifi instead of bluetooth? <br>
The Android application is built around using Bluetooth comm vs WiFi so it would require a major rewrite. It might be interesting to use WiFi vs bluetooth. Which Arduino wifi shield are you looking at using?
Xbee I have seen some apps around, darned if I can find one now!
I had a lot of trouble with the above sketch. Once I got my mind around and the particular requirements of the Ardumoto motor control board, I made a few changes that will allow people to build this project while using the Ardumoto. <br> <br>Cheers <br>/* Here is a work in progress based on file found at http://www.instructables.com/id/Beginners-guide-to-building-Arduino-robots-with-Bl/ <br>I the following changes from the original: <br> <br>1) Power pins are 3 and 11 and digital pins are 12 and 13 to work with the Ardumoto motor control shield. https://www.sparkfun.com/products/9815? <br>2) MDFLY bt tranceiver defaults to 9600 baud http://www.mdfly.com/index.php?main_page=product_info&amp;cPath=8_47&amp;products_id=769 <br>3) Serial monitor test will not work with Ardumoto in place because MDFLY uses serial pin 0/tx. <br>4) Case statements had to be completely reworked with matching serial output <br>5) Added forward and reverse veering case statements with 100/190 power bias. <br>6) Left and right cases feature20% power counter rotating tracks for on the spot zero radius turns. <br>7) Max_Control App -- https://www.box.com/s/8b06bcee9ec84ec70a72 this works perfectly but workin in progress to map veering keys to the interface <br> <br>If you have questions or comments contact me @ celtic.smile.762@gmail.com */ <br> <br>int r_motor_n = 12; //PWM control Right Motor - <br>int r_motor_p = 3; //PWM control Right Motor + <br>int l_motor_p =11; //PWM control Left Motor + <br>int l_motor_n = 13; //PWM control Left Motor - <br>int incomingByte = 0; // for incoming serial data <br> <br> <br>void setup() <br>{ <br> pinMode(r_motor_n, OUTPUT); //Set control pins to be outputs <br> pinMode(r_motor_p, OUTPUT); <br> pinMode(l_motor_p, OUTPUT); <br> pinMode(l_motor_n, OUTPUT); <br> <br> digitalWrite(r_motor_n, LOW); //set both motors off for start-up <br> digitalWrite(r_motor_p, LOW); <br> digitalWrite(l_motor_p, LOW); <br> digitalWrite(l_motor_n, LOW); <br> <br> <br> Serial.begin(9600); <br> <br> Serial.print(&quot;Enter keys -- q, f, e, l, b, r, z, c for drive control \n&quot;); <br> Serial.print(&quot;w = Forward \n&quot;); <br> Serial.print(&quot;s = Backward \n&quot;); <br> Serial.print(&quot;d = Right \n&quot;); <br> Serial.print(&quot;a = Left \n&quot;); <br> Serial.print(&quot;q = frwd_veer left \n&quot;); <br> Serial.print(&quot;e = frwd_veer right \n&quot;); <br> Serial.print(&quot;z = rev_veer left \n&quot;); <br> Serial.print(&quot;c = rev_veer right \n&quot;); <br> Serial.print(&quot;x = Stop \n&quot;); <br> Serial.print(&quot;Zagros Robotics, Inc.&quot;); <br>} <br> <br>void loop() <br>{ <br> <br> <br> <br> <br> if (Serial.available() &gt; 0) { <br> // read the incoming byte: <br> incomingByte = Serial.read(); <br> } <br> <br> <br> <br> <br> switch(incomingByte) <br> { <br> case 's': <br> digitalWrite(r_motor_n, LOW); <br> digitalWrite(r_motor_p, LOW); <br> digitalWrite(l_motor_p, LOW); <br> digitalWrite(l_motor_n, LOW); <br> Serial.println(&quot;Stop\n&quot;); <br> incomingByte='*'; <br> <br> break; <br> <br> case 'r': <br> digitalWrite(r_motor_n, LOW); <br> analogWrite(r_motor_p, 50); <br> digitalWrite(l_motor_n, HIGH); <br> analogWrite(l_motor_p, 50); <br> Serial.println(&quot;Right\n&quot;); <br> incomingByte='*'; <br> break; <br> <br> case 'e': <br> digitalWrite(r_motor_n, HIGH); <br> analogWrite(r_motor_p, 100); <br> digitalWrite(l_motor_n, HIGH); <br> analogWrite(l_motor_p, 190); <br> Serial.println(&quot;veer Left\n&quot;); <br> incomingByte='*'; <br> break; <br> <br> case 'l': <br> analogWrite(r_motor_p, 50); <br> digitalWrite(r_motor_n, HIGH); <br> analogWrite(l_motor_p, 50); <br> digitalWrite(l_motor_n, LOW); <br> Serial.println(&quot;Left\n&quot;); <br> incomingByte='*'; <br> break; <br> <br> case 'q': <br> digitalWrite(r_motor_n, HIGH); <br> analogWrite(r_motor_p, 190); <br> digitalWrite(l_motor_n, HIGH); <br> analogWrite(l_motor_p, 100); <br> Serial.println(&quot;Veer Right\n&quot;); <br> incomingByte='*'; <br> break; <br> <br> case 'f': <br> digitalWrite(r_motor_n, HIGH); <br> analogWrite(r_motor_p, 190); <br> analogWrite(l_motor_p, 190); <br> digitalWrite(l_motor_n, HIGH); <br> Serial.println(&quot;Forward\n&quot;); <br> incomingByte='*'; <br> break; <br> <br> <br> case 'b': <br> analogWrite(r_motor_p, 190); <br> digitalWrite(r_motor_n, LOW); <br> digitalWrite(l_motor_n, LOW); <br> analogWrite(l_motor_p, 190); <br> Serial.println(&quot;Back\n&quot;); <br> incomingByte='*'; <br> break; <br> <br> case 'c': <br> analogWrite(r_motor_p, 190); <br> digitalWrite(r_motor_n, LOW); <br> digitalWrite(l_motor_n, LOW); <br> analogWrite(l_motor_p, 100); <br> Serial.println(&quot;Veer Back Right\n&quot;); <br> incomingByte='*'; <br> break; <br> <br> case 'z': <br> analogWrite(r_motor_p, 100); <br> digitalWrite(r_motor_n, LOW); <br> digitalWrite(l_motor_n, LOW); <br> analogWrite(l_motor_p, 190); <br> Serial.println(&quot;Veer Back Right\n&quot;); <br> incomingByte='*'; <br> break; <br> <br> case 'v': <br> Serial.print(&quot;MiniBot Version 8/4/2012 &quot;); <br> Serial.println(); <br> Serial.print(&quot;Zagros Robotics, Inc.&quot;); <br> incomingByte='*'; <br> break; <br> <br> delay(5000); <br> <br> } <br>}
This example didn't use the Ardumoto, however it is a great choice. <br>We also have a basic Ardumoto example on our website: <br>http://www.zagrosrobotics.com/files/Motor_Control_09192010.zip
Great instructable and thanks for posting. This worked right off for me when I tried, the only thing I had to change was to switch the baud rate for my BT dongle (9600).
Hey awesome ible, <br>Ive never used Arduinos before so I have a few questions. <br> <br>Would an Arduino Nano v3 work in this application? <br> <br>Can I use this bluetooth module? <br>http://dx.com/p/jy-mcu-arduino-bluetooth-wireless-serial-port-module-104299
If you are new to Arduino I would recommend using the listed products as things can become complicated for the beginner when understanding voltage differences and pinout locations for different Arduino inspired boards as well as editing Arduino sketches for custom scenarios. But I believe that this tutorial is compatible with the Nano double check that the voltage of your board is 5v otherwise it might not power the motors. I would refer to the Arduino website for additional information on your board specs. And for the bluetooth module you listed it should work but hooking it up to your Nano might be differnt than what my diagram suggests. Check data sheets or website information on setting up your bluetooth module to verify. -Atom

About This Instructable




More by ZRob314:Piano Pi - Play a Duet With Your Pi! Raspberry Pi Touchscreen Setup Times Square in your living room!   Turn your Sense Hat LED into a news ticker. 
Add instructable to: