Max value range for sharp IR rangefinder?

I'm stuck tinkering around with a Sharp IR rangefinder today. Analog values from my Arduino are between 90(max range)-300(min range).

I know the Arduino is supposed to output between 0-1024. What I can't figure out is that if there's nothing obstructing the IR rangefinder between it's minimum and maximum distances, why am I not seeing values fluctuating between a larger range than 90-300?

Has anyone ever used these IR rangefinders to do more than just report if something is in the way (i.e. as a digital sensor)? I would really like to use this IR to report a distance that an object is away from my robot, but calibrating the thing is becoming a nightmare. Anyone ever encountered this problem before?

This post: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1220532639/4#4 shares some insight on distance reporting, but I'd still like to hear comments from anyone that has tried this and got it to work reliably.

Thanks.

Hey,

I have worked with them before and have a calibration excel file. I worked with the Sharp GP2D02, I published the file here https://webfiles.uci.edu/cagell/docs/IR.xls, I hope that is useful for you.

I also used them as distance sensors and helped me build this simple robot trial Dreambot 3.0 tests (3) - YouTube.

good luck!!

Thanks for sharing the file. Did you end up using all this data to implement a function or did you just use a lookup table in your code?

Cool video, by the way. I was especially impressed by the PS2 mouse hack to get a cheap rotary encoder. Did you find a tutorial on that or was it your own creation? If so, I'd love to see a write up on it, it looks really neat.

Thanks.

Elir,

Are you using the same range finder as mentioned in the thread you pointed to?

Have you measured the voltage on the analogue input pin with a multimeter to check what value the Arduino should be reading?

The graphs on page 5 of the datasheet for the rangefinder mentioned in the other thread:

http://document.sharpsma.com/files/GP2Y0A710K0F_DS.pdf

indicates a maximum output of about 3.1V and a minimum of 1.4 volts.

There are 1024 different levels on the ADC with an input range of 5V.

So, a 3.1V input should give a reading of (1024 / 5) * 3.1 = 635.

1.4 -> (1024 / 5) * 1.4 = 287.

Measuring the voltage on the input pin will enable you to confirm the ADC values you are getting.

If you're not using the same rangefinder, can you post a link to the data sheet of the range finder you are using.

Regards,

Mike

The sensor is a GP2Y0A02 Sharp IR. The datasheet is here: SHARP 66516, 1 datasheet pdf

The voltage swing looks to be about .4 - 2.6V or so. Meaning we have

532.8 for the min distance

and about 82 for the max distance.

This is about right with what I'm getting through experimentation. So I guess I can map this to a voltage change and use the linearized distance equation I've developed to determine what distance the object I'm looking at is from the sensor.

This still doesn't take care of the erratic noise values I'm getting, though. I think I will sum five or ten points and introduce a slight delay into the reading of the data. I may also rig up a resistor & cap combo to smooth it out, as well.

Feel free to look at the datasheet and let me know if there's anything I'm missing.

Thanks guys.

-Eli

Elir,

I had a look at the datasheet, and can't see anything you're missing.

You could try using an external reference voltage for the ADC. This will give you greater resolution in your conversion.

I have heard that the ADC is noisy. Given environment it is hardly surprising. Care taken with power supplies and grounds may improve it.

An external RC filter is worth a try.

Regards,

Mike

elir

good you liked the video, the encoder stuff I made it up, I added a tutorial on that web... so feel free to ask for details or whatever!!

Dolphin