May 13, 2011

Journal Entry #5

So far this week, I have cut some wood to size to prepare it for attachment to my car, and I have tested my IR sensors to my satisfaction. Repeating a version of my IR sensor experiment that I conducted previously, I have gathered enough data that I feel I have a good equation to use with my sensors if I need to use them.

So here is the wood I have cut; it's not too exciting, but soon I'll be putting holes in it, and then it gets much more exciting. The type of wood is called Masonite - it is commonly used in tool shops as the top of a work bench, because it is strong and its top is nice and clean. I happened to have a couple sheets, so I figured it would work nicely to support my Arduino. My Arduino will not be screwed directly onto the board, as it would be damaged where its bottom scratches against the board. I have plastic standoffs which screws go through to support the Arduino 3/4" above the platform

Nuts and Standoffs
For the front of the car, where the Ultrasonic sensor and its servo will go, I am still figuring out what needs to be done. The sensor has two holes for screws, which I plan to use with standoffs to place a wooden platform behind the sensor, so that I can screw that platform down. It will likely be placed on a piece of wood which will be screwed into the servo. I'm still working out the details of what happens with the servo, but my current thought is to do a little more woodworking to create a stand for it to be placed into.

My IR sensors have me puzzled as to where they should be placed, in part because I got the wrong ones, requiring me to place them eight inches away from what I want them to measure. However, I am currently of the ideology that I only need to use one sensor to make this car go, so unless necessity dictates otherwise, I'm going to forget about mounting my IR sensors.

The infinite uses of LEGOs!
Speaking of IR sensors, I have finally cracked their distance algorithm. While looking for information about Ultrasonic sensors I came upon this website, which claimed that IR sensors are better than Ultrasonic, so I simply chose to buy the kind he was using (which ended up being a mistake).

His equation for converting the output of the sensor to a distance is as follows:

However, that equation didn't produce accurate results with my sensors. So from repeating the same experiments I did before with the sensor, I came up with the below equation:

They are similar enough, which I take as a good sign. However, I also found a more accurate equation dealing with fourth-degree polynomials:

So how I came up with these. I repeated the experiment of taking distance measurements from the sensor over a range of distance. I took twenty measurements per distance, and repeated that over two feet. I have had issues previously where my sensor would be aiming at the ground, so there would be a maximum distance on it. And also I occasionally had it pointing too much up, so that it would aim over the target. My resolution to this was to aim the sensors up, and use a sheet of paper so that the sensors couldn't shoot too high.

I took measurements for both sensors, as I discovered they didn't produce identical results. Using Excel, I graphed both of their results, found the average, and then graphed that average. Using Excel's built in regression I was able to come up with equations which produce accurate results over the range I care about, which is 8 to 32 inches (as if I did use these on my car, I don't think there's a reason to care about anything more than two feet away).

I took an interesting picture while doing this. Cameras, it turns out, can see IR light. However, they view the light as bluish, when it really should be redder. So in this picture you can see the IR source in the back of the sensor.

What's next? I need to finish mounting the Arduino, which involves drilling some holes. Then I need to continue to work on mounting the Ultrasonic sensor. My new motor driver has arrived, so I have some soldering to do, and then hopefully my car works. A final issue I need to solve is that of the track - I plan on stopping by a Home Depot and looking around their gardening supplies; maybe they'll have something. If not, Poster-board should work just fine.

So 'til next time.

Next: Journal Entry #6