This product is not allowed to ship to the following countries:
Creative Commons images are CC BY-NC-SA 3.0
Description: Infrared proximity sensor made by Sharp. Part # GP2Y0A21YK has an analog output that varies from 3.1V at 10cm to 0.4V at 80cm. The sensor has a Japanese Solderless Terminal (JST) Connector. We recommend purchasing the related pigtail below or soldering wires directly to the back of the module.
Documents:
It's back! This is the LIDAR-Lite v3, a compact, high-performance optical distance measurement sensor from Garmin™. When sp…
This is the HC-SR04 ultrasonic ranging sensor. This economical sensor provides 2cm to 400cm of non-contact measurement functi…
This is the SparkFun "Time-of-Flight" Range Finder, a sensor board for the VL6180 distance sensor. Unlike most distance senso…
Infrared proximity sensor made by Sharp. Part # GP2Y0A02YK0F has an analog output that varies from 2.8V at 15cm to 0.4V at 15…
The ZX Distance and Gesture Sensor is a touchless sensor that is capable of looking for simple gestures. Developed in conjunc…
Infrared proximity sensor made by Sharp. Part # GP2Y0A41SK0F has an analog output that varies from 3.1V at 4cm to 0.3V at 30c…
Three pin JST connector with red, black, and yellow colors. 5 inch wire outs. This cable comes fully assembled as shown and c…
These easy-to-use ultrasonic rangefinders from Maxbotix work the same way as the EZ line that you know and love, but this new…
These easy-to-use ultrasonic rangefinders from Maxbotix work the same way as the EZ line that you know and love, but this new…
These easy-to-use ultrasonic rangefinders from Maxbotix work the same way as the EZ line that you know and love, but this new…
This is a 3-pin, through-hole PH series JST connector. The pins are spaced by 2mm. We really like the solid locking feeling…
This is the new Arduino Uno R3. In addition to all the features of the previous board, the Uno now uses an ATmega16U2 instead…
This is your tried and true white solderless breadboard. It has 2 power buses, 10 columns, and 30 rows - a total of 400 tie i…
A row of headers - break to fit. 40 pins that can be cut to any size. Used with custom PCBs or general custom headers. **Fea…
Resistors are a good thing, in fact, they're actually crucial in a lot of circuit designs. The only problem seems to be that …
At SparkFun we use many Arduinos and we're always looking for the simplest, most stable one. Each board is a bit different an…
Arduino is an open-source physical computing platform based on a simple i/o board and a development environment that implemen…
It's blue! It's thin! It's the Arduino Pro Mini! SparkFun's minimal design approach to Arduino. This is a 5V Arduino running …
This is a simple jumper adapter cable that comes pre-terminated with a female JST connector on one end and a breadboard hooku…
This is a very small light sensor. A photocell changes (also called a [photodetector](http://en.wikipedia.org/wiki/Photodetec…
The LSM9DS1 is a versatile, motion-sensing system-in-a-chip. It houses a 3-axis accelerometer, 3-axis gyroscope, and 3-axis m…
This is a force sensitive resistor with a round, 0.5" diameter, sensing area. This FSR will vary its resistance depending on …
A simple flex sensor 4.5" in length. As the sensor is flexed, the resistance across the sensor increases. Patented technology…
We all know that you can never get too many LEDs. Don't worry, we've got you covered. This is a pack of basic red, yellow, bl…
Based on 1 ratings:
1 of 1 found this helpful:
by Member #630183 verified purchaser
This sensor gives readings that can be converted in distances very easily. My only concern is that is a little noisy and the measurements are not completely stable, they vary within a 2-3 cm range of the real measurement but is normal considering the low cost of the device. The sensor is good for applications that do not require high precision.
Forgot your password?
No account? Register one!
hi, someone can tell me how much dies this module weight?
Distance on graph is definitely in Centimeters. I just did some testing for a class project and this equation fits the data pretty spot on:
distance (cm) = 41.543 * (Voltage + 0.30221) ^ -1.5281 (matlab EzyFit tool)
This is valid for ~0.5 - 3V
Hope this helps
Arduino library for the Sharp GP2Y0A21YK IR Distance sensor: http://code.google.com/p/gp2y0a21yk-library/
Note that this project is now here: https://github.com/jeroendoggen/Arduino-GP2Y0A21YK-library
FOR ALL THAT USE THESE SENSORS::::: In the library, it says it’s in cenimeters but really it’s in inches—I noticed this when attempting to use this on my robot I’m building and realized the data was coming nowhere close to the 80 cm the product page said it would—checked it with a tape measure and realized it was measured in inches rather than centimeters!!!! SAVE YOURSELF THE HASSLE!!! remember this fact!!!
To get centimeters:
Could you please clarify why you state that my library gives the values in inch instead of centimeters.
I just checked my code, but everything seems to be ok.
If you look at the output voltage graph here: http://www.acroname.com/robotics/info/articles/sharp/sharp.html
and my calculations: http://code.google.com/p/gp2y0a21yk-library/source/browse/#hg%2FCalculations
they show similar values.
I live in Belgium and use the metric system, so it would be very strange for me to make this mistake.
Maybe there’s a change in the library—I’m not sure but when I check the measurements using the “centimeters” library, the serial reading shows it in inches!! I originally checked with a metric ruler and I thought the readings were all wrong. But then I checked with an inches ruler and the measurements were accurate (but in inches, not centimeters). And I don’t have a dysfunctional sensor—I have 5 of them that I use and they all show the same thing. Maybe it’s something that changes in United States' Arduino software, but the readings (for me at least) are 100% in inches, not centimeters.
I found the same thing. Was frustrating the frick out of me when the reading was maxing out around 28-29 and I was expect it to be more around 75-80. I put inch measurements in my code and it started acting properly. Just be aware!
Maybe you made a mistake when configuring the sensor? The correct analog ADC reference value needs to be set in hardware and in software.
The source file, linked below, contains two look-up-tables, one for 5V reference and one for 3.3V reference.
http://code.google.com/p/gp2y0a21yk-library/source/browse/DistanceGP2Y0A21YK/DistanceGP2Y0A21YK_LUTs.h
Using a value from the wrong table results in an wrong measurement. The measured value is approx. thee times too big around the middle of the sensor range. Maybe this lead you to the conclusion that the measurement were expressed in inches?
There is no mistake in the sensor, or while I was setting anything up. It perfectly matches inches on a ruler so I don’t think that it was a misreading or something. For the fact that the math shows centimeters and it outputs inches surprises me greatly.
These sensor are great, however, if you want precision I recommend getting one with at least 1.5x the max range you expect. The output isn’t linear and if you check the curve on the graph you’ll see how the resolution gets lower with distance.
If I were to put a capacitor near this, which on should I use? I’ve never used capacitors before and it seems capacitors are necessary for the large pulses of electricity it draws
Hello, I would to ask one question about this sensor. When I connect it to 5V of Vcc, the light emitter works without problems, but the light detector doesn’t receive any voltage ( V0 = 0 ). I don´t know if my sensor is damaged due to a surge voltage. ¿How I can solve it?. Thanked I expect an answer. Greetings!
Great little sensor. It does take large pulses of power so make sure you have a capacitor near it.
Justin
http://coilgunpower.com
hey everyone, hope anybody can help me with this one: for my project i use 2 sharp sensors, (ranges 100-550 and 20-150) building kind of guiding device/obstacle detector for blind. unfortunately both sensors have the same ‘problem’ i can’t fix. as you can see from the datasheet, the output as a function of distance is parabola - therefore every output voltage may have 2 options for distance. despite the fact i want to use only the range 100-550 (for ex.), the sensor does also react to 0-100 giving different outputs which may be interpreted as other distances leading my blindman to hit the wall or something.. . i’m using the sensors with Arduino, and can’t find a way to handle this double values problem.
will be very very grateful for solutions or ideas Gary
Could this work to determine the depth of water in a fish tank? Will it reflect reliably off the surface of the water? I’m thinking that even if it does, if the water is rippling a lot it might give a lot of unreliable data.
Exactly what was on my mind! Thinking about using the device to make a very inexpensive digital rain gauge!!!
What is the potential precision over say, a 20 cm range? Of course, one could make a water amplifier (large plate to collect water at 10x area) - and spread it out to 120 cm or something like that, which would refine the device quite a lot. Seems like a project!
Wouldn’t need to reflect from water, could put a buoy (float) in the column. Or, I imagine one could implement a lightweight shaft from the float to a (larger) target plate on top of the column.
er, 200 cm. Not enough coffee!
This is one of the best infrared sensor. simple and with a friendly interface the sharp sensor has high accuracy for its price. many more infrared sensors could be found here http://www.intorobotics.com/infrared-sensors-list-for-simple-to-advanced-applications/
I know it has been asked before but I just want to ask again. Will this work at Vcc=3.3 V? The datasheet says that it is within the acceptable input voltage range. If not, any ideas on how I can interface this with a 3.3 V microcontroller? According to the graph, the output never exceeds 3.3V so I should technically be safe when I supply a 5 V Vcc to the sensor? What do you think?
Hello,,, could anyone guide me with my project?? I would like to know how to get this sensor to trigger different video clips projected onto a wall at specific distances ???
how can i progrm this in ecapp(c language)
Please consider adding these proximity sensors (there are three in your catalog) to the proximity sensor category.
They are now cross-listed in both categories.
Should be fixed. Thanks for pointing that out
will any of these work with 3.3V ?
Sadly, they don’t. At 3.3V you can get some wild voltage swings even when the distance to target is fixed.
I bought one of these modules to add vision to a robot I am working on and the output can’t drive the ADC (ATMEGA uC) input. When I measure with a DMM (10MOhm) output is as expected, but trying multiple ADC inputs, the reading is about 60% and won’t move.
Good sensor, but recommend adding an analog buffer in series with the output just in case.
Make sure you don’t have the internal pullups (~40k) enabled. (digitalWrite() the pin to 0 to disable)
carful using these on real projects at work…there obsolete!
Engineer04915:
As well as the use of the proper “careful”…
These a great little devices. I have used them extensively in a speed climbing timing system I’m building: http://twurl.nl/1gpjdj