Sharp IR sensor inaccurate readings

@jremington
could you please tell me what is
open analog input?

@davidefa
So you mean to measure the volt between data wire of the IR sensor and the ground wire isn't it?

I have another question,
the reason I'm using The IR sensor , is to measure height as a part of a larger project to measure weight and height?
So is this sensor reflects well from the surface of the human skull with all its variations ?

An analog input not connected to anything. Picks up up electrical noise from overhead lighting, nearby fingers, etc.

exactly

@jremington
Certainly that is not the case, as the pin A5 is soldered to a jumper wire, but still there are other unused analog pins,
The Nano board is soldered and fixed inside the grey box shown in the photo above.

Forgot to add you are keeping the sensor very low on the table, don't know if this influences the reading of the sensor, as datasheet does not specify an optical angle/cone.
But it might be worth trying making it higher ( or orienting it outside the table, with a tripod holding the target, or point it up... ).
Otherwise the sensor is super simple, only 3 wires, analog output, the multimeter ( connected to the output of the sensor ) should be enough to see where is the problem.

No, it does not work well with dark irregular surfaces, has poor resolution and is very non linear.
My main complaint about the device is that the output is quantized and not a true continuous analog output.

This app note explains. However since the output voltage range of each sensor is different you to do a calibration for each one.

gp2y0a_gp2y0d_series_appl_e-1.pdf (1.0 MB)

@jim-p I hope I can apply what is in the note, but anyway from your answer I conclude this is not the right sensor to measure individual height ?

All I can say is that it works well with white flat objects that are perpendicular to the sensor. If you use your hand and hold it straight and flat and move it back and forth you can get distance readings but I did not do much experimenting with other objects since the readings were inconsistant.

Sharp makes no claims to the resolution, so it's whatever you get.
Also since it's non-linear, the resoultion get worse the farther away the object.

Overall it did not work as I expected it to.

Use your multimeter to check the continuity of the connection. Poor solder joints can behave like intermittent connections, and it is also possible that the wire is broken.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.