Introduction: Tracked Arduino Robot

This Instructable will show you how to build a tracked Arduino-controlled robot.

The content is organized as follows:

  • Sourcing Parts: All of the necessary parts have been compiled, as well as resources to review their specifications and links to where the parts can be purchased. We compile parts starting with:
    1. Chassis
    2. Gearbox
    3. Arduino Uno
    4. Motor Shield
    5. Ultrasonic Distance Sensor
    6. Micro Servo
    7. Motors
    8. Batteries
  • What tools will I need? A complete list of tools that will be useful for the construction of the robot.
  • Assembly of the Chassis: The chassis kit comes with paper instructions that are quite good. The pictures are designed to be supplemental to the paper instructions.
  • Assembly of the Gearbox: Same method as above, pictures attached to make assembly easier.
  • Build a Battery Support Box
  • Mounting the Gearbox
  • Tidy Up the Motor Wiring
  • Attach the Arduino to the Chassis
  • Slide the Motor Shield into the Arduino
  • Mount the Ultrasonic Sensor
  • Wire Up the Ultrasonic Sensor
  • Mount the Battery
  • Load Your Program
  • Finished Robot!

Step 1: Sourcing Parts: Chassis

The mechanical parts make up the body of the robot. This includes tracks, wheels, axles, and the wooden base to mount everything to.

About the Chassis Kit:

For this project, the Tamiya 70108 kit was used. It is cheap, easy to assemble, and a perfect base for a robot because it has tank steering, in other words, the robot can turn completely around in its own length. The basic kit comes with one motor and can go forward and backward, but cannot turn. This is not very useful to us, so the solution is the Tamiya 70168 double gearbox kit.

Research the Tamiya 70108 Tracked Vehicle Chassis Kit

Buy the Tamiya 70108 Tracked Vehicle Chassis Kit from Amazon

Picture courtesy of Tamiya

Step 2: Sourcing Parts: Gearbox

About the Double Gearbox:

The 70168 Gearbox is easy to assemble and enables our robot to make turns. It does this because each track is powered by a separate motor. The kit also has four gear ratios to choose from, so if the robot needs more speed or more torque, the gearing can be changed to compensate.

Research the Tamiya 70168 Double Gearbox

Buy the Tamiya 70168 Double Gearbox from Amazon

Picture courtesy of Tamiya

Step 3: Sourcing Parts: Arduino Uno

The robot needs something to tell the motors when to turn, how fast, and for how long. The robot also needs a way of deciding if it needs to turn left or right, stop, and how to interpret signals from its sensors. In short, the robot needs a brain.

The brain of the robot is the Arduino Uno. Based on inputs from sensors, the Arduino acts on logic that is written by the programmer, and creates outputs.

Research the Arduino Uno Rev 3

Buy the Arduino Uno Rev3 from Amazon

Step 4: Sourcing Parts: Motor Shield

An Arduino Shield is a component that can be placed over the Arduino and all the pins of the shield line up with the receptacles in the Arduino. This arrangement makes it very easy to have multiple components without worrying about the logistics of the wiring. This is where the robot pictured will differ from the robot that will be produced from this Instructable. The pictured robot uses a different version of the Seeedstudio Motor Shield, a version 1.2 instead of version 2.0. The 2.0 version is an improvement as it doesn't use the proprietary Grove style connectors, and it is now possible to use jumpers instead, which are cheaper.

Research the Seeedstudio Motor Shield 2.0

Buy the Seeedstudio Motor Shield 2.0 from Amazon

Step 5: Sourcing Parts: Ultrasonic Sensor

The HC-SR04 Ultrasonic Distance Sensor is the eye of the robot. With the HC-SR04 it is possible for the robot to gather real world information to feed to the Arduino brain. To be more accurate, the HC-SR04 uses sonar more like a bat, sending out sound waves and measuring the time it takes for them to return. By using the speed of sound, it is possible to calculate the distance between the sensor and the object being detected.

Research the HC-SR04 Ultrasonic Distance Sensor

Buy the HC-SR04 Ultrasonic Distance Sensor from Amazon

Step 6: Sourcing Parts: Micro Servo

*Optional - This part would be placed between the ultrasonic distance sensor and its mount.

