GP2Y0A21YK0F Sharp IR Analog Distance Sensor 10-80cm + Cable, Arduino Compatible
|Price:||$11.90 & FREE Shipping|
This item at this price, sold by Amazon.com, is currently reserved exclusively for Prime members.Prime free trial and invitee customers: We will automatically apply an Amazon.com Gift Card to your Gift Card Balance in the amount equal to the Prime exclusive discount after you become a paid Prime member. If you cancel your paid Prime membership or return the qualifying smartphone within the first 3 months of your paid Prime membership, we may void your Gift Card or charge you in the amount of the Gift Card. Terms and Conditions apply.
- Distance Measuring Range: 10 cm to 80 cm (4in to 32in)
- Output Type: Analog Voltage
- Operating Voltage: 4.5 V to 5.5 V
- Update Period: 38 ± 10 ms
- Average Current Consumption: 30 mA (typical)
Frequently bought together
Customers who bought this item also bought
Have a question?
Find answers in product info, Q&As, reviews
Please make sure that you are posting in the form of a question.
This product is a combination of Sharp sensor and 12-inch (30-cm) JST cable, offered by RobotSimple.
The Sharp distance sensors are a popular choice for many projects that require accurate distance measurements. This IR sensor is more economical than sonar rangefinders, yet it provides much better performance than other IR alternatives. Interfacing to most microcontrollers is straightforward: the single analog output can be connected to an analog-to-digital converter for taking distance measurements, or the output can be connected to a comparator for threshold detection. The detection range of this version is approximately 10 cm to 80 cm (4in to 32in)
The GP2Y0A21 uses a 3-pin JST connector (included). It is also simple to solder three wires to the sensor where the connector pins are mounted. When looking at the back, the three connections from left to right are power, ground, and the output signal.
Top customer reviews
There was a problem filtering reviews right now. Please try again later.
The sensor I tested hit its maximum signal voltage at about 3.14 volts. I bought three; the other two were very similar; the lowest saturation voltage I measured was around 3.08 volts.
I say saturation, because within a domain of about 10 to 5 cm, it outputs roughly the same voltage until it sharply decreases again when it becomes closer than the minimum. I don't know precisely how these things work, but perhaps it has something to do with the distance of the wall with respect to the distance the emitter and IR detector are on the sensor itself.
Either way, the response is nonlinear, so you'll need to play around with it a bit. I estimated that for every volt below 3 volts the range needed to hit that voltage is roughly doubled. So, 2 volts is about twice as far from the wall as 3 volts, and 1 volt is about twice as far away as 2 volts.
I found that the longest range I could reliably measure was about 65cm; beyond that, while there was certainly a decrease in voltage with respect to any given wall, environmental conditions on different walls would interfere enough that one couldn't really rely on a certain voltage to describe a certain range. So perhaps, you could get to 80cm in a more controlled, uniform environment.
The "2.5% error" described by others is probably due to some strange square-shaped noise in the signal in the microsecond timescale, which I observed on an oscilloscope. The power signal draw decreases in roughly the same time period as the output signal draw increases. Very strange artifact. But realistically, it doesn't seem to affect the reliability of measurements much. Just don't expect to use this thing to make a 3d map or anything like that.
My experience has these having a reliably measurable voltage range of 3 to 0.4 volts or so. Try it with a multimeter, a ruler, and a wall. Because of the nonlinear response, resolution effectively increases at short range, but you do have to compensate and make a graph if you're going to write your own ADC handler, for instance.
I made a wall-follower with these. It could follow walls, corners, boxes, and humans just fine. For the price point, I wasn't disappointed one bit.