3D Print Your Own App-Controlled Mini Tank with FPV Camera | IE

2022-10-26 11:23:43 By : Ms. Lucky Tong

If the video player is not working, you can click on this  alternative video link.

Who doesn't like tanks? Especially teeny-tiny little RC baby ones?

If you are looking for a project and like the looks of this cute little war machine, then read on to find out how to build one for yourself!

Please note, this build requires an APK app that is only compatible with Android phones. 

Like any project of this nature, you are going to need a few bits and bobs. For this build, you will need:

With all the materials needed in hand, it is time to get on with the build. 

The first step is to 3D print all the parts you need. Either use your own 3D printer or find a supportive friend to help you out. The .stl files can be found above and here. 

You may want to vary the color of parts to make your tank really stand out, but that is completely up to you.

Once the printing is complete, and you have cleaned up the parts, the next step is to begin assembly of the mini-tank. Grab two of the motors and place them into their respective slots on the base 3D model part.

Secure them into place using superglue or a hot glue gun. 

Next, grab the 3D printing parts that will form the main driving sprockets for the tank's tracks -- there will be four in total (two for each track). These sprockets come in two main forms.

The first pair should have a hole in the smaller plate to enable them to be affixed to the motors. The other pair will have no holes. 

Assemble them as shown in the video and the image below. The main gear piece would freely rotate around the endplates, this is critical. 

Affix two of the sprockets to each of the motors you previously affixed to the main tank body. Ensure they freely rotate as these will be the main drive wheels for your little baby tank.

With these two wheels in place, grab two of the rubber timing belts and slip onto the main drive wheels. Now grab the other pair of sprockets with no holes in the base. 

Wrap the timing belt tracks around these, and stretch the timing belt so that these sprockets can be superglued on the other end of the tank's main body.

Allow the glue to cure, and then test the tracks by gently rotating it around in one direction. There should be a little resistance from the motor, but they should freely move. 

With the main mechanical parts assembled, it is time to turn our attention to the electrical gubbins'.

Grab the motor driver and some different colored wires. Solder one end of the wires to the driver board, as shown in the video and the image below. 

Now grab the WiFi module. Match up and solder the wires from the driver board as shown in the video and image below -- take your time here and make sure the wires are correctly paired.

Now wire up a battery connector to the driver board ready to receive some juice a little later on. Next, grab the FPV camera and solder it to the WiFi board as shown in the video.

Again, make sure you wire the connector and FPV camera to correct places on the boards. 

Now, grab your partially completed tank and solder the motor wires to the motor driver board as shown. 

And with that, the main micro-circuitry is complete. Now we need to turn our attention to the tank's software.

Connect the WiFi module to a computer using a USB cable. Upload the NodeMCU_Car code provided here (we have also pasted it at the end of this tutorial for your convenience). 

With the code uploaded, stick the electrical gubbins into the belly of the mini-tank. For best results use adhesive pads. 

Now, grab the closer plate for the tank's main body and seal up the belly of the tank. Ensure the FPV camera remains outside of the tank body (obviously).

With the top plate in place, grab some more superglue and affix the FPV camera to the "front" of the tank. 

Now, grab the battery, connect to the battery connector and affix it to the top of the tank. Again consider using adhesive pads as you may want to replace the battery in the future. 

With that, the tank is pretty much complete. Now all you need is a means of controlling the little thing. 

Thankfully for you, the creator made a handy little app for just this purpose. We have included the link to it in the materials list above, but you can also download the .apk file here. 

Once installed, connect your phone to the tank via WiFi, open the app, and get the mini tank a-rumblin'!

For added fun, if you managed to get some FPV goggles that are compatible with your camera, you can also wear these to get a fantastic POV as you explore the area around you with your freshly-minted mini DIY tank. 

As promised, the required code for the tank is as follows: -

#define ENA 14 // Enable/speed motors Right GPIO14(D5) #define ENB 12 // Enable/speed motors Left GPIO12(D6) #define IN_1 D1 // L298N in1 motors Right GPIO15(D8) #define IN_2 D2 // L298N in2 motors Right GPIO13(D7) #define IN_3 D3 // L298N in3 motors Left GPIO2(D4) #define IN_4 D4 // L298N in4 motors Left GPIO0(D3) #include #include #include

