Testing Sharp Distance Sensors

February 10th, 2009 by Speedy Leave a reply »

Hi Guys!

Finally I finished the first semester of the NTB in Buchs.
Beside working for my company I had to learn a lot – but – I also had some time to combine the requirements for the “robot” project in the first year with a possible nice feature for the Mikrokopter.

I’m talking about the “traditional” IR (infrared) distance sensors from Sharp. There are different types of them, for example: GP2D12, GP2D120, GP2Y0A02YK (GP2Y0A02)
These three types are sensors that have an analog output (there are also other sensor-types from sharp with adjustable or fixed digital outputs)

The sensors have a very simple interface:

  • Power Supply
  • GND
  • Analog Out

That’s it!

The difference of these three types that I tested is the measuring distance or let me say their “sensitivity”.

For example the GP2D12 specification is:

Range: 8cm to 80 cm
Supply: 5,0V;
Vout: 0,4V bis 2,6V typ. (80cm – 10cm);
Current: 33mA typ.

Typical feedback:

As you can see the output voltage is not linear to the distance – but that is not a big problem for the softare, if you know that behaviour 😉

The GP2D120 if from 4cm to 30cm and the GP2Y0A02YK is from 20cm to 150cm.

One Measurement cycle:

The principle of the measurements is alwas the same. The IR-Led is driven by the sensor electronics to send 32 pulses. The electronic is then measuring the response of the receiving circuit and setting a output voltage, equivalent to the measured distance.
That means that you have a analog signal that updates its value about every 40ms.


Be aware that the sensor needs some time to get the first “serious” output (about 60ms). Here is a startup plot of the GP2D12 with a obstacle in front of it.

Measuring sequence in detail:

One measuring pulse in detail:

As you can see in the picture above you can see that the sensor needs about 220mA for each measuring pulse. So the power supply sould be designed to filter such short current spikes. In average the current consumption of these sensors is ok.

I have made a short video of the tests that i have done with the AVR-USB-uC board, connected via UART to the PC and visualized with LabView.

More tests will follow…

YouTube - Link: Testing Sharp Distance Sensors

Maybe one of these sensors (or a combination of mutiple sensors) can be used to assist the Mikrokopter at automatic landing.


Leave a Reply