book collections email follower instructable user
Picture of Raspberry Pi 3 FPV Lego Tank

Lego is great for teaching kids about how things work while letting them have fun at the same time. I know I always enjoyed "playing" with lego when I was a kid. This instructable describes how I built a FPV (First Person View) tank out of lego and a Raspberry Pi 3 (Raspi 3). i tried to keep it as simple as possible, only the step where you adapt the motors to work with lego requires tools and a bit of skill.

The tank basically uses two motors so if you don't want a tank you can make a Romba type robot, the build will be different but the wiring and programs will be exactly the same.

### This project is basically a version 1, so if you want to improve it (of which there is plenty of room to do) please leave a comment. Also all code will be available, on my Github page, links are in the steps.

Things you will need:

  • Some Lego, I used a Lego Technic Arctic Truck that I had lying around. Use your imagination though, this set had tracks and everything to make those work so it was good for this project.
  • A Raspberry Pi, I used a Raspberry Pi 3 because that's what I had, if you have a different model you might be able to make it work but the GPIO pins will differ.
  • A micro SD card with Raspian installed, for the Raspi 3.
  • A Pi camera, Adafruit sells a few as well as different ribbon cables of various lengths. A bought mine from Aliexpress, it has a fisheye lens and was cheap. You might be able to use a webcam, but a Pi camera works out of the box.
  • A USB Power Bank to power the Raspi 3, I think mine cost $8, its 2000mah so runs the Raspi 3 for a while.
  • A battery to power the motors, I used a battery I pulled out of a cheap RC car, it's 7.2 volts, 500mah, and rechargeable so it works pretty well. A 9V battery would be good but you will then also need a connector.
  • Jumper cables, to connect GPIO pins together, at least 5 female to female.
  • L298N Motor Driver Board, these are pretty cheap and allow you to control to motors separately. These are also pretty standard for this type of application.
  • 2 x DC gearbox motor, these ones from Adafruit are good, the exact same one can be bought from Aliexpress too

Miscellaneous

  • Double sided foam tape
  • wire
  • heat shrink
  • tape
  • rubber bands
  • micro USB cable

If you are going to adapt the DC gearbox motors like I did then you will need:

  • box cutter
  • dremel with circular saw blade
  • mini files
  • 5 minute epoxy

You will also need your own PC/laptop to control and program the Raspi 3.

Step 1: Build the Tank

Picture of Build the Tank
DSC_0929.NEF.jpeg
DSC_0921.NEF.jpeg
DSC_0926.NEF.jpeg
DSC_0938.NEF.jpeg
DSC_0931.NEF.jpeg

So these aren't really instructions because this step should really be your own design. I will talk about some of the things I had to consider when building this, but the real fun lies in finding out for yourself (much like actual Lego). Use the photos if they are helpful, it took me ages to develop this design, in the end, the simple road was the best.

  1. Build the rear axles first
    1. and make sure to leave enough room for the motors and make them wide enough for you components to fit inside of. I wanted mine to be quite wide as I wanted everything sitting inside of the axles, this allowed for the tank to be quite low an fit under things and chase the cat.
    2. The wheels on the tracks here have a hole that fits a Lego cross axle, so bear in mind this is where your motors are going to mount.
    3. You need enough clearance for the track at the back and front. You can notice in picture 2 that the "L" peices are not semetric, this is to allow the track room. I originally had them semetric but the track kept rubbing and did at one point become jammed and break the motor adaptor.
  2. Once you have the axles built you can then connect them
    1. using long bits with cross supports at regular intervals. Make sure you space the cross supports so that components fit inbetween them, this helps keep a low profile.
    2. the length will be determined by how much track you have. This track has no stretch so a bit of slack is needed. If you have a rubber track you can make it tighter. Also a running wheel is a nice idea but overall is not needed.
    3. This step was petty straight forward and just involves a bit of trial and error.
  3. The motors are essentially stuck on with double sided foam tape so provide a large surface for them to be stuck to.
  4. The camera mount I made is fairly rubbish, you should definitly try and make your own. I like it low as it looks like you're travelling quickly on the camera. This would be a cool place to upgrade with a servo or two to make the camera movable.

Hopefully these notes are helpful. I built this thing before writing the instructable and am a bit hesitant to pull it apart now that its going. I really do beleive that a better design can be made so I think your own development would be best. Leave a comment if you want me to make it into a full guide, if there is enough demand I'll do it.

lavisher13 months ago
I was wondering about a bigger battery bank @ 12V and using a buck converter to bump the voltage down to power the Pi. I will be building a version of this and trying some different configurations.
benhartreggie1 (author)  lavisher13 months ago
Sounds great, it should work as long as you build the base strong enough to support the weight and the buck converter is stable and can supply enough current. Keep me posted