🔹 Sharp GP2Y0A21YK0F IR Distance Sensor (2Y0A21)
A highly reliable, short to medium-range analog distance measuring sensor from Sharp. It uses a focused infrared beam and a position-sensitive detector (PSD) to output a voltage inversely proportional to the distance to an object. Ideal for non-contact ranging, obstacle detection, and presence sensing.
✅ Specifications:
-
Model: GP2Y0A21YK0F (Commonly known as 2Y0A21)
-
Type: Analog Output, Infrared (IR) Proximity / Distance Sensor
-
Operating Voltage: 4.5V to 5.5V DC
-
Average Current Consumption: ~33mA
-
Measuring Distance Range: 10 cm to 80 cm (4″ to 31.5″)
-
Output Type: Analog Voltage (Non-linear)
-
Output Voltage vs. Distance: ~2.1V at 10cm, ~0.4V at 80cm (Inversely proportional)
-
Update Period (Cycle Time): ~38.3ms ± 9.6ms
-
Dimensions: Approx. 40mm x 16mm x 16mm (L x W x H, including housing)
-
Beam Pattern: Narrow, focused cone.
⚙️ Key Features:
-
Analog Interface: Simple to read with any microcontroller’s ADC pin (e.g., Arduino, Raspberry Pi with ADC).
-
PSD Technology: Less susceptible to ambient light and object color/reflectance compared to simple IR LED/phototransistor pairs.
-
Compact & Integrated: Contains all necessary optics, IR emitter, and signal processing circuitry in a single, rugged housing.
-
Standard 3-Pin Connection: Power (VCC), Ground (GND), Output (Vout).
📦 Typical Applications:
-
Robotics & Automation: Obstacle avoidance, wall following, and collision detection for robots and AGVs.
-
Liquid Level Sensing: Non-contact measurement in tanks or reservoirs.
-
Object Detection & Proximity Sensing: For vending machines, interactive displays, and safety systems.
-
DIY & Maker Projects: Arduino and Raspberry Pi-based distance meters, interactive art, and smart devices.
-
Industrial Applications: Simple positioning, edge detection, and material presence sensing.
🔧 Connection & Usage Guide:
-
Wiring (3-pin):
-
Red Wire: VCC (+5V)
-
Black Wire: GND (0V)
-
Yellow/White Wire: Vout (Analog Output)
-
-
Microcontroller Interface: Connect Vout to an Analog Input pin (e.g., Arduino A0).
-
Reading & Calibration: The output is non-linear. For best results, use a lookup table or the inverse function provided in the datasheet to convert ADC readings to distance in cm.
-
Smoothing: Implement simple averaging or filtering in code to reduce noise in readings.
⚠️ Important Considerations:
-
Non-Linear Output: Distance is not a simple linear function of voltage. Calibration/correction is required for accurate measurement.
-
Object Properties: Works best on flat, matte, light-colored objects. Dark, shiny, or irregular surfaces can reduce accuracy and range.
-
Ambient IR Light: While resistant, very bright sunlight or other strong IR sources can interfere.
-
Minimum Distance: Cannot measure closer than 10cm. Objects closer than this may give erratic readings.


















Reviews
There are no reviews yet.