Go Down

Topic: SHARP IR Distance Sensor - GP2D120XJ00F (Read 6 times) previous topic - next topic


Actually, the measurements of a Sharp IR distance sensor are quite stable over time. If you notice jitter in the readings, it is most probably caused by a not sufficiently stable power supply. As I already remarked, these device draw a lot of current when they are firing. Be sure to have sufficient and good capacitors as close to the sensor as possible (ideally a big one for the large power spike, plus a 10nF one in parallel for the high-frequency components).

One the other hand, due to the principle these sensors work with (triangulation), they have a much greater resolution at short distances than on distances farther away. Very similar to human 3D vision which works best at close distances. Any noise you have in the system is basically magnified (distance-wise) if you are working at the upper edge of the distance range.

Note also that these IR sensors tend to work at distances greater than specified, but these measurements might not be as stable as those taken in the specified range.

In working with Sharp IR distance sensors, it is most important that you get the power supply to the sensors right and that you decouple these sensors sufficiently from the rest of your circuit, especially the Arduino. You might want to compare the readings you get with readings when you power the IR sensor with a separate battery.


Jun 29, 2011, 07:17 pm Last Edit: Jul 01, 2011, 04:28 pm by retrolefty Reason: 1
As already mentioned, a critical thing is to make sure you are measuring a value that is within the standard distance range of the IR sensor.

If you look at the datasheet that shows voltage output Vs distance of sensed object there are two key items to see. First the response is non-linear within the valid mesurement range (therefore a need for a linearizing calculation of the raw value) and second that below the minimum range and above the maximum range one gets 'illogical' and unstable voltage values. So one's program should try and keep track or figure out if the measurement is valid or not before using it.



Thanks for the info guys.
Some more information.

I have linearized the output from the sensor(s).
However, the raw values also fluctuate over time.

The measuring distance (25 cm) should be in range of the sensors capabilities (30 cm).

And I have capacitors in place to stabilize the voltage.
(One big and one small, based on the information in the data sheet)
There are other sensors on the same 5 volt line (flex sensors).
So, if my voltage supply was not stable enough for the IR Rangers,
(or destabilized by these sensors) would that not cause readings for the flex sensors to also jitter?

I was thinking that it maybe had something to do with the frequency at which I read them.
The datasheet http://www.sparkfun.com/datasheets/Sensors/Infrared/GP2D120XJ00F_SS.pdf specifies
a "timing chart". I cannot make much sense out of it, but does this imply I cannot read the voltage all the time?
Does the voltage from the sensor need to stabilize before it's ready to be read again?


If I read the timing chart - page 6 - correctly, a reading (worst case) is available after 38.3 + 9.6 + 5.0 ms = 52.9 ms  => 18.9 times per second.
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)


So, I should only read the sensor 18 times per second at most?

Go Up