Forum 2005-2010 (read only) > Interfacing

Sharp ir sensor GP2Y0A710K0F

**crazypig**:

help............ :'(

**BroHogan**:

yin,

You can not just take the formula I gave for the GP2Y0A02YK0F and apply it to the GP2Y0A710K0F - they have different curves.

Have you looked at your datasheet?

http://sharp.com.cn/products/device/lineup/data/pdf/datasheet/gp2y0a710k_e.pdf

On page 5 you will see a graph of the output. You want to make a formula for this graph - or better yet, from what you actually measure.

The method suggested here is to use Excel.

Also note that on graph very close distances create the same voltage as further distances. (i.e. 2V @ 20cm and 2V @ 180cm)

Unless someone responds with a formula for your exact sensor, you may have to create one yourself.

**crazypig**:

thank you~ but i don't know p.3

[ch916]VO2

Output voltage difference (L=100cm[ch8594]200cm)/

Output voltage differentce (L=200cm[ch8594]550cm)(Note 1,2)

from the curve....200cm[ch8594]550cm, so little change of the voltage.. :'( how the measure it?

**crazypig**:

Dear BroHogan,

I really don't how to calculate the distance using your method, please teach me~ please~~~~~~~~~ :'( :'( :'(

**BroHogan**:

--- Quote ---from the curve....200cm[ch8594]550cm, so little change of the voltage.. how the measure it?

--- End quote ---

Yes, it is a very flat curve - only ~ 0.35V from 250-550cm.

However analogRead gives you .0049V/'click' so in theory you should get a difference of 71 clicks for that distance.

I suggest you print what you are getting from analogRead at various distances to confirm this. Then you could graph that in Excel or you may find it to be flat enough to be used as is.

In any case, it doesn't seem likely that you will get accurate distance measurements from that sensor.

Do you really need actual distance? Wouldn't just the relative distance from analogRead be enough? (You haven't said what your trying to do.)

As far as helping you use Excel, I don't know if you have Excel, or if you have experience with it. If yes, please let me know what you don't understand about the process. (Personally, I hate Excel :) and the last thing I'd like to do is teach it to someone. :) ) If no, and you have Excel, open it and mess around. Then we could have a basis for discussion.

In summery, look at your output from analogRead and see if it looks like you can do something with it. If not, you can look into changing the Aref voltage to get more accurate measurements. You could also consider an opamp.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version