Sharp GP2Y0A21YK0F IR distance sensor
Analog IR distance sensor for 10 to 80 cm.
What is the Sharp GP2Y0A21YK0F IR distance sensor and what is it used for?
Analog IR distance sensor for 10 to 80 cm. Makers use it for robot obstacle distance.
An IR LED projects a spot and a position-sensitive detector measures the angle of the reflection (triangulation).
Key specifications
| Sensor spec | Value |
|---|---|
| Measures | Distance (IR triangulation) |
| Range | 10 to 80 cm |
| Interface | Analog voltage, not linear |
| Supply voltage | 4.5 to 5.5 V |
Pinout
How to use it
The output is not linear: about 3.1 V at 10 cm falling to about 0.4 V at 80 cm. Use a lookup table or a fitted curve. Add a 10 µF capacitor across the supply at the sensor, as it draws current in pulses. Below 10 cm the reading folds back and looks far again.
Applications
Builds that use it
Alternatives
- VL53L0X time-of-flight distance sensorDigital readings, smaller and more linear
Common questions
What is the Sharp GP2Y0A21YK0F IR distance sensor used for?
In maker projects: robot obstacle distance.
How does the Sharp GP2Y0A21YK0F IR distance sensor work?
An IR LED projects a spot and a position-sensitive detector measures the angle of the reflection (triangulation).
What voltage does the Sharp GP2Y0A21YK0F IR distance sensor need?
4.5 to 5.5 V.
How do I connect the Sharp GP2Y0A21YK0F IR distance sensor to an Arduino or ESP32?
Analog voltage, not linear. Pins: Vo (Analog output (yellow wire)), GND (Ground (black wire)), Vcc (5 V (red wire)).
What can I use instead of the Sharp GP2Y0A21YK0F IR distance sensor?
VL53L0X time-of-flight distance sensor.