The SG90 micro servo is used on our robot like a human neck. It allows the ultrasonic sensor to turn in different directions, which is much better than having a fixed position on the robot.

Alternatively, it is possible to set up an array of multiple ultrasonic sensors, much like a fly's eye, with each sensor measuring distance from a different angle.

Research the Tower Pro SG90 9g Micro Servo

Buy the Tower Pro SG90 9g Micro Servo from Amazon

Step 7: Sourcing Parts: Motors

The basic chassis kit comes with 130 size motors, but they are 3 volt motors that pull too much current when stalled. Replacing them with Pololu #1117 motors of a higher voltage means that less current will be pulled through the drivers when stalled. This keeps the motor drivers from burning out.

Research and Buy the Pololu 130 Size 6v Motors from Pololu x2

Step 8: Sourcing Parts: Battery

A great way to power the robot is by using a high technology Lithium polymer battery. These batteries will power your robot for hours. Judge the capacity by the mah (milli-ampere-hour) rating, a higher number means higher capacity.

Be aware when using a Lithium Polymer battery that a smart charger is recommended, which drives the price up quite a bit.

For a cheaper alternative, you could use four AA batteries in series and a holder.

Research and Buy the Turnigy 1.8 (1800mah) nano-tech LiPo Battery from HobbyKing 7.4 Volts

or

Buy a four AA battery holder from Amazon, do not forget the AA batteries!

Step 9: Getting Ready for Assembly: Tools

A number of tools are necessary for the construction of the robot. This are listed below.

Step 10: Start Assembly: Chassis

Follow the instructions included in the chassis box. When the parts are freed from their plastic, they should look like the first picture.

  1. Parts inventory
  2. Mark Arduino mounting holes.
  3. Drill Arduino mounting holes. Along the sides, make notches with the hobby knife for the gearbox mount.
  4. Attach idler axle mounts.
  5. Attach bogey axle mounts.
  6. Detail of axle with idler wheels on it.
  7. Mount idler axle, wheels, and wheel securing caps.
  8. Attach bogies and wheel securing caps.
  9. Flip chassis upright.

Step 11: Start Assembly: the Gearbox

Follow the instructions provided in the box. The gearbox looks intimidating, and the small parts are hard to hold, but it is not as complicated as it looks. Be sure to slick the gears with the grease provided to reduce friction.

Refer to the pictures for step by step supplementary instructions to the paper instructions included in the kit.

Step 12: Build a Battery Support Box

This battery box was built using a Meccano Erector set. Erector sets are great sources for frames for projects. The battery box does not need to be high tech, the iteration before this robot was made from cardboard.

Buy Erector sets on Amazon

Step 13: Mount the Gearbox to the Chassis

The gearbox is slightly too wide for the chassis, so the bolts go down through the gearbox through the notches and into a sandwich plate. The sandwich plate also pinches the battery holder down, which slips underneath the gearbox.

Step 14: Tidy Up the Motor Wiring

For this step, a two-hole erector strut slightly flattened pinches the wires to provide strain-relief. Organize your wires so that they are easy to tell apart after you cover them with the Arduino.

Step 15: Attach the Arduino to the Chassis

Using the drilled holes from the very beginning of the project, use standouts and bolts to space the Arduino up from the chassis. On this model, only three machine screws were used as the components on the Arduino come up to close to the hole nearest the USB port. The spacers and rubber bushings come from the Meccano Erector set.

Step 16: Slide the Motor Shield Into the Arduino

Being very careful not to bend pins, line up the pins from the Motor Shield with the slots in the Arduino and press down until the Motor Shield is secure to the Arduino.

Step 17: Mount the HC-SR04 Ultrasonic Sensor

  1. Tape around a triangular erector set panel.
  2. Tape the sensor around the corners to the panel.
  3. Bolt a strut to the sensor triangle.
  4. Mark and drill holes for mounting screws.
  5. Bolt the sensor mount to the chassis.

Alternatively, purchase HC-SR04 bracket from Amazon.

