RC Robot Tank

Hi, I’m Kenton and I am a rising senior at Gunn High School. For my main project, I decided to build an Arduino RC Robot Tank based on a project I saw on the website that I linked below. I chose this project because I wanted to combine both mechanical and electrical engineering into my project. Also, I love cars, so I thought it would be interesting to build a vehicle by myself. And my goal was to build a project that is more cost efficient than the on one I saw on the website. 
Bill of Material
Build plan
Link to the base project
Schematic

Engineer

Kenton L.

Area of Interest

Electrical Engineering, Industrial Engineering, Mechanical Engineering, Managerial Econocmics

School

Henry M. Gunn Highschool

Grade

Incoming Senior

Reflection

The six weeks at BlueStamp were very memorable. I came to BlueStamp for a hands-on engineering experience. It was rewarding to get to apply the knowledge I learned in school to an actual project, an RC robot tank. I had never used Arduino before I came to BlueStamp, so coding in Arduino was hard for me in the beginning. But, it eventually became easy when I familiarize myself with it. I really appreciate the ideas that Bluestamp reinforced on us, i.e, we should try our best to think of possible solutions before we ask for help. Most of the time, after trying my best to solve a problem, I would be able to either solve the problem already or at least have a better understanding of how I should approach the problem. I truly enjoyed my time at BlueStamp.

Demo Night Presentation

Second Modification

Second Modification

remote control robot tank
ultrasonic sensor
autonomous tank
My second modification was to have two different modes for my tank: a remote control mode and an automated guiding mode. When the PS2 controller is not on, the tank can guide itself to follow a wall and make left or right turns when necessary. When the PS2 controller is turned on, I can control the robot tank using the controller.

I first worked on coding the Arduino for the automated guiding mode. Using the ultrasonic sensor to calculate the distance, I programmed the Arduino so that if an object is within 15 centimeters on the left side of the tank, the tank would go forward. If the tank encounters an object within 15 centimeters in front, it would try to make a left turn. If there are objects on both the left side and in front of the tank, the tank would make a right turn.

After running a test of the tank guiding itself. I tried to combine that code with my original remote control code. At first, I could not successfully switch between two modes. I solved the problem by putting the automated guiding code under the condition that the controller is not found, so whenever the controller is found, the Arduino would not enter into automated guiding part of the loop. So now, I can both have the robot tank to guide itself automatedly and control it with the PS2 controller.

First Modification

First Modification

PS2 controller tank
Remote Control
ultrasonic sensor
ultrasonic sensor
My first modification is to use an ultrasonic sensor to prevent the robot tank from driving into a wall. 

First, I connected power, ground, trigger, and echo pins of the ultrasonic sensor to the motor shield using jumper wires. Then, I worked on the code that will let the ultrasonic sensor calculate the distance between the tank and the object the tank is approaching. The ultrasonic sensor functions in the way that the trigger sends out an ultrasound as an output and the echo receives the ultrasound as an input after it reflects back from the object. The sensor will measure the time it takes for the ultrasounds to return and use the speed of ultrasound to calculate the distance. I first started off coding the Arduino for the following: when the distance is within 6 centimeters, the motor would shut off. The problem was that as long as the PS2 controller is still sending instructions for moving forward, the motor will start moving forward again after it shuts off. Thus, I coded the Arduino in a way that once the distance between the tank and the object is within 6, the motors will run backward to back the tank up. And even if the PS2 controller is still sending forward instructions, the instructions will be canceled by the backward instructions and thus prevent the tank from running into the wall.

Final Milestone

Final Milestone

RC robot tank
My final milestone is to successfully control two motors wirelessly with the PS2 controller. 

I started off by tearing apart the wireless dongle for the PS2 controller and then I connected the dongle to my motor shield by using multiple jumper wires. Then I needed to write a code for the motor shield to receive signals when different buttons on the controller are pressed using the PS2X Library. But when I tried to control the motors using the PS2 controller, I encountered a difficulty. Although the serial monitor was showing that the motor shield is receiving all the signals from PS2 controller very well, the motors do not respond to those signals at all. Through deeper research, I found out the problem was that my motors are not included in the Adafruit system. After studying my motor shield, I figured out that I need to use the servo library to control the motors. With a correct code, I was finally able to control my tank’s motion wirelessly using the PS2 controller. For example, when I press R2, the right motor will start rotating in the direction that brings the right side of the chassis into forward motion.

In the end, I worked on using just one battery source to power the Arduino board and the motors at the same time. I used to use two battery, one powering the motors through the power jack and one from the USB output powering the Arduino board. I soldered the ground and Vin pins that power the Arduino board to the ground and power pins of the voltage source that power the motors. Now I only need to power the voltage source and the Arduino board will also be powered. My next step would be to think of a few modifications, maybe adding an ultrasonic sensor or infrared sensor.

First Milestone

First Milestone

Arduino Motor shield
Robot Tank
Gearbox
My first milestone is to use the Arduino Uno and the motor shield to control one of the DC motors.

First, I assembled the DC motors gearbox and chassis. The assembly was straightforward. The only problem I faced is that I had to figure out the gear ratio for the motors. After researching, I learned that gear ratio is the ratio of the angular speed of the member of a gear mechanism to that of the final or driven member. Therefore, the higher the gear ratio is, the faster the speed is. After the assembling the DC motor gearbox with the chassis, I did a test with power source directly connecting to the motors. In order to connect the power bank to the motors, I soldered two wires to a breakout board. When the motor is connected with the power source, the gearbox brings the whole chassis into motion.

Next, I started working with Arduino Uno and the motor shield. It was my first time coding with Arduino. I first ran a quick test with only Arduino Uno connected to my computer. I used one of the basic “Blink” code to test make the LED light on the Uno shine. Having succeeded with the “Blink” code, I put together the Uno and the motor shield. When I tried to upload the code that allows the power to go through the motor shield to one of the DC motors, I was unable to upload the code. Through research, I found out that I needed to switch the selector switch to SW_SER when uploading new code. When the code has finished uploading to the Arduino, the switch will need to be flipped back to the HW_SER side. At last, the code was successfully uploaded. Now, as long as the battery is connected to the motor shield, one of the DC motors will start to function and bring one side of the chassis into motion. My next goal would be to use Arduino Uno and the motor shield to control two DC motors separately, and hopefully control it wirelessly.

Starter Project

Minty Boost Portable Charger

Minty Boost
Soldering
Phone Charger
My starter project is the Minty Boost portable charger. 

The charger functions by converting 3V from the AA batteries to 5V to charge a device connected through the USB port. The current comes out of the battery and travels to the inductor. The inductor is a small coil of wire that stores energy in a magnetic field. When the power inductor stores about 5V, the boost converter chip will open up a switch allowing the current to travel to a number of resistor and capacitors. The capacitors stabilize the output voltage, and the resistors determine that the output current can be connected to an Apple device. When the voltage is stable, the current is sent to the device through the USB port. In the process, there is a diode making sure that the current only travel in one direction. While building this charger, I made the mistake of soldering the wire to the wrong ends of the circuit board (power and ground were switched). Instead of desoldering, I cut off the tips of both wires and soldered each wire to a new piece of wire. Then I soldered the new wires to the circuit board. Through this project, I learned how to properly solder and how those small components (resistor, capacitor, inductor, diode, etc) work. I also learned to stay calm when making mistake and looking for the best solution.

Leave a Comment

Start typing and press Enter to search