View Full Version : [Question(s)] GP2D120 Question

07-09-2008, 02:12 PM
Good evening guys,
Another question about a different sensor. For the Sharp IR sensor, what is the minimum and maximum analog value received by the Sensor to the board. I'm getting 0-616. My configuration is also that I made the wires longer by 10ft. Also is the values suppose to change when something stationary is in front of the sensor? For example, when an stationary object is in front of the IR, I read in 612,607,608,610,607,611,609. Also the equation to use to convert the 10 bit A2D Sharp sensor only works for 0-1023. Is there an equation to use for one that goes to 0-616? Thanks again. Also in the C API , is there a function that can change the sensitivity or resolution of the sensor. I've looked but wasn't able to find it. Thank you God bless.

07-09-2008, 10:20 PM
When you say "the board", what board are you referring to? If you're using the 8/8/8 Interface kit, are you using the signal conditioning board (http://www.phidgets.com/products.php?product_id=1101)? We carry the same thing, but I can't seem to bring up our site right now to link to it.

About the voltage - Courtesy of Acroname (http://www.acroname.com/robotics/parts/R146-GP2D120.html):

EDIT: Damn! the nice table didn't copy and paste correctly. Just follow the Acroname link above for the info:)

07-09-2008, 10:38 PM
Sounds like your 0-1023 is 10-bit for 5V (0=0V, 1023=5V), in which case the GP2D120 only gives off about 2.6-2.8V maximum (so 610ish sounds good).

607 to 612 sounds like a very small window of error, which is actually quite good for one of these sensors and a cheap 10-bit ADC. Now try it with nothing in the range of the sensor - you will probably get wild values! You will want to take multiple readings for any sort of application, else you may have the problem of nothing being range but the sensor claiming something is there.

Acroname, a while back, put up a good article on linearizing these sensors:
http://www.acroname.com/robotics/inf.../irlinear.html (http://www.acroname.com/robotics/info/articles/irlinear/irlinear.html)

They also had a spreadsheet, with nice graphs and all, but I can no longer find it on their site, so I attached a copy I saved a while back to this post. You should be able to take 8-10 readings from a sensor and then write a C function to read it (I would post what I use on my AVR micros, but it is only 8-bit resolution).


Lastly, more info on the "sensor board" and which "C API" would be helpful....


07-10-2008, 12:13 PM
Thank you very much. I finally got the equation but funny thing is that it only reads accurately up to 4 inches. After that it just gets inaccurate values.

07-10-2008, 07:20 PM
closer or further than 4 inches? All IR sensors have a minimum read distance. Anything closer than that and you get inaccurate values.

07-10-2008, 11:53 PM
That sensor should have an accurate range from ~2-10". They always get funky at the fringes, so I never believe spec (1.6-12" in this case)

07-11-2008, 09:31 AM
I finally got it. I took the data plugged it into to matlab and used a power law equation for it. My R^2 was equal to .9998. Thanks again it works great now. I just have to touch it up but it's working great! Gracias!