Tankbot - Internet Controlled Tank Robot

 by joe
Contest WinnerFeatured
IMG_5602.JPG
Do you remember a game called Tank Wars? This is an attempt to make a physical version of that classic arcade game. You, the player drive an Arduino powered tank and fire a laser at a target.

This project uses an Arduino to control a tank through a web page. The tank is driven from a control panel on a web page, that is communicated to over a  WiFly. The tank uses a Parallax Ping to avoid obstacles, a servo for aiming the turret and a Tamiya tank platform for locomotion.

Why did I make this you ask? Because like everyone else I wanted to make a tank that fired lasers.

 
Remove these adsRemove these ads by Signing Up

Step 1: Parts

tankbot-building.jpg
For the tank you will need:
-Tamiya Dual Motor Gearbox: http://www.sparkfun.com/products/319
-Tamiya Tank Treads: http://www.sparkfun.com/products/321
-Universal Mounting Platform: http://www.sparkfun.com/products/10016
-Arduino Uno
-Arduino Motor Shield
-Sparkfun ProtoScrew Shield: http://www.sparkfun.com/products/9729
-Laser Pointer
-Parallax Ping: www.parallax.com/tabid/768/ProductID/92/Default.aspx
-Mini Servo: http://www.hitecrcd.com/products/analog/micro-mini/hs-55.html
-Nuts, Bolts, Standoffs, Plexiglass
-Dynamite Prophet Sport II : http://www.dynamiterc.com/Products/Default.aspx?ProdID=DYN4063
-Dynamite 7.2v Battery: http://www.dynamiterc.com/Products/Default.aspx?ProdID=DYN1466
-WiFly RN-XV : http://www.sparkfun.com/products/10822
-XBee Breakout: http://www.sparkfun.com/products/8276


For the target you will need:
-Arduno
-TSL230R : http://www.sparkfun.com/products/8940
-Sparkfun TriColor LED :http://www.sparkfun.com/products/10111
happytriger2000 says: Feb 25, 2013. 7:28 AM
Does it work in different network? or has to be within local network?
wombat_boy says: Dec 22, 2012. 4:57 PM
AMAZING!
Mguilbeau says: Oct 26, 2012. 9:17 AM
Joe,
What does the 1750 mAh battery connect to?

thanks,
high school sophomore
Avadhut.Deshmukh says: Oct 7, 2012. 8:23 AM
tankbot Web Interface help ? ?
D5quar3 says: Jun 23, 2012. 3:05 PM
If I wanted to make my own control panel, is it free?
vteixeira coelho says: May 8, 2012. 11:07 AM
New question. Do you not using any wireless shield with the RN-XV? How do you convert the 5V in the TX / RX to 3.3V? The specs say that support only 3.3V in the TX / RX

Thanks.
chewy3939 says: Apr 27, 2012. 6:32 PM
How much did this end up costing in the end?
vteixeira coelho says: Apr 18, 2012. 12:16 PM
Which Motor shield you used?

Thanks.
joe (author) in reply to vteixeira coelhoApr 21, 2012. 5:33 PM
The official Arduino motorshield.
vteixeira coelho in reply to joeApr 21, 2012. 6:38 PM
Thanks for the reply. I bought Ardumoto from Sparkfun, they use the same 298 h-bridge.

Go job In the tank!
Rgramza says: Apr 8, 2012. 7:47 AM

Hi Joe, maybe if you can help with one last item. I get an compiling error message below from Servo.h

In file included from TankBot_apr07a.cpp:27: C:\Users\Ron\Downloads\arduino-1.0-windows\arduino-1.0\libraries\Servo/Servo.h:99: error: expected ',' or ';' before 'typedef' C:\Users\Ron\Downloads\arduino-1.0-windows\arduino-1.0\libraries\Servo/Servo.h:102: error: expected constructor, destructor, or type conversion before ';' token C:\Users\Ron\Downloads\arduino-1.0-windows\arduino-1.0\libraries\Servo/Servo.h:105: error: 'ServoPin_t' does not name a type

Servo.h code looks like this:

typedef struct  {
uint8_t nbr        :6 ;             // a pin number from 0 to 63
uint8_t isActive   :1 ;             // true if this channel is enabled, pin not pulsed if false
} ServoPin_t   ; 

typedef struct {
  ServoPin_t Pin;
  unsigned int ticks;
} servo_t;


This is the standard servo.h file and have not seen this before. Any thoughts? Thanks, Ron

4-8-2012 10-37-17 AM.png
joe (author) in reply to RgramzaApr 13, 2012. 6:24 AM
Hey Rgramza - Are you using Arduino IDE v1.0?

-Joe
Rgramza in reply to joeApr 16, 2012. 6:12 PM
Hi Joe, I got it all working. I am using IDE V1.0, the problem was a missing semi colon in the credentials file. The Wifly is working great. I can see it registering the data. I don't have the sonar ping, so I have disabled those sections of code and trying to come up with a distance code more than 12 inches. Sure have learned alot in the process. Thanks for your help. All the best, Ron
Rgramza says: Apr 2, 2012. 7:01 PM
Hi Joe, great instructions. Question: I have loaded xampp as a server and its working well. How do I provide access and control to my Ipad. I tried localhost and 127.0.0.1 but it does not work. BTW the files are in the correct place as I am able to access them on the same computer. Thanks!
joe (author) in reply to RgramzaApr 2, 2012. 7:35 PM
Hey Rgramza - You should put in the ip and path of the server, so if the server running xampp on 192.168.1.101 and installed the tankbot code in /tankbot you would use the URL http://192.168.1.101/tankbot

