Web-controllable/autonomous tank for just about 100 Euros


20 posts
by Psycho Dad » Mon Aug 08, 2011 10:49 am
Short description:
The aim of this project is to create a web-controllable/autonomous tank for about 100 Euros.

Long description:
A 1:24 scale, remote controlled tank being able to move, rotate the gun turret and even shoot tiny bullets up to 25m can be bought for as little as 50 Euros. (Price can even be as low as 30 Euros if one doesn't need the shooting function.) Using just a Raspberry Pi, a USB WLAN adapter, a USB webcam and some very basic soldering skills, this "dumb", remote-controlled tank could be turned into being web-controllable and/or autonomous.

Imagine the following scenario for example: The tank is standing on the floor of your room while you're out. While it seems to do nothing, it constantly monitors the image captured by the webcam that is attached to the gun turret for any changes. If anything happens (like somebody entering the room in your absence), the tank will recognize this and send a message to your mobile phone, notifying you that something's happening in your room (maybe together with a picture). You can then control the tank from anywhere in the world, all you need is to log into the tank's web interface in a web browser (or by using some specially designed smartphone app). While you see a video stream from the webcam attached to the gun turret, you have full control over the tank: You can move it around, control the gun turret and even shoot. (More expensive models can even produce smoke). Since the Raspberry Pi afaik has onboard sound, using just a few additional standard components (microphone and speakers) it would even be possible to talk and listen to the "intruder".

While in practice this scenario may be more of a gimmick, I believe there would be lots of young and grown-up males who'd love to have something like this for toying around. Not only would it be great for surprising/shocking/impressing your parents/friends/girlfriend, it can also be used as a rather simple and low-cost entry into programming autonomous robots. Programming your own robot tank probably sounds much more interesting to young people than learning to program a normal PC.

Bill of Materials:
- Raspberry Pi
- USB WLAN Adapter (about 8 Euros incl. shipping - for example http://www.amazon.de/TP-Link-1.....001WU2N1G/)
- USB Webcam (about 10 Euros incl. shipping - for example http://www.amazon.de/Hercules-.....000U7JFKO/)
- R/C controlled tank (about 50 Euros - http://www.torro-shop.de/produ.....-LONG.html)

Project status:
I have already bought one of those tanks, taken it apart and figured out how all the tank's functions can be controlled. It should be possible to control each function of the tank by simply soldering a few wires to the tank's circuit board and connecting them to a handful of GPIOs. Apart from the small task of figuring out a way to power the Raspberry Pi from the tank's 7.4V battery (simple voltage regulator?), the remaining work should mostly be software development, so I'm pretty much only desperately waiting to finally get my hands on a Raspberry Pi. :)

http://www.raspberrypi.org/wp-content/uploads/2011/08/a4ry2-rc_tank.jpg
Posts: 3
Joined: Sun Aug 07, 2011 9:56 am
by AmyS3 » Mon Aug 08, 2011 4:45 pm
well in fact you can power the raspi directly from the battery.
and since it seems you´re german:
das raspi kann direkt mit ner spannung von ca. 6-16V betrieben werden. jedoch solltest du bedenken das es ungefähr 1 Watt verbraucht. und das ohne webcam oder wlan adapter.
also denk daran ein akku zu verwenden der lange genug hält :-)
Posts: 174
Joined: Tue Aug 02, 2011 4:12 am
by Psycho Dad » Tue Aug 09, 2011 6:59 am
Thanks for the info! So integrating the Raspberry Pi into the tank should be even simpler.
And you're right about the power consumption, that will probably turn out to be the biggest problem.
Posts: 3
Joined: Sun Aug 07, 2011 9:56 am
by AmyS3 » Tue Aug 09, 2011 5:19 pm
just use a battery with lots of Ah ;-)
Posts: 174
Joined: Tue Aug 02, 2011 4:12 am
by Psycho Dad » Tue Aug 09, 2011 7:07 pm
The tank has a battery compartment that the provided battery pack perfectly fits in. So using a bigger/adding a second battery will require some alternative solution. Shouldn't be much of a problem though.
Posts: 3
Joined: Sun Aug 07, 2011 9:56 am
by AmyS3 » Tue Aug 09, 2011 7:16 pm
or you change the battery type..
or maybe you can switch the batteries used in the pack with stronger ones... i´ve done that several times already.
Posts: 174
Joined: Tue Aug 02, 2011 4:12 am
by tsuki » Sun May 27, 2012 10:50 pm
Hi,

Sorry for bumping the oldest thread on this forum, but I am interested in doing a similar project with my Pi.

When you say you have figured out how to control the tank with a few wires connected to the Pi's GPIOs, does that include the drive motors? My understanding (please correct me if I'm wrong) is that these models tend to have simple voltage/current-controlled motors that take a lot of current from their single input, rather than servomotors that could be controlled via a pulse train from the GPIO. Were you thinking of adding your own motor-control electronics, or is there something I've missed from your description?