String command; //String to store app command state. int speedCar = 800; // 400 - 1023. int speed_Coeff = 3;

const char* ssid = "NodeMCU Car"; ESP8266WebServer server(80);

void setup() { pinMode(ENA, OUTPUT); pinMode(ENB, OUTPUT); pinMode(IN_1, OUTPUT); pinMode(IN_2, OUTPUT); pinMode(IN_3, OUTPUT); pinMode(IN_4, OUTPUT); Serial.begin(115200); // Connecting WiFi

WiFi.mode(WIFI_AP); WiFi.softAP(ssid);

IPAddress myIP = WiFi.softAPIP(); Serial.print("AP IP address: "); Serial.println(myIP); // Starting WEB-server server.on ( "/", HTTP_handleRoot ); server.onNotFound ( HTTP_handleRoot ); server.begin(); }

digitalWrite(IN_1, LOW); digitalWrite(IN_2, HIGH); analogWrite(ENA, speedCar);

digitalWrite(IN_3, LOW); digitalWrite(IN_4, HIGH); analogWrite(ENB, speedCar); }

digitalWrite(IN_1, HIGH); digitalWrite(IN_2, LOW); analogWrite(ENA, speedCar);

digitalWrite(IN_3, HIGH); digitalWrite(IN_4, LOW); analogWrite(ENB, speedCar); }

digitalWrite(IN_1, HIGH); digitalWrite(IN_2, LOW); analogWrite(ENA, speedCar);

digitalWrite(IN_3, LOW); digitalWrite(IN_4, HIGH); analogWrite(ENB, speedCar); }

digitalWrite(IN_1, LOW); digitalWrite(IN_2, HIGH); analogWrite(ENA, speedCar);

digitalWrite(IN_3, HIGH); digitalWrite(IN_4, LOW); analogWrite(ENB, speedCar); }

void goAheadRight(){ digitalWrite(IN_1, LOW); digitalWrite(IN_2, HIGH); analogWrite(ENA, speedCar/speed_Coeff); digitalWrite(IN_3, LOW); digitalWrite(IN_4, HIGH); analogWrite(ENB, speedCar); }

void goAheadLeft(){ digitalWrite(IN_1, LOW); digitalWrite(IN_2, HIGH); analogWrite(ENA, speedCar);

digitalWrite(IN_3, LOW); digitalWrite(IN_4, HIGH); analogWrite(ENB, speedCar/speed_Coeff); }

digitalWrite(IN_1, HIGH); digitalWrite(IN_2, LOW); analogWrite(ENA, speedCar/speed_Coeff);

digitalWrite(IN_3, HIGH); digitalWrite(IN_4, LOW); analogWrite(ENB, speedCar); }

digitalWrite(IN_1, HIGH); digitalWrite(IN_2, LOW); analogWrite(ENA, speedCar);

digitalWrite(IN_3, HIGH); digitalWrite(IN_4, LOW); analogWrite(ENB, speedCar/speed_Coeff); }

digitalWrite(IN_1, LOW); digitalWrite(IN_2, LOW); analogWrite(ENA, speedCar);

digitalWrite(IN_3, LOW); digitalWrite(IN_4, LOW); analogWrite(ENB, speedCar); }

void loop() { server.handleClient(); command = server.arg("State"); if (command == "F") goAhead(); else if (command == "B") goBack(); else if (command == "L") goLeft(); else if (command == "R") goRight(); else if (command == "I") goAheadRight(); else if (command == "G") goAheadLeft(); else if (command == "J") goBackRight(); else if (command == "H") goBackLeft(); else if (command == "0") speedCar = 400; else if (command == "1") speedCar = 470; else if (command == "2") speedCar = 540; else if (command == "3") speedCar = 610; else if (command == "4") speedCar = 680; else if (command == "5") speedCar = 750; else if (command == "6") speedCar = 820; else if (command == "7") speedCar = 890; else if (command == "8") speedCar = 960; else if (command == "9") speedCar = 1023; else if (command == "S") stopRobot(); }

if( server.hasArg("State") ){ Serial.println(server.arg("State")); } server.send ( 200, "text/html", "" ); delay(1); }

New research shows a direct interaction between dark matter particles and those that make up ordinary matter, contradicting the current prevailing theory of the universe.