# GP2Y0A710K0F sensor problem

**URL:** <https://forum.arduino.cc/t/gp2y0a710k0f-sensor-problem/485750>\
**Category:** General Guidance\
**Created:** [October 14, 2017, 5:15pm UTC](https://forum.arduino.cc/t/gp2y0a710k0f-sensor-problem/485750 "2017-10-14T17:15:53Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Squidsirymchenry](https://avatars.discourse-cdn.com/v4/letter/s/ac8455/32.png) [@Squidsirymchenry](https://forum.arduino.cc/u/Squidsirymchenry)\
**Post date:** [October 14, 2017, 5:15pm UTC](https://forum.arduino.cc/t/gp2y0a710k0f-sensor-problem/485750/1 "2017-10-14T17:15:53Z")

</div>

I am wondering the pinout for this sensor.

> **[IR Distance Sensor (100cm-500cm) - GP2Y0A710K0F - Tinkersphere](https://tinkersphere.com/sensors/2242-ir-distance-sensor-100cm-500cm-gp2y0a710k0f-.html)**
>
> Long Range Infrared Distance Sensor that can measure the distance from 100cm to 500cm (1-5 meters / 3-15 feet)! 2 wires for Ground, 2 for Power and 1 analog signal that ranges from 1.4V to 3V when an object is 500 to 100cm away respectively.

there's the website I bought it from. I tried following its pinout, but I only got 15 as the serial port result.

```cpp
void setup() {
  Serial.begin(9600);

}

void loop() {
  analogRead(A1);
  Serial.println(A1);

}

```

Any help appreciated,  
squidsirymchenry

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [October 14, 2017, 5:21pm UTC](https://forum.arduino.cc/t/gp2y0a710k0f-sensor-problem/485750/2 "2017-10-14T17:21:55Z")

</div>

(deleted)

---

<div class="post-metadata">

**Author:** ![tzijie](https://avatars.discourse-cdn.com/v4/letter/t/977dab/32.png) [@tzijie](https://forum.arduino.cc/u/tzijie)\
**Post date:** [October 14, 2017, 6:00pm UTC](https://forum.arduino.cc/t/gp2y0a710k0f-sensor-problem/485750/3 "2017-10-14T18:00:41Z")

</div>

or u could also use

Serial.println(analogRead(A1));

if u do not need to use the readings later

---

<div class="post-metadata">

**Author:** ![Squidsirymchenry](https://avatars.discourse-cdn.com/v4/letter/s/ac8455/32.png) [@Squidsirymchenry](https://forum.arduino.cc/u/Squidsirymchenry)\
**Post date:** [October 14, 2017, 7:39pm UTC](https://forum.arduino.cc/t/gp2y0a710k0f-sensor-problem/485750/4 "2017-10-14T19:39:31Z")

</div>

> tzijie:  
> if u do not need to use the readings later

What do you mean?

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [October 14, 2017, 7:45pm UTC](https://forum.arduino.cc/t/gp2y0a710k0f-sensor-problem/485750/5 "2017-10-14T19:45:58Z")

</div>

You'll have to excuse @tzijie; s/he hasn't got the hang of personal pronouns or the shift key

> Or you could also use
> 
> Serial.println(analogRead(A1));
> 
> If you do not need to use the readings later

---

<div class="post-metadata">

**Author:** ![Squidsirymchenry](https://avatars.discourse-cdn.com/v4/letter/s/ac8455/32.png) [@Squidsirymchenry](https://forum.arduino.cc/u/Squidsirymchenry)\
**Post date:** [October 14, 2017, 7:49pm UTC](https://forum.arduino.cc/t/gp2y0a710k0f-sensor-problem/485750/6 "2017-10-14T19:49:50Z")

</div>

@ spycatcher2k that didn't work  
I will try the other one  
@tzijie  
It worked!! Thank you

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [October 14, 2017, 7:51pm UTC](https://forum.arduino.cc/t/gp2y0a710k0f-sensor-problem/485750/7 "2017-10-14T19:51:26Z")

</div>

> @ spycatcher2k that didn't work

You didn't try hard enough.

"That didn't work" is **lame**

---

<div class="post-metadata">

**Author:** ![Squidsirymchenry](https://avatars.discourse-cdn.com/v4/letter/s/ac8455/32.png) [@Squidsirymchenry](https://forum.arduino.cc/u/Squidsirymchenry)\
**Post date:** [October 14, 2017, 10:41pm UTC](https://forum.arduino.cc/t/gp2y0a710k0f-sensor-problem/485750/8 "2017-10-14T22:41:22Z")

</div>

@AWOL  
well technically I did, but the second program showed the results better, but now, I'm trying to stop my program with a button and restart it when it is pressed.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 5, 2021, 6:22pm UTC](https://forum.arduino.cc/t/gp2y0a710k0f-sensor-problem/485750/9 "2021-05-05T18:22:18Z")

</div>

Closed on May 5, 2021, 6:22pm UTC


