Parts: Analog distance sensors (Sharp GP2D12/2Y0A02)

posted Feb 24th 2009 3:11pm by Ian
filed under: parts, robots hacks

Sharp GP2D12 and 2Y0A02 infrared rangers output a voltage proportionate to the distance of an object from the sensor.  The GPD12 senses objects at a distance of 10-80cm, while the 2Y0A02 has twice the range.

We’ve previously looked at the Sharp GP2Y0D02 digital proximity sensor. It only signals the presence of objects, while the GP2D12 and 2Y0A02 measure distance to them. If you’ve got a GP2YoD02, it might still be possible to tap the analog output. We’ll show you how use these sensors below.

cct

Sharp GP2D12, 10-80cm analog IR ranger (Digikey #425-2046-ND, $12.81). Datasheet (PDF).

Sharp 2Y0A02, 20-150cm analog IR ranger (Digikey #425-2062-ND, $14.38). Datasheet (PDF).

We powered the sensors with a 5volt supply, as shown in the schematic above. We connected the output directly to a multimeter set to measure voltage. The datasheet also recommends a 10uF bypass capacitor between the power and ground pins, but we didn’t use it for this demonstration.

gp2d12

This graph shows the relationship between the output voltage of the GP2D12 and the distance of objects from the sensor (datasheet page 3, figure 6). You can find the distance/voltage curve for the 2Y0A02 in datasheet page 5, figure 2. There’s an equation to determine distance from the output voltage, or you could use a simple lookup table.

The output is unreliable for extremely close objects, seen as the small hump between 5 and 10cm. It’s possible to combat this by using several sensors with overlapping ranges, or by placing sensors so that nothing can come within the minimum range.

For an exhaustive discussion of the various Sharp proximity sensors, check out the Sharp IR ranger information page at Arconame.

Like this post? Check out the parts posts you may have missed. Want to request a part post? Please leave your suggestions in the comments.

Recent Posts



Reader Comments

Leave a Reply

Hack a Day serves up fresh hacks each day, every day from around the web and a special How-To hack each week.

Send us your hacks











Hacks

Resources

RSS newsfeeds

Powered by WordPress

Most commented on (30 days)

Recent comments