User:Messi~enwikiversity/robotCar

Write problem/project Goal
Build an autonomous toy car.

My First Task
My first task is to take home an Arduino to start messing around with codes. I also plan on taking a toy car to examine the inner workings.

Summary of actual work over first weekend
How is what you did different than what you planned?

Week1 Narrative
Tell a detailed story describing what you did for your team over the weekend.

My Second Task
Record what you are planning on doing for the team during the second weekend.

Summary of actual work over second weekend
How is what you did different than what you planned?

Week2 Narrative
Tell a detailed story describing what you did for your team over the weekend.

My Third task
Record what you are planning on doing for the team during the third weekend.

Summary of actual work over third weekend
Coming into week 3, I wasn't sure how to proceed with the motor of my car. I had previous success

running my Arduino code on small motors but not with the much bigger one that the car uses.

The original plan was to use the Monster Moto Shield but I couldn't find a good tutorial on how to

wire it up so I decided to go without it. At least for now.

Using a transistor, I was able to control the big motor on the car but using an separate battery. Now my car runs.

Week3 Narrative
Over the weekend, I improved my Arduino code. Up to this point, the code I was using to run the small propeller motor looks something like this.
 * 1) Make pin9 HIGH for 1000ms
 * 2) Make pin9 LOW for 1000ms
 * 3) Delay or pause for 500ms
 * 4) Do the whole loop over again

Its pretty apparent this isn't very intuitive. What I came up with was a for loop that starts with a counter with maximum number restriction added. So my new and improved code look something like this. This code had a nice gradual effect on how the motor was spinning.
 * 1) Start the count at 0 and set a variable i=0
 * 2) Set the restriction to 300. This means i should always be less that 300. i<300
 * 3) Using the analogWrite function, I set whatever value i is during the count to the pin being used. So when the count start, i=1, so the analogWrite function will be passed the value 1.
 * 4) When the loop starts again, i is added a value of 1 and this goes on and on until i is no longer less than 300

After improving my code, the next step was to tackle the elephant in the room, the car itself. Two things I need: A transistor and a battery to make this work.

At first I was confusing a transistor with a resistor. It took me 3 drawings and failed attempts at wiring everything up before I got it right. This is how I connected everything.
 * 1) I used one of the Ground pins and Pin9 on the Arduino
 * 2) Next, I inserted the transistor on the breadboard
 * 3) Pin9 is connect to the B transistor pin. (The three pin/wire thing are labeled BCE, with C being the middle one)
 * 4) The C transistor pin if connected to one end of the motor via the breadboard
 * 5) The E transistor pin if connected to the Ground pin coming from the arduino via the breadboard
 * 6) The breadboard line that houses the E transistor pin and the Ground arduino pin is connect to ground of the battery
 * 7) And finally the second wire of the motor is connect to the red wire(not ground) of the battery.

And voila, It worked!

On the Thursday of Week3, I was able to use the Monster Motor Shield to power both the front and the back wheels of the toy car. This means I won't need the breadboard or the transistor anymore. No more wires hanging around. Super Clean setup.

Also, using the Motor Shield, I was able to rotate the back wheels of the toy car forward and backward. I also was able to turn the front wheels left or right. The intensity of all four of these directional operations(forward,backward,left,right) can be easily controlled trough the Motor by setting a value 0<x<1023. The higher x is, the faster speed or turn of the wheel being controlled. That is Awesome.

I wrote and tweaked a few lines and got some pretty cool demos going. Check this one out. http://www.youtube.com/watch?v=M2G7vdB_nEU

I also wrote a tutorial on how to setup the Arduino and the Monster Motor Shield Here

My Fourth task
Over the weekend, my plan is to add the ability to use an android device with a USB cord to control the car. Another teammate is working on a WiFi-enabled version of this so, if he can finish that part, I should be ready to get the android phone connected to the car's Arduino through WiFi.

In addition to the android app, I want to have 2 or 3 demos ready to present in class on Tuesday.

Summary of actual work over fourth weekend
I wanted to create an Android app that I can use to control the car. I got a book Beginning Android ADK with Arduino and started putting together all the required software.

Week4 Narrative
I downloaded and setup my working evironment using:
 * 1) Eclipse for Java
 * 2) Android SDK

I followed the guide on Android Dev ,downloaded and installed all the required plugins.

I followed a tutorial about how to send a "hello world" message to the Arduino using an android app. I wasn't able to finish the tutorial because things got a bit confusing, so i will try it again another time. I need to read up on some java since the application was done in java. Specifically about classes and pointers and some of the syntax.

Complete Team Page
Fill out the Team Form (should have already copied the form, created the team page, linked to it and started filling it out).