Unmanned Ground Vehicle

by the_RAT in Circuits > Arduino

88 Views, 2 Favorites, 0 Comments

Unmanned Ground Vehicle

WhatsApp Image 2024-05-23 at 15.57.52.jpeg
WhatsApp Image 2024-05-23 at 15.57.51.jpeg
WhatsApp Image 2024-05-23 at 15.57.51 (1).jpeg
WhatsApp Image 2024-05-23 at 15.57.52 (1).jpeg

This was an attempt to make a prototype UGV ( unmanned ground vehicle ). A UGV is basically a drone-tank with guided control systems. the tank should be controlled from a far-off distance just like a UAV. the reason to work on this was the recent conflicts across the globe, where we see that tanks and other armored vehicles have become sort of obsolete, due to the ease of availability of UAVs or just a grenade strapped to a cheap Chinese drone.

Reminder that this is a very basic attempt at the concept, since this was made for the college major project, id dint have much time to add more sensors and make it more complex :P

Supplies

Arduino_Uno_-_R3.jpg
nrfwithantenna1.png
61qxk+C3XBL._SX569_.jpg
169631670.png
51WJwnbx2EL.jpg
12-3.jpg
sec-3pin-pot-1280x720.jpg
51iVOUoNONL.jpg
611pPGFEUmL._SL1000_.jpg
81Pzq7AUSWL._SL1500_.jpg
51KbR7uiKlL._SL1000_.jpg
18650-Li-ion-2200mAh-Rechargeable-Battery-Copy_1200x1200.jpg
77fae3dd0a4194f6bbf896a549192857f3370838.jpeg
651cc4eeb1fcf739284543ce-gopro-hero7-white-action-camera.jpg

For this project, you're gonna need a couple of things:-


  • Arduino Uno x 2
  • NRF24l01 PA/LNA module x 2
  • NRF module adapter x 2
  • Adafruit motor shield v2.3 x 2
  • Joystick modules x 2
  • Rotary encoder x 1
  • Potentiometer x 1
  • Johnson geared 300 RPM motor x 4
  • MG996 Metal gear Servo motor x 1
  • NEMA 17 bipolar stepper motor x 1
  • 6 wired Slip ring x 1
  • 3.7v 2200mah Li-ion battery cells x 12
  • A standard Arduino Power Jack
  • a Go pro FPV camera (optional)

These are just the electronic components, there are mechanical components too, however I believe that those can be really improved through 3D printing and proper hardware materials, I will however share how I made the mechanical body for this project.

Module Check

7934-Wiring-Diagram-PER-VIDEO.png

Check the NRF modules


Once you connect the nrf24l01 modules to their respective adapters, you should first check whether both the modules along with their adapters are working or not. for this I found a very good code online by another user by the name "Elekkrypt" . I'll attach the link to download the arduino code.

here's the link to his youtube video - https://youtu.be/yVif9ks9Wqw

basically, the code just checks whether all the registers on the NRF module are responding or not. To verify whether your module is working or not, you should receive the exact same output on the serial monitor as in the image. A basic tip is that if you get somewhat similar output or a 00x0 or 77x7 output then it might not necessarily mean that your modules are not working, it could also mean that the connection of the arduino to the adapter or the adapter to the NRF module is loose.

This step may not be necessary for you if you have been using your modules for a while, however i had to find out the hard way that both of my NRF modules were useless, because I cheaped out and bought them from a shady seller :\

the pins should be connected according to the code because the CE and CSN pins can be connected to D7, D8 as well as D8, D9 respectively.

Remote

WhatsApp Image 2023-11-10 at 1.32.05 PM.jpeg
WhatsApp Image 2023-08-15 at 1.05.19 AM.jpeg

Transmitter side


first I started with the remote side. I first connected the Arduino uno to the NRF module using the adapter module. the Pin connections are as follows:-

CE to D9

CSN to D10

SCK to D13

MOSI to D11

MISO to D12

Gnd to Gnd

Vcc to 5v

Reminder that while using the adapter, the voltage required to run the NRF module increases to 5V, so always connect the vcc to the 5v pin of the arduino.


Joysticks

Cover Image Analog Joystick.jpg

Now I attached the joystick modules. technically you dont need two joystick modules, you can work with a single one controlling both the X and Y axis, however in order to make it look like an RC remote, I used 2 joystick modules, one for the x-axis the other for the y-axis. The pinout is as follows:-

Gnd and Vcc to Gnd and 5v , this is common for both modules

A1 to VRy Pin of the Y-axis module

A3 to VRx Pin of the X-axis module

these two joystick modules will control the motor direction for forward, backward, left and right turn.

Encoder and Potentiometer

Featured-Img.png
20a307b53a563003bedd805c303cf5d03138f062.jpeg

Now I connect the rotary encoder and the potentiometer. The Rotary encoder will control the stepper motor. why rotary encoder and why not a potentiometer? because the Rotary encoder is a digital device and has unlimited range, which helps controlling the stepper motor which is necessary for the turret section.

the potentiometer will control the servo motor on the turret part.

the pinout is as follows:-


rotary encode :-