Let me know how it goes! I just uploaded a new version of the web code and arduino code.


-Joe
Rgramza in reply to joeApr 4, 2012. 5:53 PM
Hi Joe, well I think I am closer. Meaning I am getting a 404 error, which means server is talking but the URL is not found. I am using http://192.168.15.1/tankbot/index.php. When I use the the full URL http://192.168.1.10X/tankbot/index.php, I get no server. BTH I can connect to my printer page and router from the IPAD using URL http:// numbers. I have turned off the firewall and user controll but no change. xampp control panel is on and running. Your new down load looks great! Any thoughts...? I am still researching... Thanks Ron
joe (author) in reply to RgramzaApr 5, 2012. 6:35 AM
Hey Ron - We'll get this thing working! Lets do a little trouble shooting, On the Xammp box where is the index.php located (i.e. /var/www/html/tankbot/index.php)?

On the xampp box can you tail the log file:
i.e. tail -f /var/log/httpd/error_log

Then attempt to browse the page from your ipad/laptop
Then attempt to browse the page from the xampp box (where it works already right?)

Let me know what it says.

-Joe
Rgramza in reply to joeApr 5, 2012. 7:38 PM
Hi Joe, I have the index.php, tankbot header and images folder in the htdocs root directory. I now can bring up the image using explorer either using 127.0.0.1 or my IP address 192.168.15.xxx or localhost. All work well. Still can't get another window xp computer or Ipad to find the site. Here are the access log.____________________________________________________________127.0.0.1 - - [05/Apr/2012:22:26:56 -0400] "GET /images/tankbot-controls2_54.gif HTTP/1.1" 304 - "http://127.0.0.1/index.php" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; InfoPath.3; .NET CLR 1.1.4322; yie9; Creative AutoUpdate v1.41.02

Not sure about tail -f var/log stuff or where to go....I have disable all the security not sure if thats the problem. It seems I need to provide privelages in the admin section to the ipad or another computer, but not sure...
Rgramza in reply to RgramzaApr 6, 2012. 6:04 PM
Hi joe, I got it. My firewall was blocking port 80. I had to open the port, but an error message came up. So I closed and reset the port on the main computer. Now the Ipad can open and access the file. Thanks for all the help. Cheers!
Catsunami says: Apr 1, 2012. 11:20 AM
That's so cool! I'm building a robot too (albeit mine is aimed at cuteness rather than super awesome laser-ness), and I'm looking for caterpillar tracks like yours. How wide are they?

Thanks!
joe (author) in reply to CatsunamiApr 2, 2012. 7:44 PM
Hey Cat - Each track is about 3/4" wide. The length is adjustable and it makes the tank remarkable capable at climbing over obstacles. You can check them out here:
http://www.sparkfun.com/products/321

-Joe
Catsunami in reply to joeApr 2, 2012. 11:51 PM
Oo that will work perfectly. Thanks! Good luck with the contests!
jgulick says: Mar 29, 2012. 8:40 PM
Wow Joe! That's pretty cool! Great job!
joe (author) in reply to jgulickApr 2, 2012. 7:46 PM
Thanks jgulick!
tzq33tdq says: Mar 29, 2012. 10:10 PM
COOL!!! how would i add a camera though???
joe (author) in reply to tzq33tdqApr 2, 2012. 7:45 PM
The easiest way would be to buy a WiFi web cam and stick on the top. The arduino can't really do video over the WiFly, 9600 baud is too slow. But it would be awesome to have a tanks eye view!
-Joe
sitearm says: Mar 29, 2012. 9:49 AM
@Joe; Hi! Love the video, the cat, and your punchline, "Because like everyone else I wanted to make a tank that fired lasers." Have tweeted. Cheers! Site
joe (author) in reply to sitearmApr 2, 2012. 7:44 PM
Thanks Sitearm!
tigerbomb8 says: Mar 24, 2012. 11:10 PM
can you please make a diagram using fritzing
rcolon3 in reply to tigerbomb8Mar 29, 2012. 9:28 AM
Dude... he was nice enough to share his work... you need to do a bit of work aswell...
MakersBox says: Mar 29, 2012. 8:06 AM
Nicely done. I could see two of theses battling it out.
RobinHooD_ex says: Mar 25, 2012. 4:54 AM
it's very fun for stealth attack!! :)
joe (author) in reply to RobinHooD_exMar 27, 2012. 3:30 PM
So far it has only stealthily attacked the cat. But one day it will rise up and take part in the robot revolution.

jhunmar100 says: Mar 25, 2012. 5:18 AM
nice one i can vote this project pretty cool..
joe (author) in reply to jhunmar100Mar 27, 2012. 3:28 PM
Thanks Jhunmar!
megaduty says: Mar 26, 2012. 6:57 PM
My kinda tank! I already have a leg up on the physical tank part with a side project. May just attempt your setup! I voted for ya!
Mega Tank.jpg
joe (author) in reply to megadutyMar 27, 2012. 3:28 PM
Thank tank is awesome!
bricabracwizard says: Mar 26, 2012. 10:22 PM
Great build, I've voted for you. Is that a beer on your bench?
joe (author) in reply to bricabracwizardMar 27, 2012. 3:28 PM
Bricabrac- Thanks man, nah it's just an Arnold Palmer http://en.wikipedia.org/wiki/Arnold_Palmer_%28drink%29
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!