Arduino Tank: Advanced Arduino Robot with a Functional Gun

Tanks are large, armored vehicles used by the military, but you can build a tiny Arduino tank version as a toy gift or school project. Building this tank is similar to making a robot, but …

Arduino Tank

Tanks are large, armored vehicles used by the military, but you can build a tiny Arduino tank version as a toy gift or school project.

Building this tank is similar to making a robot, but you should equip the vehicle with chain wheels instead of two wheels to resemble the military tank. 

Also, it should have a functional gun that rotates at the top and fires plastic balls, plus a radio controller to give you remote control.

So if you’re familiar with Arduino robots, this project should be a walk in the park. Let’s look at how to build this tank using an Arduino board.

Table of Contents

What You Need

The project requires the following components.

  • Arduino Nano board (R3)
  • L298N motor driver
  • Two DC motors
  • L7805CV servo motor driver
  • Two servo motors
  • Darlington ULN2803 assembly
  • APC220 or NS-12 radio module
  • INA219 battery monitoring module
  • Two jumpers
  • Tank chassis, lid, and gun
  • Battery
  • Several capacitors (shown in the circuit diagrams below)

Tank Hardware Connections

The Arduino Nano board is the brains of the tank, and we’ll connect it to almost all components. 

But since the project will consume lots of power, we’ll have to use a customized power bank with four batteries and five outputs to power the system.

Power Bank Outputs

These power bank outputs consist of the following pins.

Pin NumberFunction
1Negative pin
2On/Off
3GND
4Positive (1.25-16V)
5Positive control pin (10-16.8V)

You can build any custom power bank with more or fewer batteries, but it should have these five pins for this project.

Radio Module Connection

Next, we’ll hook up the communication module to enable the remote control function on the tank. Here’s how to do it.

Power BankArduino Nano
1N/A
2N/A
3GND
4Vin
5N/A

The power supply’s pins one and two should connect to the tank’s body switch.

Arduino NanoAPC220 Module
D1/TxRxD
D0/RxTxD
GNDGND
5VVcc

Also, connect the power bank’s GND pin to the radio control module’s ground pin. Here’s what you should have after making the connections above.

The radio-module connection circuit diagram

The radio-module connection circuit diagram

DC Motor Connections

After that, we’ll hook the DC motors to the Arduino board using the L298N motor driver. 

All components use the power bank’s +11V cra6 connection (pin4) as their power supply (except the battery monitoring module).

Arduino NanoL298N
Vin (connects to the battery’s +11V)+12V
GND (connects to the battery’s GND)GND
D3ENA
A3IN1
A2IN2
A1IN3
A0IN4
D5ENB
L298NMotors
Right motorOUT1 & OUT2
Left motorOUT3 & OUT4
DC motor connections circuit diagram

DC motor connections circuit diagram

Servo Motor Connections

The tank’s gun sits on the rotating tower, which has a swivel bracket to turn the firing chamber left/right and raise/lower it. 

These operations require two servo motors, which we’ll power using the L7805CV motor driver, as shown below.

Arduino NanoL7805CV
Vin (connects to the battery’s +11V)IN
GND (connects to the battery’s GND)GND
Arduino NanoServo Motors
D10Servo incline signal pin
D9Servo turn signal pin
GNDGND pins on both motors
L7805CVServo Motors
OUTPower pins on both motors

Lights Assembly

The tank has three LED lights: two headlights and one on the gun. We’ll need the Darlington ULN2803 assembly to power these components.

Arduino NanoULN2803
GND (connects to the battery’s GND)Pin 9
D12Pins 1 & 2
D11Pins 3 & 4
D4Pins 5 & 6
D2Pins 7 & 8

Each headlight will have a separate resistor (470Ω), and the two will jointly connect to the ULN2803’s pins 11 and 12.

 On the other hand, the gun’s light will connect to the ULN2803’s pins 15 & 16. But all three will draw power from the battery directly.

Light assembly circuit diagram

Battery Monitoring Module

Lastly, we will set up the battery monitoring system using the INA219 module, the only component that connects to the power bank’s 10-16.8V +ve control pin.

INA219Power Bank
VinPin 5 (Positive control pin (10-16.8V))
GNDGND

The Arduino board will draw power from the power bank’s pin 4 (as usual), then connect to the battery monitoring module, as shown below.

Arduino NanoINA219
5VVcc
GNDGND
A5SCL
A4SDA

Follow this circuit diagram to link the components.

Assemble these components inside the tank chassis, then set up the remote controller.

Universal Remote Controller Assembly

You’ll need the following primary components.

  • 7-9V power supply
  • INA219 battery monitoring module
  • Push button switch
  • APC220
  • HC-12
  • HC-05
  • Two ULN2803 modules
  • Arduino Mega

Circuit Diagram

Code

Download these two code files for the Arduino transmitter (universal remote controller) and receiver (tank), then paste them to your IDE and upload each to the respective board

After that, run the tank and try to fire the plastic balls.

Wrap Up

As you can see, this project is slightly more complex than the Arduino project we had looked at earlier, but it is worth the effort. 

However, if you encounter challenges with the implementation or getting the parts (such as the tank chassis), contact us, and we’ll find a way to get them to you.