April 22, 2011

Senior Project: Journal Entry #3

This week has been quite productive. In the beginning of the week I met with my Mentor to discuss how the project's going. I took away from that meeting a better understanding of how I'm going to use my sensors. Other than that, my accomplishments this week include soldering, more soldering, utilizing masking tape and screws, some programming, and finally creating an autonomous car. Today I, for the first time, flipped a switch and my car drove itself forward and backward without human input, making it the dumbest autonomous car I know. Details follow.

In my meeting, I discussed with my Mentor what the final result of my car will be. I decided that a good milestone is getting my car to drive around an elliptical track. The next step will be to add obstacles to the track and make the car drive around them. To get this all to work, I will use all three of my sensors. I will mount my ultrasonic sensor on a servo and pan roughly 135 degrees to get an image of the car's surroundings. Using math to avoid scraping the side of the car on a wall, I will have the car go towards the furthest away point. I still have to test my sensor, but hopefully it will be reliable enough that I don't have to worry about noise in my measurements. My two IR sensors will be located on either side of the car to help it know how close it is to a wall, in the event my math is off.

Motor driver in breadboard
This week started of with a soldering iron in my hand. It was a new soldering iron, because the one I'd used the week prior I had deemed old and potentially hazardous. However, I soon learned after a few failed attempts that my new soldering iron was very weak, and thus was unable to melt the solder sufficiently. Thus, I had to go back to using the old soldering iron. And with it, I worked wonders.

The first things I soldered were pins to my motor driver, to allow it to be placed in my breadboard. I then went to soldering the components onto my Protoshield, the shield-thingy for my Arduino that is placed on the top of it. After that, I had more wires to solder. I extended the length of the wires from my two IR sensors. I also connected a power adapter to the battery plug in the car. This battery plug is what gets plugged into the rechargeable battery. It is also connected to a switch, to allow the power to be turned on and off. So by attaching an Arduino-compatible plug to this, I am now able to turn my Arduino on and off at the flick of a switch.

Protoshield on top of Arduino
With the soldering done, it was time to play with my motor driver. I plugged the wires from the motor into the proper slots on the breadboard (using the schematic for the driver), wrote some code (based off some found online), and I was ready to go. The results were good - I was able to spin the wheels. It was time to figure out if I could steer the car - and I ran into issues.

I have a hard time describing how the steering works, so I figure I'll just attach a little video I (thankfully) took before I had completely disassembled the car. As the video shows, the motor turns the wheel which pushes the shaft left or right. The arms, connected by a spring, bring the shaft back to center after it's done steering. The complications that arise from this are that I do not know what the motor was doing while I continued to tell the wheels to turn; it was either moving or stopped, and there is a difference between the two. If I keep the motor running, to counteract the force of the spring, the motor makes an annoying sound which is evidence of it becoming damaged. I took out the spring to eliminate the sound, but with no spring there is nothing to push the wheels back to being straight. In order to figure out what I need to do, I'm going to have to take a closer look at how that motor is supposed to be operated by connecting it back to the RC board.


But I was able to get the rear wheels, the drive wheels, working properly. So I have left out steering for now, but I have gotten the car working. It is fully autonomous, driving without human input. I have a video below as proof of my eighth wonder. You can see in the video that the car is running off of a 9V battery; this is because the car's rechargeable battery is out of power.

Also seen in the video are various pieces of masking tape. Right now, it is the only thing holding my Arduino to my car; a future project will be to find a good way to mount the computer to the car. Also in that vein, I will need to mount my sensors and servo to my car, but I'll solve that issue when I come to it.

Here's the video, the fruits of this past month of labor. 'Til next time, Enjoy!

Sources: [1]