Week 4 Journal Entry – Sharp GP2Y0A21YK IR Proximity Sensor

SHARP-GP2Y0A21YK-02

The Sharp GP2Y0A21YK is a low cost ($13.95) infrared proximity sensor with an analog output that varies from 3.1V at 10cm to 0.4V at 80cm. It has a JST (Japanese Solderless Terminal) connector and needs either a pigtail jumper wire or direct soldering to the back of the module in order to be hooked up to an Arduino.

The sensor emits a beam of IR light from an internal LED, and then uses a phototransistor to measure the intensity of the light that is bounced back. There are two variations of this sensor: GP2Y0A21YK and GP2Y0D21YK, providing analog and digital outputs respectively. Because the sensor measures the intensity of its reflected light, there is always a small delay between the actual measurement and the response (~39ms). As seen from the timing chart , the GP2Y0D21YK is a little bit slower than the GP2Y0A21YK:

Hooking up the GP2Y0A21YK is very easy; it is exactly the same procedure that we followed using the potentiometer during the last lab: the black wire goes to the ground, the red one goes to the 5V power, and the yellow one goes to the analog input.

GP2Y0A21YK-400x281

There is a free library here, written specifically for the GP2Y0A21YK in order to facilitate the usage of the sensor. Despite a couple of drawbacks, such as nonlinear output, conflicts with the other IR devices (such as a remote control pointed directly into the sensor) and irrelevant data readings within the close proximity to the sensor, the Sharp GP2Y0A21YK is very widely used in many different applications, from TVs to complex robotics.

GP2Y0A21YK Data Sheet

Sensor Specifications

Available from these sellers:

sparkfun.com

acroname.com

elecfreaks.com

 

 

This entry was posted in Uncategorized. Bookmark the permalink.

2 Responses to Week 4 Journal Entry – Sharp GP2Y0A21YK IR Proximity Sensor

  1. Frank Mason says:

    I like what you found on your research of a sensor you would want to use. I have always been fascinated by the kinds of things sonar technology has been able to do, especially in recent years with the advent of the Arduino. It makes investigating its potential much easier and affordable. Who knows, maybe one day every object we come across can have some type of a proximity sensor with an Arduino board powering it. We could potentially interact with many different objects without having to be near them. It could really change the way we as humans interact and think about technology.
    But I would like to ask though, what is the purpose for this sensor, how is it going to be incorporated into your final project? And what inspired you to wanna investigate this particular type of sensor?

    I found some videos on youtube that may be able to help you in finding even more direction and information for your final project.

  2. Yaro says:

    Thank you so much for all these great links! For my final project, I want to convert one very ugly stuffed animal into an interactive toy “hell rabbit”. I want to put an Arduino with a Wave Shield inside, and the IR sensor on the rabbit’s nose. Also, I want to try putting a small servo motor in the rabbit’s neck, so he would be able to move his head, and two red LEDs instead of the eyes. Then, I will put the toy in front of the doorway, and (ideally), when someone will enter in the room, the IR sensor will trigger his or her presence, and the rabbit will immediately make creepy sounds and turn his head with the eyes blinking.
    I choose particularly this IR sensor because of its range (10-80 cm) and its low cost (comparing to the PING sensor). 80cm is the width of a typical doorway, so it is exactly what I need. I was thinking of using a PING sensor first, but then realized that I don’t really need such a wide range. Hopefully, I made a right choice.

Leave a Reply