(Alternatively, are you keeping the tank's main control board intact and attaching the Pi to the RF input, having figured out the protocol?)

One thing to note on the subject of powering your Pi straight from the battery: running the drive motors may cause a drop in battery voltage, so if your Pi keeps dropping out that might be why :) There also may be some back-EMF when the motors stop, so it's probably a good idea to have some filtering of the power supply to the Pi so it doesn't have to cope with the "dirty" supply that feeds the motors.
Posts: 10
Joined: Sun May 27, 2012 10:42 pm
by rurwin » Mon May 28, 2012 6:31 am
It is, as you said, a very old thread. In the old days, the input voltage of the Pi was very wide. It became 5V +/- 5% to reduce costs and make it compatible with USB chargers.

My guess is either the OP did not notice he had a problem with the motors, or had found a way to use the drivers off the R/C board.

I've got a tank like this myself, although rather smaller with no useful electronics. It cost a lot less than €50, but the important thing is that it has two drive motors. Everything else is just electronics.
User avatar
Forum Moderator
Forum Moderator
Posts: 2904
Joined: Mon Jan 09, 2012 3:16 pm
by tsuki » Wed Jun 06, 2012 8:55 pm
Update: Having worked out a few of the things I needed to know, I ended up buying a tank (which now I look more closely is probably exactly the same model as pictured above).

As it stands at the moment, I think the easiest way to get a Raspberry Pi in control of one of these Heng Long tanks is to keep the main control board (RX-13/14/18) intact. It provides several +5V/0V outputs which could be used as a power source for the Pi (though I haven't measured their stability or maximum current supply yet).

Keeping the main board intact also allows us to use its power electronics and keep the Pi for the low-power stuff. These tanks have a separate RF receiver board with a single-wire serial connection between it and the main controller. I have reasonable confidence that the RF receiver bit-bangs instructions to the main controller -- I can't see anything analogue or anything as advanced as a UART. If I get a chance tomorrow I'll stick a scope on that serial line and see if I can figure out the protocol. If so, the Pi's GPIO may be able to directly replace the RF board.

For anyone interested, I'm keeping a build diary on my blog:
Posts: 10
Joined: Sun May 27, 2012 10:42 pm
by tsuki » Thu Jun 14, 2012 8:49 pm
Well, what do you know. It can be done! :)

I now have control of the tank's main drive motors from my Raspberry Pi.

The rest of the build diary so far:

And the video of my motor test program doing its thing: http://youtu.be/HGAsSM8dL-g
Posts: 10
Joined: Sun May 27, 2012 10:42 pm
by tsuki » Tue Jun 26, 2012 9:32 pm
Finally got my tank completely wireless -- it's now driving around the room while being remote controlled over SSH.

Build diary updates:
Posts: 10
Joined: Sun May 27, 2012 10:42 pm
by xtramural » Tue Jun 26, 2012 9:35 pm
T(h)anks for sharing ;)
Posts: 104
Joined: Thu Dec 29, 2011 11:16 pm
Location: Scotland
by tsuki » Fri Jun 29, 2012 5:10 am
One more for now - here's a video of the Raspberry Tank out and about!

http://www.youtube.com/watch?v=QSPcJL1CGjA
Posts: 10
Joined: Sun May 27, 2012 10:42 pm
by tsuki » Thu Jul 19, 2012 9:19 pm
Posts: 10
Joined: Sun May 27, 2012 10:42 pm
by tsuki » Tue Sep 25, 2012 5:20 am
Posts: 10
Joined: Sun May 27, 2012 10:42 pm
by morphy_richards » Tue Sep 25, 2012 7:29 am
This is really inspiring. Excuse me while I look for my jaw I think it dropped onto the floor somewhere.
By the way, just how powerful is the BB gun on that thing?
User avatar
Posts: 860
Joined: Mon Mar 05, 2012 3:26 pm
Location: London
by tsuki » Tue Sep 25, 2012 7:35 am
Thanks! The BB gun isn't all that powerful - it can shoot the balls around 15 metres, but you can put your hand in front of the barrel as it fires and it doesn't hurt.
Posts: 10
Joined: Sun May 27, 2012 10:42 pm
by ghans » Fri Oct 19, 2012 11:25 am
Just awesome.


ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org
Posts: 4487
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany
by tsuki » Sun Dec 09, 2012 12:04 pm
Posts: 10
Joined: Sun May 27, 2012 10:42 pm
by tsuki » Fri Feb 22, 2013 6:26 am
Posts: 10
Joined: Sun May 27, 2012 10:42 pm