Vcc to 5V

Gnd to Gnd

pin A to D2

pin B to D3


potentiometer:-

Vcc to 5V

Gnd to Gnd

Signal to A5


Note that by this point there have been more connections to the 5V pin then there are actual 5V pins on the arduino, to deal with this I used a small part of a breadboard that I cut so that it can fit in the remote that I used.

Remote Assembly

WhatsApp Image 2024-05-23 at 21.05.33 (1).jpeg
WhatsApp Image 2024-05-23 at 21.05.34 (2).jpeg
WhatsApp Image 2024-05-23 at 21.05.34 (1).jpeg
WhatsApp Image 2024-05-23 at 21.05.34.jpeg
WhatsApp Image 2024-05-23 at 21.05.33.jpeg

Finally I connected everything and fitted it all in a Quadcopter remote that i previously owned. i had to cut some parts out and make a few more holes to make everything fit, but the result was fairly decent.

secondly, the Go pro that goes on top of the turret will send the live video feed in first person to a smart phone, so i added a phone holder to the remote. In my original design I was going to use a VR setup for the video feed, however, I don't own a Gopro, I own a Gopro clone, which was very old and so its software part never really had an update for the newer android versions. Sooooo, I had to use a third party software to connect the camera with my phone, but there was no VR setting available so i had to settle for using a phone holder on the remote. \

The remote already had battery slots available for generic AA batteries. The metal gear on the back is the rotary encoder. its a bit wider than the potentiometer, 6mm diameter to be precise, so I attached the only thing i could find with a 6mm hole in it as a knob for the encoder :P

Anyways, I've attached the code for the remote.

Downloads

The Body

WhatsApp Image 2024-05-24 at 12.35.40.jpeg
WhatsApp Image 2024-05-24 at 12.35.43.jpeg
WhatsApp Image 2024-05-24 at 13.07.18.jpeg
WhatsApp Image 2024-05-24 at 12.35.41 (1).jpeg
WhatsApp Image 2024-05-24 at 12.35.41 (2).jpeg
WhatsApp Image 2024-05-24 at 12.35.42 (1).jpeg
WhatsApp Image 2024-05-24 at 12.35.42.jpeg
WhatsApp Image 2024-05-24 at 12.35.40 (1).jpeg

So, I made the body for this project using a thin iron sheet. The body for this UGV is similar to a basic tank, which means it will have tracks and suspension as well. I decided to attach 5 bearings on each sidewalls, which will act as the pivot points for the smaller wheels of the tank. The bearings I chose were 628zz, chosen according to the size of the model. ignore the motors in the last pic though, as throughout the proccess of making this, I had to change the motors a few times in order to meet the torque requirements, although the hole for the motors is at the same spot.

The Suspension

WhatsApp Image 2024-05-24 at 12.35.41.jpeg
WhatsApp Image 2024-05-24 at 12.35.40 (2).jpeg
WhatsApp Image 2024-05-24 at 12.35.43 (1).jpeg
WhatsApp Image 2024-05-24 at 13.07.16.jpeg
WhatsApp Image 2024-05-24 at 13.00.52.jpeg

I made these angled strips out of some metal strips that I already had, all the angled strips have the same angle. I used long screws to act as the axels through the bearings in the previous step, which I attached to the side walls. on these axels, as you can see, I put the angled strips. since I used Screws as the axel, I could easily attach the angled strips to them using 2 nuts, one before the metal strip, one after the metal strip. by adjusting these two nuts, I could even adjust how far from the side wall, I need the Metal strips to be at, so that the small wheels (in the third pic) can fit inside the tank track.

Now, the small wheels, I had to make on my own, as I couldn't find prebuilt wheels of the size I wanted. how i made them was, I used Sunboard to act as the core of the wheels, so that they have a rough edge to grip the tracks, as well as being light weighed. I attached aluminum washers on both the sides to give them a bit of weight, and to make the wheels thicker. In order to have them freely rotate on an axel, I used a bearing at the center for each wheel.

I added an H shaped metal strip to hold the wheels in place, and in the last pic you can see, the final arrangement of the springs and the wheels. I was actually surprised That this worked since this was the first time I made suspensions. And further when all the equipment was loaded on the tank, the suspension was working phenomenally.

The Tracks

WhatsApp Image 2024-05-24 at 13.07.16 (1).jpeg
WhatsApp Image 2024-05-24 at 13.07.17.jpeg
WhatsApp Image 2024-05-24 at 13.07.16 (2).jpeg
WhatsApp Image 2024-05-24 at 13.07.17 (1).jpeg
WhatsApp Image 2024-05-24 at 13.07.19.jpeg
WhatsApp Image 2024-05-24 at 13.07.19 (1).jpeg
WhatsApp Image 2024-05-24 at 13.07.18 (1).jpeg
WhatsApp Image 2024-05-24 at 13.07.18 (2).jpeg

