RC Robot Tank
For my intensive project, I am building an RC Robot Tank. Using a toy tread set, a motor and shield, and Arduino, I am going to build a base for the robot. Then, I will hook up an IR controller and sensor to control the robot.
Area of Interest
Second Milestone Video
For the second (and final) milestone of my RC Robot tank, I mounted everything on my chassis and got my robot moving. Most of the chassis was a simple assembly; I just used the Tamiya track set (the treads are a pain to assemble) and universal plane set. However, connecting the gear wheels to the motors was not a trivial task. I spent a few too many hours and made many, many attempts to create a 3D model to print as a sheath that fit around and connected the motors and the gears. Using TinkerCAD, I created a larger cylinder and created holes inside it to match the shape of the motor and the gear holes.
I mounted the motor shield to the chassis using screws and nuts. The motors were attached to the chassis using zip ties. Additionally, I transferred my IR sensor from bread board to circuit board, and it conveniently floated near the back of the robot. I wrapped the tread around my wheels and the robot moved, although it was unable to turn. I spent some time trying a variety of things, such as applying adhesive material and swapping out parts to try and minimize the friction that was preventing the motors from turning the robot. In the end, I settled for a gradual turn, as it was all my robot could take. Lastly, I attached the battery using zipties above the motors. It was heavy and it made the tank off-balanced, so I decided to use two large bolts in the back (which added a little aesthetic value) as a counterweight, and my project was finished.
For the first Milestone of my RC Robot tank, I got my motors running and I got the IR controller to control their motion. I first mounted the motor shield onto the Arduino. I soldered them together and added a bunch of pins. I then attached the 5 Volt Anker lead-acid battery, which will end up being my main source of power. I cut the USB cord and attached the pink and gray wires to my motor shield. I then attached my motors to the appropriate M1 and M2 ports using jumper wires. It took a few days to get the motors running; I tested many things but the problem ended up being a lack of I2C connections due to the test code (using the Adafruit Motor Shield library) not correctly addressing it.
Once the motors worked, I began to set up the IR Sensor. I first tried it without a breadboard, which didn’t work. I found a schematic for my IR sensor at https://arduino-info.wikispaces.com/file/view/IR-Receiver-AX-1838HS.pdf and assembled a breadboard accordingly. Using code from the IRRemote library, I got the hex codes for the buttons I wanted to use from my controller. To make my code get the remote controller to move the motors, I combined code from the Motor Shield Library and the IRRemote library. To correspond the button presses to a control on the motor, I used the case function, which ended up working better than using if statements, as I had tried before. After a couple days of modifying it, I tested my code and it worked!