Sharp IR Distance Sensor: output too high with no object

Hi,

I have a problem when using a Sharp IR Distance sensor (GP2Y0A21 - range 10cm - 80cm). I'm using the 5V supply from an Arduino Nano, and have run into "odd" behaviour where output is higher when no object is in front of the sensor than when an object is between 8cm & 60cm

To ensure this is not a code or analog input issue, I've simply attached a DMM to the utput (while still using the Nano 5V supply)

Output varies from around 0.9v to 3.0v (appx) when an object is placed between 60 and 10 cm from sensor. So that's kind of OK

The PROBLEM is, output begins to rise up to around 1.3v for distances beyond 60cm, or when no object is in front of the sensor. I know the specification states voltage will fall when objects are < 10cm from the sensor, but I don't expect voltage to rise when an object is beyond 60cm.

I've tried this with several sensors and get similar results with all.

Any ideas why I'm seeing this behavour?

Current behaviour massively reduces usefulness.

Thanks for any advice.

BTW: I saw a similar question posted, but there was no resolution.

To ensure this is not a code or analog input issue, I've simply attached a DMM to the utput

...

I've tried this with several sensors and get similar results with all.

Surely a question for Messrs Sharp then?

(Or your vendor: perhaps they're not real Sharp sensors?)

For the benefit of anyone experiencing a similar issue:

I've solved the problem, and the sensors are fine. It's the Nano / power-supply that's causing the issue.

I was running the Nano from a PC USB port (5V, I assumed).

On testing the 5v ouput from the Nano, I found it's only delivering 4.29V :slightly_frowning_face:

The sensors require a 4.5V to 5.5v supply.

I then tried using an external supply of 7.2V to the Nano and found its 5v output was actually 5V and, happily, the sensors worked as they should - hurrah!

On reflection, it's perhaps not surprising that powering the Nano from USB does not provide sufficient voltage to properly drive the 5V output regulator. I don't know what the minimum supply voltage needs to be to ensure a regulated 5v output, all I can tell you is 7.2V is sufficient in my setup.

I hope this is helpful to those who run into the same "problem" (I don't think it can be classified as a "fault" of either the sensors or the Nano)

(I don't think it can be classified as a "fault" of either the sensors or the Nano)

Indeed, the docs do say that you can use the 5V pin to put 5V in, but to get 5V out the input needs to be over 7V on Vin.