[Sharp logo]

Sharp distance sensor.

Amongst other models, Sharp produces the GP2D02, a distance sensor intended for sanitary hand dryers. It uses a reflective measurement, using at least two wavelengts, red and supposedly infra-red. It achieves a 5% accuracy over a range of 10 to 80 cm (4'' to 32''), and is quite immune to differences in reflector material. It's easily interfaced to a microcontroller, as a two wire 8 bits serial interface is provided. Two more wires are used to carry power (+5V). The next diagram shows the timing of the interface. Direction is as follows: Clock signal, driven by the computer, data line, driven by the sensor.

[Timing diagram for sharp gp2d02]

Figure 1.1 Timing diagram for sharp gp2d02.

The device outputs 8 bits data (bytes). Distance is reported as counts, ranging from 8 at 7.5 cm to approx 80 at 100 cm. The transfer function is not linear by nature, but quite so when squared:

[Transfer function for sharp gp2d02]

Figure 1.2 Distance to counts characteristic.

[Timing diagram for sharp gp2d02]

Figure 1.3 The same plot, but now squared.

Links

8051 sample program for GP2D02
Order your GP2D02 from Conrad Electronics, Germany
Sharp Datasheet


[Next Page] [Goto Index]
[Contact Form]


This article was written by Arian van Dorsten jwasys@xs4all.nl
The most recent version can be found on: http://www.xs4all.nl/~jwasys