Step 18: Wire Up the Ultrasonic Distance Sensor

  1. Attach the voltage wire from the sensor, which is marked VCC, down to the Motor Shield in the foremost right position, on the pin that is marked V.
  2. Jumper a wire from the sensor pin marked GND to the Motor Shield pin marked G.

  3. Jumper a wire from the Trigger pin on the sensor to the digital pin 7 marked D7 on the Motor Shield.
  4. Jumper a wire from the Echo pin on the sensor to the digital pin marked D6 on the Motor Shield.

Using computer jumper wires negates using special cables, or regular wire could be soldered to the pins. When soldering, it is good practice to use different colored wire to avoid confusion, or when jumpering use different colored jumpers if they are available.

Refer to the above pictures.

Step 19: Mount the Battery

Mount the battery. Be conscious of the placement, as the battery is likely to be the heaviest of all the components on the robot. The battery holder here was mounted too far back, so it was moved forward onto the top of the motor shield heatsink for better weight distribution. Note the battery hookups on the motor shield. The red wire goes to positive, and the black to negative. Clip the battery plugs together and the Arduino and Motor Shield lights should illuminate.

Step 20: Load Your Program

Programs in the Arduino language are called sketches. Load this sample sketch and your robot will be zooming around in no time! If you have problems with the .ino file, the program is included below in bold, just copy and paste into the Arduino executable window.

//Compilation of robotics programs for use on Instructables. Thanks for everyone that contributed!

#define trigPin 7 #define echoPin 6 //#define led 11 //#define led2 10

int pinI1=8;//define I1 interface int pinI2=11;//define I2 interface int speedpinA=9;//enable motor A int pinI3=12;//define I3 interface int pinI4=13;//define I4 interface int speedpinB=10;//enable motor B

void setup() { Serial.begin (9600); pinMode(trigPin, OUTPUT); pinMode(echoPin, INPUT); // pinMode(led, OUTPUT);// // pinMode(led2, OUTPUT);//

pinMode(pinI1,OUTPUT); pinMode(pinI2,OUTPUT); pinMode(speedpinA,OUTPUT); pinMode(pinI3,OUTPUT); pinMode(pinI4,OUTPUT); pinMode(speedpinB,OUTPUT); }

