Introduction: Tankbot - Internet Controlled Tank Robot

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.

Step 1: Parts

For the tank you will need:
-Tamiya Dual Motor Gearbox:
-Tamiya Tank Treads:
-Universal Mounting Platform:
-Arduino Uno
-Arduino Motor Shield
-Sparkfun ProtoScrew Shield:
-Laser Pointer
-Parallax Ping:
-Mini Servo:
-Nuts, Bolts, Standoffs, Plexiglass
-Dynamite Prophet Sport II :
-Dynamite 7.2v Battery:
-WiFly RN-XV :
-XBee Breakout:

For the target you will need:
-TSL230R :
-Sparkfun TriColor LED :

Step 2: Tank: Build

You will need to assemble the following:
-Gear Box
-Tank Treads
-Universal Platform.

I used nuts and bolts to create a platform above this for the Arduino, Servo and PING.

I copied the dimensions of the Universal Plate set for the plexi glass second platform.

The laser pointer can be attached to the servo horn.

But what was really tricky for me, the Arduino Motor Shield uses up a ton of pins, but you cannot see it quickly as it is wired internally. I found it helpful to just quick sketch it out.

Step 3: Power

The tank motors require a lot of power and I did not want to wear down AA batteries or 9v that quickly. The RC car community has spent a good bit of time figuring out small power. So I picked up a Dynamite 7.2v 1750mah battery and Dynamite Sport II charger.

Then used a plug to connect to the motorshield's screw terminal.

Step 4: Tank: Load Code

For the tank you will load the code on this page. It requires the awesome WiFly libraries from They are included in the code attached.

v.2 of the code updated on 3/29.

Step 5: Tank: Iterative Build - Object Avoiding Tank

To make the task a bit easier I built it first to just be an object avoiding robot. I attached the motors, a RC car rechargeable battery, the Arduino and the PING. When

Step 6: Tank: Iterative Build - Web Enabled Tank

Next I added a platform to the body and added the WiFly to get the tank to be controlled over the internet.

At this point the control was just telnetting to port 2000 and sending a command.

Step 7: Tank: Iterative Build - Robot Tanks With Lasers

For this part I attached the servo to the "control platform" by cutting a piece of plexi glass, then routing a hole in it for the servo to sit.

The laser pointer was attached to the servo horn and wired to the Arduino.

Step 8: Web Interface

I used PHP to create a web interface that controls the tank. You could load this on a machine running apache locally (like a Mac) or put it on a server and give remote access to the page to a device like an ipad.

The page opens a socket to the WiFly and sends the actions to it.

Step 9: Target

The target uses a TSL230R, Arduino Mini and a Sparkfun Tricolor LED.

I'd like to improve on this by making the target larger and having it update the web page.

Step 10: Target Code

Load the code.

Step 11: Play the Game

Now that everything is built you can play the game.

You can drive the tank. When you are ready to fire, you can aim the turret and fire.

You have 3 choices of firing, targetted shot, burst and spray.

The target shoot ones shot, the burst fires at a 30° arc and the spray fires 180°.

Step 12: Things Still to Work On.

So there are still a few things I would like to do.

-Make the target update the web page.
-Keep score on the web page.
-Make the target easier to hit.
-Make the target cooler, put it in a model or toy or something
-Put a body on the tank.

Thanks for looking!


blkadder made it! (author)2015-12-10

I just purchased one of the Tamiya setups, and now you have shown me how to drive it around. Thanks very much.

pranavkompally made it! (author)2015-09-30

cool man , can you send me a detailed document to

evanm3 made it! (author)2015-05-31

hey! i'm building the same tankbot with 2 motor car chassis kit. I'm studing step by step your instuctions but on the plan of tank built i can't understand why have more wires on the motors A and B. My car dosent have more than 2 wires at the same motor.

landy3 made it! (author)2014-07-08

You can buy everything for

Tankbot in

landy3 made it! (author)2014-07-08

You can buy everything for

Tankbot in

firazpeerjade made it! (author)2014-02-12

how u upload the without checking when i try to upload i am getting this error

happytriger2000 made it! (author)2013-02-25

Does it work in different network? or has to be within local network?

wombat_boy made it! (author)2012-12-22


Mguilbeau made it! (author)2012-10-26

What does the 1750 mAh battery connect to?

high school sophomore

Avadhut.Deshmukh made it! (author)2012-10-07

tankbot Web Interface help ? ?

vteixeira coelho made it! (author)2012-05-08

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


chewy3939 made it! (author)2012-04-27

How much did this end up costing in the end?

vteixeira coelho made it! (author)2012-04-18

Which Motor shield you used?


joe made it! (author)joe2012-04-21

The official Arduino motorshield.

vteixeira coelho made it! (author)vteixeira coelho2012-04-21

Thanks for the reply. I bought Ardumoto from Sparkfun, they use the same 298 h-bridge.

Go job In the tank!

Rgramza made it! (author)2012-04-08

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 made it! (author)joe2012-04-13

Hey Rgramza - Are you using Arduino IDE v1.0?


Rgramza made it! (author)Rgramza2012-04-16

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 made it! (author)2012-04-02

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 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 made it! (author)joe2012-04-02

Hey Rgramza - You should put in the ip and path of the server, so if the server running xampp on and installed the tankbot code in /tankbot you would use the URL

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


Rgramza made it! (author)Rgramza2012-04-04

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 When I use the the full URL, 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 made it! (author)joe2012-04-05

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.


Rgramza made it! (author)Rgramza2012-04-05

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 or my IP address 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 - "" "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 made it! (author)Rgramza2012-04-06

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 made it! (author)2012-04-01

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?


joe made it! (author)joe2012-04-02

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:


Catsunami made it! (author)Catsunami2012-04-02

Oo that will work perfectly. Thanks! Good luck with the contests!

jgulick made it! (author)2012-03-29

Wow Joe! That's pretty cool! Great job!

joe made it! (author)joe2012-04-02

Thanks jgulick!

tzq33tdq made it! (author)2012-03-29

COOL!!! how would i add a camera though???

joe made it! (author)joe2012-04-02

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!

sitearm made it! (author)2012-03-29

@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 made it! (author)joe2012-04-02

Thanks Sitearm!

tigerbomb8 made it! (author)2012-03-24

can you please make a diagram using fritzing

rcolon3 made it! (author)rcolon32012-03-29

Dude... he was nice enough to share his work... you need to do a bit of work aswell...

MakersBox made it! (author)2012-03-29

Nicely done. I could see two of theses battling it out.

RobinHooD_ex made it! (author)2012-03-25

it's very fun for stealth attack!! :)

joe made it! (author)joe2012-03-27

So far it has only stealthily attacked the cat. But one day it will rise up and take part in the robot revolution.

jhunmar100 made it! (author)2012-03-25

nice one i can vote this project pretty cool..

joe made it! (author)joe2012-03-27

Thanks Jhunmar!

megaduty made it! (author)2012-03-26

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 made it! (author)joe2012-03-27

Thank tank is awesome!

bricabracwizard made it! (author)2012-03-26

Great build, I've voted for you. Is that a beer on your bench?

joe made it! (author)joe2012-03-27

Bricabrac- Thanks man, nah it's just an Arnold Palmer

About This Instructable



Bio: I like to tinker with just about anything, sometimes it works out in the end. Have fun looking at the projects, try tearing something open ... More »
More by joe:Intel Edison Garage Monitor and Alert SystemIntel Edison Fat Bike Tire AnalyzerIntel Galileo Garage Monitor
Add instructable to: