Home » Raspberry Pi Tank Project: PiTank Info

Raspberry Pi Tank Project: PiTank Info

Raspberry Pi Tank (PiTank) is an open source project for controlling tank remotely using Raspberry Pi.
It streams video from Raspberry Pi Camera over wi-fi or internet and can be controlled remotely.


Project contains hardware and software part.
1) Hardware:
– Toy tank (originally radiocontrolled);
– Raspberry Pi model B;
– Raspberry Pi Camera;
– Battery bank (5V 2A);
– Wi-Fi dongle;

Rapberry Pi 2

2) Software:
– rpi-gpiod.pl
Perl daemon, listens to commands on tcp/ip socket(text protocol), and convert commands into GPIO pins signals
– rpi-keyboard.pl
Perl script, monitors keyboard presses (WASD for tank movement and ‘[‘ ‘]’ for tower rotation) and send commands via tcp/ip to rpi-gpiod.pl.
Can be started on other machine than rpi-gpiod.pl.
– rpi-tank-rack
WebUI for PiTank written on Ruby, uses lightweight Rack.
Shows streamed video from tank in browser, receives user keypresses and send commands next to rpi-gpiod.pl.


How does it work?
Open tank’s the page in your browser, rpi-tank-rack initializes video stream if it is not started yet and shows real time video from Raspberry Pi Camera.
rpi-tank-rack connects to rpi-gpiod.pl via tcp/ip socket.
Once user presses key (or button icon) in browser command is transmitted via WebSocket to rpi-tank-rack server.
On the server side it is processed and sent next as text command to rpi-gpiod.pl.
rpi-gpiod.pl receives command and sets appropriate GPIO signals.
Raspberry Pi GPIO is connected directly to tank hardware, each pin is responsible for one motor.


All code is on github:
1. Server-side code, listens to tcp/ip socket and generate GPIO pulses based on commands.
Writen by Pavel Bondar(me) on Perl:
2. WebUI for PiTank, shows steamed video in browser, read user keypessed and transmit command via tcp/ip socket into Perl daemon.
Written by Artem Sheremet on Ruby(usingrack):

See small presentation about how it works: