Due to high demand expect some shipping delays at this time, orders may not ship for 1-2 business days.
0

learning guide for Sharp GP2Y0D805Z0F Digital Distance Senso
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

learning guide for Sharp GP2Y0D805Z0F Digital Distance Senso

by burrito_poots on Tue Apr 27, 2021 6:30 pm

Hey gang,

It's been a hot minute since I've posted here so I'm trying to knock the dust off. On a product I snagged, the distance sensor in the title of this post, I can't seem to find a guide on using it? What library/etc. and the guides are always such a useful help for me as a mostly visual person, so being able to see the whole picture first is great. Does one exist and I'm just missing it? The first time I tried to get one of these to work I couldn't, but that was over a year ago so the details of that adventure are foggy.

Thanks in advance!

burrito_poots
 
Posts: 81
Joined: Thu May 30, 2019 5:02 pm

Re: learning guide for Sharp GP2Y0D805Z0F Digital Distance S

by dastels on Tue Apr 27, 2021 7:28 pm

There doesn't seem to be a guide, but it's really simple to use. Look at the specs and schematic on the product page https://www.adafruit.com/product/3025 it appears to take gnd, Vcc, and provide a logic output (low when it detects something, high otherwise). So hook up power and connect its output to a digital input. So there's no library needed other than digital I/O support.

Dave

dastels
 
Posts: 6129
Joined: Tue Oct 20, 2015 3:22 pm

Re: learning guide for Sharp GP2Y0D805Z0F Digital Distance S

by adafruit_support_bill on Tue Apr 27, 2021 7:51 pm

I've use these sensors and there really isn't much to them. The output signal goes HIGH when the target is in range and LOW when not.

The pins are labeled on the back of the board. You just need GND, VIN (it will work with either 3.3v or 5v) and connect 'Out' to a digital pin on your processor.

adafruit_support_bill
 
Posts: 81073
Joined: Sat Feb 07, 2009 10:11 am

Re: learning guide for Sharp GP2Y0D805Z0F Digital Distance S

by burrito_poots on Wed May 12, 2021 8:27 pm

Do you guys happen to know of any coding projects that use this so I can look at some example code? It's been a long time and I haven't set up a simpler sensor like this that didn't require a library. Very much a copy/paste/edit where needed coder at this stage so it helps greatly :)

burrito_poots
 
Posts: 81
Joined: Thu May 30, 2019 5:02 pm

Re: learning guide for Sharp GP2Y0D805Z0F Digital Distance S

by adafruit_support_bill on Wed May 12, 2021 8:48 pm

It is pretty much like any other digital input signal. The result of a digitalRead is either HIGH or LOW:

The only difference between these and a pushbutton switch is that you don't need the pinMode(buttonBpin, INPUT_PULLUP);
https://learn.adafruit.com/adafruit-ard ... duino-code

adafruit_support_bill
 
Posts: 81073
Joined: Sat Feb 07, 2009 10:11 am

Re: learning guide for Sharp GP2Y0D805Z0F Digital Distance S

by burrito_poots on Wed May 12, 2021 9:27 pm

adafruit_support_bill wrote:It is pretty much like any other digital input signal. The result of a digitalRead is either HIGH or LOW:

The only difference between these and a pushbutton switch is that you don't need the pinMode(buttonBpin, INPUT_PULLUP);
https://learn.adafruit.com/adafruit-ard ... duino-code


Is there a circuit python equivalent you would recommend bill?

burrito_poots
 
Posts: 81
Joined: Thu May 30, 2019 5:02 pm

Re: learning guide for Sharp GP2Y0D805Z0F Digital Distance S

by adafruit_support_bill on Thu May 13, 2021 5:21 am

Tony has a tutorial on CircuitPython digital inputs here: https://learn.adafruit.com/circuitpytho ... tal-inputs

adafruit_support_bill
 
Posts: 81073
Joined: Sat Feb 07, 2009 10:11 am

Please be positive and constructive with your questions and comments.