this part includes not just the track, but the big geared wheels, which in the end I decided to directly connect to the motor axel instead of attaching them to a separate axel, powered through gears. Originally, I decided to use the cycle gear part and cycle chain for the track, however, they ended up being too heavy and it was a mess trying to make geared wheels for the cycle chain. Then I found out about timing gears, and timing chains, and i found that they had the perfect size for this model, so i used them instead. i had to increase the length of the timing chains, but the result was a nice and light weight track. for each of the 2 tracks, I used 2 extended chains. in image you can see that i used a wood core for the geared wheel. the wooden core has a timing gear on each side, so in total for 4 geared wheels, you will need 8 timing gears.

to complete the tracks, I used a bamboo dining mat that i found. It was perfect to cut strips out of. each strip had the same width as the length of each link in the timing chain. I used Fishing sting to tie these strips to each of link of the two chains, the chains being at the same distance from one another as the width of the geared wheel. This resulted in the final track, which could be moved using the geared wheels, as well as have the smaller wheels rotate on it, pushing it against the direction of motion.

The UGV

WhatsApp Image 2023-11-10 at 2.11.44 PM.jpeg
WhatsApp Image 2023-11-10 at 2.11.43 PM.jpeg

First I stack the adafruit motor shield v2.3 on the Arduino. the motor shield communicates with the arduino using I2C protocol, while the NRF module communicates with the SPI protocol, so there wont be any problem. After connecting the motor shield, connect the NRF module with the exact same pin out as in the case of the remote, and check once more whether the connection of the arduino with the NRF module is working or not. for power supply, I connected 2 cells in series and used a standard arduino power jack to connect it to the arduino. this battery only supplies power to the arduino and the NRF module.

Motor Connections

WhatsApp Image 2024-05-24 at 13.59.51.jpeg
WhatsApp Image 2024-05-24 at 13.59.50.jpeg

I connected the Stepper motor to the the M1 and M2 port of the first motor shield, and the other 2 DC motors are connected to the M3 and M4 port respectively. for power supply, A key thing to note is that each Adafruit motor shield V2.3 comes with a Vin Jumper which basically connects the Vin pin of the arduino to the motor shield. What that does is that the power supply to the arduino uno is shared to the motor shield while this jumper is attached, so if you give separate power to the motor shield (which I did) you have to remove the jumper or else it might cause problems.

I used 5 Li-ion battery cells to power the motor shield. the cells were arranged in a manner so that the net output became 11.1V with 4500mAh. I did this by first making 2 sets of 2 cells connected in series. each with a net voltage of 7.4 volts. Now, these two sets are connected in parallel, to give a net output of 7.4V 4400mAh. now the remaining 1 cell is connected to this cell pack in series, adding another 3.7V thus giving a total output of 11.1V 4400mAh.

After this, i stack another Adafruit motor shield on top of this and give it power through another battery made out of 5 cells, giving a power supply of 11volts. The NRF module is connected after stacking the 2 motor shields. check the connection once through uploading the code, and see whether the tank part is receiving all 4 values from the remote or not. Add switches on each of the power supply too for convenience.

Downloads

Turret

WhatsApp Image 2024-05-24 at 15.03.46.jpeg
WhatsApp Image 2024-05-24 at 16.46.11 (1).jpeg
WhatsApp Image 2024-05-24 at 16.46.11.jpeg
WhatsApp Image 2024-05-24 at 16.46.10.jpeg

since the turret will be rotating, we cannot have direct connections from the body to the turret as the wires would twist and cause problems. So, i used a slip ring. The slip ring has a stationary part with wires and a part that can rotate freely, while maintaining proper connections through metal brushes. Using this, i was able to control the servos through the arduino which is present in the base of the tank. originally i had planned to use 2 slip rings and an extra motor at the base of the turret, to get the real effect of a tank when it rotates its body but the turret stays at the same direction. I was going to do this by writing a few lines in the code for the extra motor, such that it rotates in the opposite direction whenever the base rotates. if the body turns right, the turret motor would turn left and vice versa. by adjusting the speed, id be able to get the turret to stay pointing at one direction, while the body would turn 360 degrees and more. Sadly however, i was running out of time and had to settle for using only one slipring, attached to the base, with the rotating part going through a hollow pipe straight to the turret. the pipe has a gear on it which connects it to the stepper motor, which would be able to rotate it. because of the slipring, the pipe would rotate along with the wires inside it, but the base of the slipring will stay stationary and connected to the arduino.

the turret is then attached to the pipe, so that when the pipe rotates, the turret rotates, and the pipe only rotates when the stepper motor moves. on the turret, i attached the servo's rotating arm, while attaching the camera holder to the servo's body. the servo is connected to the arduino using the slip ring wires.

Note that inside the body, the 3 wires of the slipring will be connected to one of the two servo pins on the motor shield, which is directly connected to the arduino pin D9. you can use the other pin too, that one is connected to Arduino pin D10.

Final Stuff

WhatsApp Image 2024-05-24 at 16.48.08.jpeg

don't forget to add a roof on the tank so that the turret can rotate on a platform. i used the remaining metal sheet, but i think an acrylic sheet roof would've looked better as all the things would've been visible. Like i said the original design was going to be more complex than this when implemented, with VR live video feed and the camera control using flex sensors instead of potentiometer.