GP2Y0E03 | Distance Sensor For Arduino

The GP2Y0E03 Sharp Microelectronics Distance Sensors are a popular choice for many projects that require accurate distance measurements.

By detecting the reflective light spot position on the detector, This sensors measure the distance to an object. A CMOS image sensor can be used to measure distance with high accuracy. This sensor is good for distance range between 4cm-50cm. The long range makes them a good alternative to ultrasonic sensors.

GP2Y0E03 Distance Sensor

 GP2Y0E03 Specifications

Manufacturer Sharp Microelectronics
Series GP2Y0E
Part Status Active
Sensing Distance 4 ~ 50cm
Output Type I²C, Analog
Voltage – Supply 2.7V ~ 5.5V
Current – Supply 36mA
Voltage – Output Difference (Typ) @ Distance 1.65V @ 4 ~ 50cm
Voltage – Output (Typ) @ Distance 550mV @ 50cm
Operating Temperature -10°C ~ 60°C (TA)
Size 16.7mm × 11mm × 5.2mm


The variety of the reflectivity of the object, the environmental temperature and the operating duration are not influenced easily to the distance detection because of adopting the triangulation method.

Due to the adoption of the triangulation method, the variation of reflectivity of the object, the environmental temperature and the operating duration are not easily influenced to distance detection.
Interfacing of this distance sensor to microcontrollers such as Arduino, PIC, AVR, STM32 is straightforward as this module gives output voltage corresponding to the detection distance and digital(I2C) data. So this sensor can also be used as a proximity sensor.

Where to Buy?

This Infrared distance sensor made by Sharp Microelectronics. It is available in many online stores. Its price varies, but you can get it for approximately $3.8 in most stores.

Check Price on Aliexpress | |

My personal favrate for this product is Aliexpress | Lowest Price + Wolrdwide Delivery – but Slow Shipping: Grab 10$ Special Discount coupon for New User


This Infrared distance sensor is most suitable for Electronics and electrical projects and products such as

  •  Cleaning robot
  • Humanoid robot
  • Non-contact switch (sanitary equipment, illuminance control, etc.)
  •  Energy-saving sensors (ATM, copiers, LCD monitors, etc.)
  • Amusement equipment (robot, game console, etc.)

Main Features

  • Built-in signal processing circuit
  • Distance measuring range : 4 to 50 cm
  • Low voltage operation : Min 2.7V
  • Compact size (16.7 × 11.0 × 5.2mm)
  • High-precision measurement
  • Digital(I C) / Analog output type
GP2Y0E03 arduino Review Price Specifications

Connection Pin

The sensor has a 7 pin Japanese Solderless Terminal (JST) Connector that works with our 7-pin JST PH cables for Sharp distance sensors (included), as shown in the upper picture on the right.

Pin name Function
VDD  Power supply
Vout(A)  Analog output voltage
GND Ground
VIN(IO): I/O supplying voltage
GPIO1 Active / stand-by condition switching terminal
SCL I2C clock
SDA I2C data bus
GP2Y0E03 Distance Sensor Module 4cm-50cm range price

Download Datasheet

GP2Y0E03 Distance Sensor Module 4cm-50cm range price

GP2Y0E03 Arduino Code 

Below Sketch/code is useful to test the function of the this distance sensor. This code work successfully and uses the I2C connection.  Arduino Wire Library is used to drive the I2C bus.

Copy to Clipboard

Project Using GP2Y0E03


It’s an excellent choice if you want a  High precision measurement distance sensor without spending too much budget. Its also used as proximity detection. Best alternative for ultrasonic distance sensor. Performance under sunlight is not tested yet(please update in comment, if anyone Test how well the array works under sunlight).

GP2Y0E03 dimension

More great stories from InnovatorsGuru