Dear friends welcome to another video! In this video, we are going to build an Arduino Tank Robot; an enormous autonomous tank and we are going to try it on the field! Let’s get started!
Intro to the Arduino Tank Robot project
Hello, guys, I am Nick and welcome to educ8s.tv a channel that is all about DIY electronics projects. In this channel, I share everything about the projects I build to help you build similar projects or inspire you to start making things because it is easy, fun and creative. Subscribe to the channel now if you do not want to miss any future video.
Today we are going to build this; an autonomous Arduino tank robot. Let’s watch it in action for a few seconds. As you can see we are indoors now, and the robot is driving itself around. It can detect the obstacles using the ultrasonic sensor. When it detects an obstacle, it stops, it looks right and then left, and it turns to the direction with the most space available. If the obstacle is small in size, it has no problem to overcome it. Let’s now move outside and see how it performs on the ground. …… As you can see the tank is performing great outside as well. It looks very cool, and as you are going to find out, it is straightforward to build. Let’s see how to create it in detail.
WHERE TO BUY
Devastator Kit: http://bit.ly/DevastatorRobot
Romeo Board: http://bit.ly/RomeoBoard
SG90 Servo: http://bit.ly/SG90DFR
Ultrasonic Sensor: http://bit.ly/HCSR04B
Full disclosure: All of the links above are affiliate links. I get a small percentage of each sale they generate. Thank you for your support!
The cost of the parts is about 130$!
The Tank Platform comes in this beautiful looking box. Everything inside is packed well, and it is labeled. The kit comes with an assembly manual which is good but not great. It took me around 4 hours to assemble the kit. The chassis is made of metal, but the wheels, the suspensions, and the drive gear are plastic. Have in mind the kit does not contain the tools you are going to need, an M3 Philips Screwdriver and a small cross sleeve Wrench. You are also going to need a soldering iron just to solder the wires to the motors. After the chassis is complete, before putting the top cover on, we need to connect the electronics. I place the Romeo board in its position, and I connect the motors like this. The next step is to provide power to the board. I am going to use this AA battery holder that comes with the kit, so I am going to connect it according to this schematic diagram. You can also use a LiPo battery if you wish but the package does not contain one. Now using this switch, we turn the robot on or off quickly.
Now that we have connected the motors and the power we need to connect the servo motor and the Ultrasonic distance sensor. We are going to use digital pin 8 for the servo motor. The Romeo board offers easy access to every digital pin, and it has power pins next to each one. So in order to connect the servo, we plug it in like this. The Brown Pin is GND, the Red one is Vcc, and the orange one is the Signal. Now let’s connect the ultrasonic sensor. We connect GND and then VCC like this. Then we connect the Trigger pin to Analog Pin 4 and the ECHO pin to Analog Pin 5. That’s it the electronics are ready! We then screw the servo on the top part of the chassis like this, and we also place the switch in its position. Now we can screw the top part of the frame.
We put the top part in its position, and after screwing six screws, the frame is complete. In order to mount the Ultrasonic distance sensor to the SG90 servo, I 3D printed this simple mount. I glued the servo hand like this, and now we can attach it to the servo easily. I designed this mount myself, and I have uploaded the file to Thingiverse. You can find a link to it in the description below. If you don’t own a 3D printer, you can buy a similar part online or simply use a double sided tape to attach the sensor to the servo. Now the robot is almost ready, all we have to do is to load the code I developed for it. Using a USB cable, I program the board, and then I remove the cable, and I provide power via this battery pack. The Robot is ready, and it is huge. Its dimensions are 25×23 cms; it is the biggest robot I have ever built. Due to its big size and design, it can easily overcome small obstacles. Cool, isn’t it? The robot looks great, and my little nephews love it. Let’s now take a quick look at the code of the Arduino Tank robot.
📥 New Ping Library: https://bitbucket.org/teckel12/arduino-new-ping/downloads/
The code of the Arduino Tank Robot project is similar to the code I used in the simple Arduino robot we built some time ago. I only made some minor changes because we are not using the motor shield this time. So, in order the code to compile we need to download the NewPing library for the ultrasonic sensor. I will provide a link to the library in the description below. The code works like this. At first, we measure the distance from the distance sensor looking straight. If the distance we read is more than 20cms, we are free to move forward. We check the distance from the distance sensor every 40ms, that’s 25 times per second. If the distance we read from the sensor is larger than 20cms, we continue to move forward. If the distance we read is less the 20 cms, we stop the robot, we move back a few Cms, and then we measure the distance from the closest obstacle.
We measure the distance on the left side of the robot and the right side, and we turn the robot on the side where we have more space available to drive. The code is simple to follow and to modify. You can quickly change the robot’s behavior and add more features to it if you wish.
SUBSCRIBE ON YOUTUBE
Never miss a video: Subscribe to educ8s.tv