void loop() { long duration, distance; digitalWrite(trigPin, LOW); // Added this line delayMicroseconds(2); // Added this line digitalWrite(trigPin, HIGH); // delayMicroseconds(1000); - Removed this line delayMicroseconds(10); // Added this line digitalWrite(trigPin, LOW); duration = pulseIn(echoPin, HIGH); distance = (duration/2) / 29.1; if (distance < 40) { // This is where the LED On/Off happens analogWrite(speedpinA,0);//Slows speed of motors to zero analogWrite(speedpinB,0);//Slows speed of motors to zero digitalWrite(pinI4,LOW);//turn DC Motor B move clockwise digitalWrite(pinI3,HIGH); digitalWrite(pinI2,LOW);//turn DC Motor A move anticlockwise digitalWrite(pinI1,HIGH); // digitalWrite(led,HIGH); // When the Red condition is met, the Green LED should turn off // digitalWrite(led2,LOW); } else { analogWrite(speedpinA,240);//Drive Forward analogWrite(speedpinB,240);//Drive Forward digitalWrite(pinI4,LOW);//turn DC Motor B move clockwise digitalWrite(pinI3,HIGH); digitalWrite(pinI2,LOW);//turn DC Motor A move anticlockwise digitalWrite(pinI1,HIGH); // digitalWrite(led,LOW); // digitalWrite(led2,HIGH); } if (distance >= 200 || distance <= 0){ analogWrite(speedpinA,240);//Drive Forward analogWrite(speedpinB,240);//Drive Forward digitalWrite(pinI4,LOW);//turn DC Motor B move clockwise digitalWrite(pinI3,HIGH); digitalWrite(pinI2,LOW);//turn DC Motor A move anticlockwise digitalWrite(pinI1,HIGH); Serial.println("Out of range"); } else { Serial.print(distance); Serial.println(" cm"); } delay(500); }

Refer to the Arduino Website for detailed instructions concerning loading programs, writing your own programs, and researching robot logic. Arduino has a huge community of people working on all aspects of the controller, any problem you are likely to encounter has most likely already been solved.

Step 21: Finished Robot!

This robot will give you a great starting point for a number of robotics projects. You are limited only by your creativity! Thank you for reading this Instructable!

Comments

author
MayankP37 (author)2017-05-12

Can you upload a video of its tutorial with how to assemble the whole thing including the servo

author
salah0 (author)2016-06-11

great job ,, but i have some questions

what is the main idea of this robot ?
and can we get a video of its performance ?

author
alipala (author)2016-03-29

How did you connect the battery to Arduino?

author
JusTheSame (author)2016-03-17

Hey! I'm very new to Arduino, robots and such, so I hope you can bear with me. I'm wondering what this particular robot is doing? I mean is it following something or what's the purpose of it?

author
jakeng1234 (author)2015-10-05

Hi! This is my first time to build a robot and have gone through all the sourcing parts. However, I'm wondering how would you control the robot if you don't mention about the controller and where to get them?? sorry if i asked a stupid question.

author
dcordova318 (author)jakeng12342015-10-18

Hi! The robot is controlled by the Arduino, which is like the robot's brain. You program the Arduino with a computer. Arduino's have all sorts of accessories and add on devices. You could add a remote control, or radio or bluetooth or whichever controls you like!

author
jakeng1234 (author)dcordova3182015-12-27

I have the turnigy battery like you have in the pic but how you connect it?

author
jakeng1234 (author)dcordova3182015-11-19

Oh i see. Thanks so much!!

author
mohamh0m (author)2015-11-05

Good day,

That's awesome work. but I have a question. what if I used different motor shield like this one

http://www.ebay.com/itm/Motor-Drive-Expansion-Shield-Board-Module-L293D-For-Arduino-Duemilanove-Mega-UNO-/221605183415?hash=item3398b2bfb7:g:cOQAAOSwMKpUZaoN

and I will crunch the sensor wires with the shield pins. what are the changes should be done

author
bukiadeniji made it! (author)2015-09-20

This is one of the best written instructables articles I have read. It is very clear, descriptive and articulate. Great job!!

I finally completed this robot; though I had to buy a few more parts, including a Meccano Erector set. I added the micro servo and mounted the ultrasonic sensors on it to also check for obstacles on either sides of the robot and determine the least crowded direction to turn to. I will post the updated code.

Tracked_OAR_Front_1.jpgTracked_OAR_Side_1.jpgTracked_OAR_Side_2.jpgTracked_OAR_Top_1.jpg
author
dcordova318 (author)bukiadeniji2015-10-18

Great job on the robot, looks excellent! Would be interested in seeing your servo code, I haven't made it there yet!

author
bukiadeniji (author)dcordova3182015-11-03

Thanks. You can find my code here - https://github.com/bukiadeniji/TrackedOAR

author
WillShir (author)2015-10-17

hello, i am having difficulties with your code. the first version only permits the robot to hear something in front of it and then it stops without turning or backing up. the second version errors while compiling. it says that newping.h: no such file or directory.. please help? i am very new to arduino and love this project. i noticed also that the servo instructions are absent from this instructable. or i may be missing something. thank you in advance for any guidance. it is probably just something very simple....

author
dcordova318 (author)WillShir2015-10-18

Hi there! I'm sorry about that, I found a different ultrasonic sensor library called Newping, you can check it out here: http://playground.arduino.cc/Code/NewPing

Follow the instructions on that page and that will add the Newping.h library to your existing arduino libraries. This will allow the second .ino file to work. The second .ino file was not compiling because at the very beginning of the code we told it to include the Newping.h file which was not there.

Hope this helps!

author
WillShir (author)dcordova3182015-10-18

Thanks for the information and your quick response. an update: successfully compiled and loaded the second .ino this time after following the directions for adding the "newping.h" to the library. i am having erratic operation with the bot however. it is hard to even describe, really. it does not operate correctly at all. sometimes starts going forward, sometimes goes in reverse... sometimes the ultrasonic sensor "hears" an object but then does not... very erratic... do you think having the v2 driver board would cause this? i am using an r3 uno, and the v2 seeedstudios driver board. what are the wire placements for the ultrasonic sensor? i have Vcc from the sensor to Vin on the driver pcb. thanks again for getting back to me so quickly. i am still tinkering. looking at the code, it makes sense but i am new. i plan on investing on a beginners arduino code book. any recommendations? forgive all the Q's... haha. thank you!

author
ChargerIIC made it! (author)2015-10-05

This article helped figure out some of the problems with my tracked robot ChaserOne. I haven't used the micro servo yet, but am thinking of adding a second ultrasonic that can work with the first in a sort of 'turret'

ChaserOne.mp4
author
dcordova318 (author)ChargerIIC2015-10-18

I haven't myself used the servo either. Do a search for arrays of ultrasonic sensors, I have found instances where people used up to twenty different sensors! Good luck!

author
ChargerIIC made it! (author)2015-10-05

This article helped figure out some of the problems with my tracked robot ChaserOne. I haven't used the micro servo yet, but am thinking of adding a second ultrasonic that can work with the first in a sort of 'turret'

ChaserOne.mp4
author
showmemuny (author)2015-09-05

Great project idea! Me and my daughter worked on this together and had a great time but we ran into one problem. We used the updated motor shield, V2.0, and the with this program it just stops when the sensor detects something! I'm just starting out on Arduino programming and can't seem to get it to turn, any ideas?

author
dcordova318 (author)showmemuny2015-09-12

Check out the second .ino file I've added on the programming step. It is a lot more fun that the first file. Let me know if you have any issues!

author
michael_nonan (author)2015-08-25

QS: Im starting to build this but with some modifications. I would like to make it an RC maybe thru wifi and an android smart phone. Any ideas how can i achieve this?

author

Sorry about the delayed response, check out this Adafruit module, http://www.adafruit.com/products/1469 . There are also plenty of other wifi-arduino products out there that may suite your needs. I personally haven't tried wifi projects yet but I am working on some radio controlled projects. Let me know how it goes!

author

What do you think will have a better range? Wifi or radio? Im actually not really sure to what should I use. I would like my robot to be controlled remotely. Wifi, i guess, has the advantage of being controlled via smart phone.

author

I would go Wifi for controlling from your phone, for greater range I would go radio. If it is a ground based robot radio should have plenty of range as this is the means radio controlled airplane and helicopter enthusiasts use. There are all kinds of radio receivers and transmitters on HobbyKing.com, it is a good place to look. I haven't reached that stage with my robot, good luck!

author
ChargerIIC (author)2015-09-11

Which Gear Ratio did you use?

author
Vinterwoo (author)2015-09-06

I've got the new Arduino shield (as opposed to the old one pictured here), and just wanted to check I got the right hookups since the abbreviations on my board are different. Can someone confirm if it is:

Vcc -> Vin

GND -> GND

Trig -> 7 (on the digital side)

Echo -> 6 (on the digital side)

And just to be clear, the wires from the main battery attached to the green + and - screw in connectors on the shield. And the motors get attached to the green screw connectors labeled Out 1-4?

Thanks!

author
abeer2 (author)2015-08-30

Dumb question: I bought the Turnigy 1.8 (1800mah) nano-tech LiPo Battery from HobbyKing 7.4 Volts but how do I charge it...?

Currently in progress of making it. I think your guide should include the fact that you might need additional wires and bolts for fixing the arduino board and connecting all of the pieces together. Otherwise a great guide and I will make sure to post pictures once I am finished, hopefully next week!

author
dcordova318 (author)abeer22015-08-30

Not a dumb question at all. Lithium Polymer batteries are somewhat unique in that you want to have a smart charger so you don't accidentally overcharge them. I use this charger ( http://www.all-battery.com/TenergyBalanceCharger-01267.aspx ) , there is this one available on Amazon as well ( http://www.amazon.com/TLP-2000-Tenergy-Universal-Charger-3-7V-14-8V/dp/B001BEXDRQ/ref=sr_1_fkmr1_2?ie=UTF8&qid=1440962292&sr=8-2-fkmr1&keywords=1267+tenergy+charger+li+poly) .

author
ShaunP1 (author)2015-08-30

Thanks for the interesting build! Would be nice to hear
about how the servo moves the sensor and how it is meant to be used with regards to the movement.

author
shootermatic made it! (author)2015-08-19

Here's a version of this I built in 2009. It used the Tamiya double gearbox, custom designed chassis, Arduino Duemilanove with motorshield and bluetooth (not pictured).

add-1452-001-1.jpgPhoto Oct 15, 9 28 59.jpgPhoto Oct 15, 9 29 11.jpgPhoto Oct 15, 9 29 22.jpgPhoto Oct 15, 9 29 35.jpg
author

Can I please have the dimensions of your plexi-glass chassis. I bought the tamiya track wheelset with no chassis included which is ok because I want to DIY it. Thanks.

author
dcordova318 (author)shootermatic2015-08-19

Nice work, I love the chassis and how it looks super clean!

author
michael_nonan (author)2015-08-25

bought my parts last night for this one. They didn't have the double gearbox so I opted for the twin-motor gearbox thinking it's the same thing. It's not! When looking for parts you should pay close attention to the "left/right independent" sign.

author
sablaa (author)2015-08-18

Great project. There was no explanation as to what this does when turned on. I assume that it goes forward until it gets close to an object then turns till there is nothing in front of it. Goes forward and repeats. Do you have a video of it in action. I think this would be a perfect project to do with a freinds son.

author
dcordova318 (author)sablaa2015-08-19

You are correct, the program I've included is very simple. In my opinion, the programming part is the most fun! I'll work on getting a video of the robot in action! Thanks!

author
sablaa (author)dcordova3182015-08-19

Perfect...Thanks! I have already started sourcing out all the parts.

author
Raphango (author)2015-08-19

Great! =D

author
dcordova318 (author)Raphango2015-08-19

Thanks!

author
Brad_tronic (author)2015-08-19

This instructable is very well documented and with any luck, inspire builders of all ages. I appreciate the level of information that you provided (not overly technical) and the time you spent assembling the pictures necessary to help the reader understand. Thank you!

author
dcordova318 (author)Brad_tronic2015-08-19

Thank you! I appreciate your feedback!

author
shootermatic (author)2015-08-18

I've built one like this previously and my golden tip would be not to torque up the gearbox too high as the plastic cogs can't handle the pressure especially driving tracks. Might I add I was using the double gearbox.

author
dcordova318 (author)shootermatic2015-08-19

Good tip! Thanks!

author
UncleEd (author)2015-08-18

Great job. I was immediately interested when I saw the Tamiya chassis and went on to see you used mostly components I collected with the intention of building a very similar robot. I don't believe I have the motor shield, so I can get that, as it will be better than some of the ideas I was considering.

The major omission from your instructions was how to convince my wife that I should use my time working on projects like this, rather than paint the bathroom, mow the 3 acres of lawn, and other totally useless activities around the house.

author
dcordova318 (author)UncleEd2015-08-19

Thank you! As for convincing your wife, maybe try explaining that after you have enough time to build a robot, it can take over those sort of duties for you!

author
jlee170 (author)2015-08-14

Awesome..if I had the financial abilities hahah..a cheaper alternative??

author

May be, friend, you disassembly a printer and buyng a toy car, with some creativity you can do that. (with other sensors (ligth) ) and the arduino uno R3.

Good lucky!

WP_20150819_17_24_54_Pro.jpgPECAS IMPRESSORA.jpgcarro baixo.jpgtudfo junto.jpgWP_20150819_17_24_39_Pro__highres.jpg
author
dcordova318 (author)jlee1702015-08-15

Thank you! A big challenge with robotics is finding parts that are affordable but still have the target performance.

-For the electronics, being flexible in where you source your parts, being willing to buy clones of certain parts, and being able to wait longer for parts that are being shipped from far away can all reduce the financial cost of the project. Be aware, though, that with clones you may have quality or technical support issues that may not be as easy to find a solution for as the name brand parts.

-For the hardware and mechanisms, using cheap alternative materials, such as wood in place of hobby metal hardware, and recycling parts from other products can help save money. This may result in more time spent trying to get the pieces to mate together, but it is also good practice because you get to see into the inner workings of different products.

author
jlee170 (author)2015-08-14

Can I contact you thru email? Address please :3

author
smandal13 (author)2015-08-12

I am very much interested in making such a robot. Very inspiring

author
dcordova318 (author)smandal132015-08-13

Thank you! Making robot is a great learning experience and can be a ton of fun!

About This Instructable

66,080views

532favorites

License:

More by dcordova318:Tracked Arduino Robot
Add instructable to: