Tankbot - Internet Controlled Tank Robot

by joe in Circuits > Arduino

74915 Views, 310 Favorites, 0 Comments

Tankbot - Internet Controlled Tank Robot

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.

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

Tank: Build

tankbot-wiring.jpg
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.

Power

IMG_5593.JPG
DYN1466-450.jpg
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.

Tank: Load Code

tankbot-code.jpg
For the tank you will load the code on this page. It requires the awesome WiFly libraries from http://arduinology.blogspot.com. They are included in the code attached.

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

Downloads

Tank: Iterative Build - Object Avoiding Tank

IMG_5372.JPG
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


Tank: Iterative Build - Web Enabled Tank

IMG_5378.JPG
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.

Tank: Iterative Build - Robot Tanks With Lasers

IMG_5586.JPG
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.

Web Interface

tankbot-webdash.jpg
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.


Downloads

Target

IMG_5617.JPG
tankbot-target.jpg
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.

Target Code

tankbot-target-code.jpg
Load the code.

Downloads

Play the Game

IMG_5616.JPG
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°.

Things Still to Work On.

IMG_5614.JPG
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!