When I brought my final concept to class, Nick told me that I should use an infrared sensor instead of the sonar ping sensor I was going to use. This threw a kink in my chain as the code for the ping sensor seems to be endless and I spent hours the first night just trying to find an article that even talked about the sensor I was given. Soooooo after a lot of searching and almost giving up on finding good code to make this infrared sensor work, I got it! I tried probably 4 completely different codes (and a series of meddling with them to see if I could "make" them work) before I came across the one I'm using. It's from this site: http://luckylarry.co.uk/arduino-projects/arduino-using-a-sharp-ir-sensor-for-distance-calculation/ and after now using it, there's only one real thing I don't particularly like about it. The article is about how the Sharp IR sensors have a weird output ratio for data and don't give linear feedback like you would expect something measuring distance should. So this guy did a series of tests on his sensor and created a formula for his specific environment to counteract the wonky numbers. The "problem" is that my setup is obviously not his so his numbers really don't do anything for me (from what my testing tells me at least). Despite my best efforts to simply get rid of the extra formulas he's stuck in the code, it doesn't work as I somehow mess up the syntax and aren't learned enough in Arduino to figure it out. I put the word "problem" in quotes earlier because it's not really a problem...I charted the figures it gave me and I can use those just as easily as if it gave me the non-manipulated numbers as I still don't think it'd give it to me in clear inches or anything. So, it's more of a nuisance than a deal breaker. I've babbled enough, onward with pictures!!
The setup

The initial figures....ALL OVER!

Then I tried to be sneaky and make it convert to inches....yeah.....

Yay some regular readings!

More of the setup

Concept prototype

Concept prototype

Concept prototype

With the board attached

Measuring out the distances from the sensor
No comments:
Post a Comment