SparkFun Electronics Commentsurn:uuid:214d0e4e-f1b1-d287-ce26-ac5b4c9f82492024-03-29T03:36:51-06:00SparkFun ElectronicsCustomer #369819 on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FCustomer #369819urn:uuid:5d4fcdc1-a149-d9af-6f92-03ccec5842632018-01-22T11:55:27-07:00<p>I have this sensor. It's nice and does indeed have a pretty good range of several feet (I've reliably gotten 3-4 ft). There are 2 caveats. At short distances (<4-5 inches), the output goes low, and then when it gets within range, it goes high....then it gradually decreases as the distance increases. This means that there is a sort of discontinuity between 3-5inches and 5+ inches.<p>The second issue is that the values greatly based on the object in front and angle (ideally you need a reflective hard white surface facing straight-on). This just makes it a little hard to calibrate for some applications.</p><p>Overall, MUCH better than the ultrasonic ping sensors, and way better than trying to build your own IR/Phototransistor pair.</p></p>
Customer #840013 on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FCustomer #840013urn:uuid:52927c42-4a93-f347-35c0-b7f683da0bb32016-09-02T00:12:30-06:00<p>Hey..the project I am working on is a Posture Correction Chair...For this we have demarcated certain points of the spine that needs to be touching the chair body in order to maintain a correct and healthy posture.
I wanted suggestions for sensors that could be used to calculate the distance of the chair occupant and the vertical chair body..
Suggestions do let me know..:)</p>
Customer #838079 on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FCustomer #838079urn:uuid:4a9ecee1-3945-edaf-10fd-231a9a15182b2016-08-26T08:38:13-06:00<p>can someone help me? i am looking for a sensor that can detect a moving vehicle in road.... the sensor should only detect vehicle and no other object. is this Infrared Proximity Sensor only detects metal? Thank you for your response :)</p>
Customer #814900 on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FCustomer #814900urn:uuid:c053be11-6948-83da-a1e2-e4ec870fda182016-06-09T19:35:16-06:00<p>hi, we have similar project and have some specific question to see if you could help. Could email me back or any other way to communicate in more details? thanks! My email is motioautomation@hotmail.com</p>
floris on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0Fflorisurn:uuid:5578c33a-f325-a601-28fb-4ac98582b6992015-07-25T02:01:52-06:00<p>It sometimes works with just water. I bought an other ultrasonic (way more expensive) sensor to measure the water level.
Just try it!</p>
Customer #702633 on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FCustomer #702633urn:uuid:e4319814-77a1-b36e-49c3-44bfca896d722015-07-23T08:19:58-06:00<blockquote>
<p>is one to determine a waterlevel?
so fixing it in my watertank with its beam downwards.
or does water not reflex enough to give a distance??</p>
<p>Hello floris,</p><p>I'm thinking to use a IR sensor to measure water level in a bathtub.</p><p>Does it works? I dont want to use a pingpong ball. just the water.</p><p>I have read it could work with hot water.</p><p>Thanks for the info!</p></blockquote>
PointyOintment on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FPointyOintmenturn:uuid:87ef46b2-e213-014b-fe1c-f3fc2a5c44c22014-12-13T14:29:10-07:00<p>Your images no longer work. ImageShack just redirects to a page where it plays an unconvincing ad for itself. I suggest re-uploading to <a href="https://imgur.com" rel="nofollow">imgur</a>; it's very reliable and reputable, and it has a much better user experience than I remember ever getting from ImageShack.</p>
mitch_feaster on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0Fmitch_feasterurn:uuid:4a06a05c-73b3-1cff-2577-a3ccc47d63332014-10-23T14:20:49-06:00<p>From the datasheet:<blockquote>
<p>Advice for the power supply
* In order to stabilize power supply line, we recommend to insert a by-pass capacitor of 10μF or more between Vcc and GND near this product.</p>
</blockquote><p><em>ProTip:</em> <strong>Do it!</strong> I tried throwing this guy on the same Vcc as an ATmega8 and the ATmega8 became completely unstable. After adding a 100μF between Vcc and gnd things were much better. My Vcc is still much less stable than without this part in there but it works...</p></p>
Sora62896 on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FSora62896urn:uuid:12a48e5a-a364-d1ce-509d-84fd39da9b012014-05-07T20:01:39-06:00<p>I used the largest cap sparkfun offered that followed the voltage regulations</p>
CrazySwedishGuy on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FCrazySwedishGuyurn:uuid:3fbba119-619d-89a6-5b55-25a4689e187b2014-05-06T11:49:46-06:00<p>I completely agree that the project is really cool, and Jade's result is awesome. Kudos!<p>I'm going to venture a guess, but I could be wrong: closer objects (read "pixels") appear whiter, and more distant objects appear darker (and possibly smaller). You can use pretty basic trigonometry to get the x,y position of a pixel based on the angle of the servos and the distance measured.</p><p>I've actually been working on a similar project, except my sensor is mounted on a multi-chassis (tank version), and sweeps only horizontally, for reasons of speed (5 minutes for a full picture isn't practical for a vehicle application).</p><p>I have multiple settings to control the resolution and speed of the sweep. That way, when the vehicle is stationary, the IR sensor can do a wide-angle slow sweep – taking a reading for every degree across a 180 degree arc; when the vehicle is moving, the IR sensor does a narrow-angle fast sweep – taking a reading every 15 degrees across a 60 degree arc.</p><p>This looked really good when I drew it in Processing. I'm faking a 3D representation (the data is only 2D) by changing not only the darkness but also the height of each individual data point based on the distance, which simulates perspective. All objects ahead of the vehicle look like walls, essentially.</p><p>My next step has been to implement iPhone remote-control using Bluetooth. The readings are currently being sent to my iPhone (using RedBearLab's BLE Shield), but I have not yet implemented the graphical representation in the app.</p></p>
Customer #461908 on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FCustomer #461908urn:uuid:fdb9f083-a1d6-1e97-5517-44c041dd930f2014-04-28T15:28:24-06:00<p>So I have been trying to use this sensor, along with an Arduino Mega, to help control a robot and its direction (i.e. turn it around should it be about to hit a wall), and I have basically no idea what I'm doing when it comes to coding it. I have it all wired and the coding for the rest of the robot ready to receive the coding for the sensor, but how do I make the mega interpret the raw data from the sensor and turn it into a distance number? does anyone know any websites that could help me with this or any tutorials online?</p>
Customer #547832 on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FCustomer #547832urn:uuid:26ea53dc-ee99-9f1e-81be-6241db7ae4052014-04-22T14:55:43-06:00<p>Thats a cool project! Could you explain how you converted the values into an image also ur email id</p>
CrazySwedishGuy on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FCrazySwedishGuyurn:uuid:5268cf27-e69c-9847-b1e7-0deaff7e7b362014-04-17T07:39:36-06:00<p>What type of capacitor would you use for this? Would a 0.1uF (https://www.sparkfun.com/products/8375) cut it?</p>
Customer #535015 on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FCustomer #535015urn:uuid:13f10a74-8b58-ba12-ebbb-068a4508d5e92014-03-27T17:11:32-06:00<p>That's pretty cool.</p>
robhazle on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0Frobhazleurn:uuid:08007a9e-7ec7-e3b5-4230-f11b64d2804e2014-03-23T18:06:51-06:00<p>Here is my calibration for the sensor in inches.<pre><code>/*
Calibration of Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0F
SparkFun Part#: SEN-08958 https://www.sparkfun.com/products/8958
By Robert Hazlehurst, Castle View High School robert.hazlehurst@dcsdk12.org
for use on RedBot Robot SparkFun Part#: ROB-12032 https://www.sparkfun.com/products/12032
with RN42-XV Bluetooth Module - PCB Antenna installed in the Xbee port SparkFun Part#: WRL-11601 https://www.sparkfun.com/products/11601
Equation:
Distance (in inches) = 6202.3*SensorReading^-1.056 fit with an R² = 0.9914
Raw Data:
Sensor Distance (In)
502 8
434 10
379 12
329 14
283 16
257 18
229 20
213 22
199 24
139 36
91 48
*/
#include <RedBot.h>
RedBotSoftwareSerial bluetooth;
float sensor;
double distance;
void setup()
{
Serial.begin(9600); // Begin the serial monitor at 9600bps
bluetooth.begin(115200); // The Bluetooth Mate defaults to 115200bps
bluetooth.print("$"); // Print three times individually
bluetooth.print("$");
bluetooth.print("$"); // Enter command mode
delay(100); // Short delay, wait for the Mate to send back CMD
bluetooth.println("U,9600,N"); // Temporarily Change the baudrate to 9600, no parity
// 115200 can be too fast at times for NewSoftSerial to relay the data reliably
bluetooth.begin(9600); // Start bluetooth serial at 9600
}
void loop()
{
sensor = analogRead(A3); //read the sensor
distance = 6202.3*pow(sensor,-1.056); //apply cal curve to convert to inches
bluetooth.print("distance = "); //print distance to cell phone screen
bluetooth.println(distance);
}
</code></pre></p>
Customer #505592 on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FCustomer #505592urn:uuid:256f943c-4d02-33c4-8dd0-109cda67bfdb2014-01-05T20:33:03-07:00<p>is there a detection angle for these sensors? ie. does one have to be directly in front... or will it pickup +/- 30 degrees, etc...<p>Thanks!</p></p>
SquaredPaper on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FSquaredPaperurn:uuid:a8ab0996-5c64-8aa0-a823-6a7dae1b7a552013-12-13T08:52:53-07:00<p>Thank you - this worked out very well for me!<p>Just to provide a summary in case that the picture gets unavailable (all credz goes to the kind sir/madam above):</p><pre><code>x = [value read from sensor]
y = x * [your Arduino boards Vcc (5 or 3.3V)] / 1024
distance = 61.681 * y ^ -1.133
distance <-- in centimeters
</code></pre></p>
Customer #488352 on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FCustomer #488352urn:uuid:b195bdcc-8f62-6776-0501-15de2a6b60a32013-11-13T21:57:44-07:00<p>Hello Everyone,
I am new to this sensor.
I am aware of how distance is measured.<p>Can someone tell me how I can determine the angle of incidence ?</p><p>thanks</p></p>
AdamTolley on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FAdamTolleyurn:uuid:02b8f572-0bc5-4112-e5f1-9fb9a70d6b152013-05-11T18:39:48-06:00<p>11 months later, but a common thing to do in this case is to use a lookup table, you can even initialized such lookup tables on boot, but for this particular application, its probably easier to just code it in.</p>
Jon990 on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FJon990urn:uuid:1d73ba46-27ff-d6f3-f7d3-2d9b581f5bf82013-03-18T20:45:48-06:00<p>Great rangefinder with a solid 5-foot range. Range values may vary for different colored surfaces, making it difficult to tell the difference between a close-up IR-absorbing object or a far-away IR-reflecting object. In our experience, this difference was only a few inches. I would recommend making an Excel (or equivalent) spreadsheet of experimental ADC values vs distances and using the software to create a trend line with a corresponding equation for your software to use to estimate ranges. Runs well on a regulated 5V supply with a good-sized capacitor to counteract the ripple it will cause when it pulls current.</p>
Customer #409904 on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FCustomer #409904urn:uuid:ba0168d6-7ce9-2c89-faf1-0ceb5fcc1db92013-02-17T06:34:38-07:00<p>Hi
I have one question i want to do this with ultrasonic sensor. The range of detection objects is 35-200cm, how to make from distance to picture. Did you make some scale for an example 35cm it will be white and 200cm will be black? If you have some advices pls write me i am new with this and i want to learn.
Thank you in advance!</p>
GotFiftyHertzButAGlitchAintOne on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FGotFiftyHertzButAGlitchAintOneurn:uuid:2fca42fc-3fdc-c768-a705-b9134860f67b2013-01-28T23:26:22-07:00<p>I'm running 4 on the same Arduino Fio, at around 13 Hz each, but thanks for your help anyway. The factorisation trick will come in handy.</p>
Aleksandr S. on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FAleksandr S.urn:uuid:7dad45c1-6b73-0856-95e0-cdc9075402882013-01-27T05:42:32-07:00<p>First, for high order polynomials you should factor them like so:
d = 306.439 + x * ( -512.611 + x * ( 382.268 + x * (-129.893 + x * 16.2537) ) )
The original equation had (a<em>x^4 = a</em>x<em>x</em>x*x) 4+3+2+1 = 10 multiplications and 4 additions/subtractions.
Factored equation has 4 multiplications and 4 additions/subtractions.<p>Second, I don't know how you're planning on running this at 50 Hz since the expected response time, based on the datasheet, is 38.3 ms (or ~26 Hz update frequency).</p></p>
Customer #142575 on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FCustomer #142575urn:uuid:5ac259c6-4245-991c-a06f-bfba6d740d1c2013-01-10T20:35:57-07:00<p>Can this sensor pass through transparent or translucent material? If no, is there any alternate distance sensor that can be used with Arduino? Thanks!</p>
Sora62896 on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FSora62896urn:uuid:19c92eb7-7468-fd41-af43-ecdd79b507e02012-12-23T11:17:18-07:00<p>Still not in stock?</p>
bash on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0Fbashurn:uuid:5aef365a-58a0-575d-ba54-9c680eaf20ad2012-11-22T11:23:06-07:00<p>Can you PLEASE sell MORE kinds of these (especially the LONGER range ones)?<p>Longer range ones (100 to 550cm) like this one:
GP2Y0A710K0F</p><p>http://www.sharpsma.com/webfm_send/1490</p></p>
Sora62896 on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FSora62896urn:uuid:21b3aa49-d7ec-8147-3131-be783e79aa312012-11-02T08:41:59-06:00<p>anyone know when these will be back in stock??</p>
Sora62896 on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FSora62896urn:uuid:f139c88b-1a08-5a9e-b101-f6dbe3e7c50e2012-11-02T08:40:58-06:00<p>are you using capacitors to help to balance the electronic noise? These should work fine with all arduino boards</p>
tom jennings on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0Ftom jenningsurn:uuid:6caacd0d-ebe8-d9b8-ae00-62fc38bf9a3d2012-10-26T11:52:43-06:00<p>'hope this helps'? lol hell yes! thanks a ton, man/ma'm! that's exactly what i needed. very, very helpful.</p>
Muunsyr on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FMuunsyrurn:uuid:d0373294-e972-69c4-6b4e-ee7f11242dda2012-10-26T03:27:46-06:00<p>I've done a couple of simple tests with a 4mm square balsa wood stick at ~30cm from the sensor. I shall refer to the data sheet for orientation description - so that the emitter is to the left or right of the detector (as opposed to above or below). When the stick was oriented vertically, and passed from one side to the other, it seemed to have a 2.5 degree detection beam. When the stick was also oriented horizontally, and passed from below to above (or vice-versa), it appeared to have a 3.0 degree detection beam. I hope this helps.</p>
Muunsyr on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FMuunsyrurn:uuid:3bd2262f-4487-b9b4-637a-23ea22c196ef2012-10-26T03:16:55-06:00<p>I don't, but I've used the second plot from the data sheet (output voltage vs inverse of distance), called it a straight line from 30cm to 150cm, and a different straight line from 20cm to 30cm. Then it is easy enough to come up with two equations calculating distance from voltage.</p>
tom jennings on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0Ftom jenningsurn:uuid:4420c028-3d20-5d4e-39b3-2b6fe06e28a62012-10-19T13:43:48-06:00<p>the datasheet says nothing about beam width, but yeah, i will experiment, it's easy enough. IR LEDs vary in beam width, a lot, generally speaking. i posted cuz i was wondering if anyone else had done these sorts of experiments. no problemo here. thanks.</p>
sgrace on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0Fsgraceurn:uuid:73553d3c-8d0b-5545-39ab-fdd18791d0422012-10-19T12:10:45-06:00<p>Infrared tends to be pretty narrow because any wide angles would cause bad data. However, it all depends on the application. Reading the datasheet suggests that you need to protect the sensor when in certain types of lighting scenarios (outside in sunlight is an example they give).<p>In regards to using a tube around it... It all depends on the tube. How is the tube mounted, how long is it, how big is the diameter of the tube, etc.</p><p>I have used predecessors of this sensor before, and they do pretty well, however not every sensor meets the curve outlined in the datasheet. So it is best to do calibration tests on all infrared sensors to map out the range and sensitivity.</p></p>
tom jennings on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0Ftom jenningsurn:uuid:39dbcbd5-524c-d220-274d-a715da3c61842012-10-18T15:22:14-06:00<p>Can anyone hazard a guess as to this thing's beam width and pattern? I'm looking to augment an ultrasonic rangefinder (EZ-1) for closer ranges (like 75cm - 150cm); i'm hoping this things beam is narrower than the EZ-1, or i can get away with constraining it with a black tube.</p>
Customer #367431 on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FCustomer #367431urn:uuid:4c87397b-5bf6-f7dd-c09a-877caf1c89072012-10-18T11:28:16-06:00<p>Hey Everyone,
I am new to this type of sensor, I am using a 10kohm resistor between the pin back to my MIDItron. Does anyone know if I should connect the sensor without the 10kohm resistor? Also if anyone has any tips or hints on the codes using Max6/jitt I would greatly appreciate it. Thanks!</p>
Customer #337764 on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FCustomer #337764urn:uuid:f3d0ade7-4333-e1f2-67e0-a273d0279ab82012-09-17T20:40:14-06:00<p>I am experiencing erratic behavior with my sensor ?
Also it seems to be heating up alot when it is running is that normal?
basically I a not getting the results I want from this page ? http://arduinomega.blogspot.com/2011/05/infrared-long-range-sensor-gift-of.html
Does it may a difference that I am using arduino uno instead I would really like to get this working ? I can provide pics and wiring to help ?<p>thanks !!</p></p>
KDodman on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FKDodmanurn:uuid:71c5afa9-0dfd-bcc6-1a66-3daab4cfba442012-09-07T23:02:35-06:00<p>I did some tinkering with this, and from what I figured it would only work behind glass, if its pressed right against it, leaving no gap between the sensor and the glass.</p>
Tazered on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FTazeredurn:uuid:6c638551-90c1-2e4d-a77d-66e6ca54cfb62012-08-25T19:56:18-06:00<p>Ah, just wanted to mention this since I didn't see it here. For those looking for a quick and relatively simple way to estimate the relationship between voltage output and distance. Take the readings on the graph from the datasheet or get them from your sensor (multiply the raw output readings by 5volts and divide by 1024 to get the result in volts. slightly longer but more likely to fit your sensor).<p>I then graphed those readings in Excel and and found the line of best fit that most accurately followed the curve between the stated operating distances of 20cm to 150cm. Excel popped out the equation.
See here: <a href="http://tinypic.com/r/2lddtvc/6" rel="nofollow">http://tinypic.com/r/2lddtvc/6</a></p></p>
GotFiftyHertzButAGlitchAintOne on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FGotFiftyHertzButAGlitchAintOneurn:uuid:52844406-3bf9-6218-08f1-e7ad7ccdb0b02012-07-11T01:20:00-06:00<p>Do you have perhaps a second degree approximation for the inverse of the output?<p>My Arduino can't handle 4th degree equations at 50Hz... :(</p></p>
jmatson11 on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0Fjmatson11urn:uuid:5816a382-405b-ef49-4238-d632e2797bf02012-04-11T21:34:12-06:00<p>Using the datasheet, we did a fourth degree approximation to get a close fitting formula to find the distance in cm from the voltage. Here is the formula we used:<p>Distance = 16.2537 * x^4 - 129.893 * x^3 + 382.268 * x^2 - 512.611 * x + 306.439
*Where x=Voltage read on ADC and Distance is in cm.</p></p>
ember630 on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0Fember630urn:uuid:971a1bd4-2b50-99a1-e155-c789c1c974972012-04-09T14:13:49-06:00<p>Does anyone know if the infrared proximity sensors can detect distance from behind glass?</p>
Cranium on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FCraniumurn:uuid:ab3b1d60-5342-0fd4-2074-4118123946822012-02-06T00:45:50-07:00<p>The equation I derived through measurements and am using with pretty good success is: y = 21208 * pow(x, -1.251);<p>y = distance in inches.
x = analog reading from sensor.</p><p>The sensor works pretty good and buffering the values certainly helps with a more stable output. I'm buffering 10 values.</p><p>I forgot to buy the 3 pin JST connectors with my sensors so placed an order for a bunch of 2, 3, 4, 6, & 8 pin PH connectors (male & female) from digikey.</p><p>Sorry for multiple posts....The site is not compatible with Opera browser for posting comments.</p></p>
floris on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0Fflorisurn:uuid:e99671a8-23e9-2b53-2991-0e25aad065f72011-11-18T10:46:03-07:00<p>mine does 15 cm!
thereafter the analogeRead-value gets smaller again.</p>
floris on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0Fflorisurn:uuid:25935b75-07c7-c424-302f-833d474148942011-11-18T10:44:04-07:00<p>it works on water as well but just to be sure i'm using a pingpong ball in a tube to determine the waterlevel (see also: http://howmuchsnow.com/waterlevel/)</p>
Customer #254229 on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FCustomer #254229urn:uuid:4aaf77b1-a0fc-6ca1-b0a4-c2b1760d6ed22011-11-15T05:58:15-07:00<p>The datasheet is clear it's not 15cm it's 20cm.</p>
floris on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0Fflorisurn:uuid:b3a48ffe-ac83-6d6e-6952-f80b58297fea2011-11-01T14:25:14-06:00<p>can I use this one to determine a waterlevel?<br>
so fixing it in my watertank with its beam downwards.<br>
or does water not reflex enough to give a distance??</p>
Customer #152698 on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FCustomer #152698urn:uuid:9e7f05ab-9041-29c5-26be-45531c31a85b2011-08-28T00:51:35-06:00<p>do you know how to install this sensor on the arduino mega oilpan</p>
Customer #152698 on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FCustomer #152698urn:uuid:dce1f49f-8d1f-7128-1a35-c63153d77ac52011-08-28T00:50:23-06:00<p>how to installl this on the arducopter?</p>
Customer #127408 on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FCustomer #127408urn:uuid:27e193f7-390a-668e-56a0-8dadd0ce04f72011-08-23T23:20:47-06:00<p>Surprised at how little information this data sheet has. Even plain old LED spreadsheets usually have a Radiation pattern.</p>
rocketblast on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0Frocketblasturn:uuid:430e7a10-d130-f621-a968-edb00114a0332011-07-15T00:21:41-06:00<p>The datasheet says to use a 10uF capacitor.</p>
Bangwaiter on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FBangwaiterurn:uuid:551cac57-c375-a8c5-f28c-8c0dc00412912011-04-21T09:56:56-06:00<p>!ATTENTION!<br>
This sensor's case has relatively low resistance (150 Ohms), be careful when mounting on other conductors.</p>
jackalope on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0Fjackalopeurn:uuid:341968cd-8a45-9aa6-393e-f695325cfb3e2011-04-16T04:37:57-06:00<p>hi guys<br>
what is the angle range of this sensor?<br>
thanks<br>
regards</p>
Customer #202770 on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FCustomer #202770urn:uuid:d565ec7e-93d3-f403-db85-dd4400a9485a2011-03-22T20:40:35-06:00<p>very nice sensor. much easier to use than a ping sensor but does not have as much range. It is perfect though for my application.</p>
neuroelec on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0Fneuroelecurn:uuid:f16e7b27-4d98-29cc-989a-d678c0a037a92011-03-22T11:00:28-06:00<p>I did line fitting based on datasheet<br>
For 10bit ADC such as Arduino (0-5V => 0-1023),R square = 0.9902<br>
distance = 30431 * pow (sensorValue,-1.169)</p>
Brain21 on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FBrain21urn:uuid:534cad16-bbe8-bdb9-f27c-cc5ac70829f32011-03-09T07:47:16-07:00<p>This link should help:<br>
http://www.acroname.com/robotics/info/articles/irlinear/irlinear.html</p>
Brain21 on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FBrain21urn:uuid:e1ff5604-e01a-4c09-56fa-9d351a11f2732011-03-09T07:44:55-07:00<p>Yup, I should get one soon then. I have the other style ones (GP2D120's), so I might try it with that tonight.</p>
SubMicro on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FSubMicrourn:uuid:25164212-c590-eeb5-01e6-bcf0a27008e42011-03-07T16:02:51-07:00<p>Can someone help me with the equation to convert the reading into actual distance i.e. 975 x 1.318359375 = 1285.4mm 975 = 128.5cm<br>
Is my thinking incorrect? or my math?<br>
2.8V @ 15cm<br>
0.4V @ 150cm<br>
2.4/1024 = 0.00234375V<br>
1500mm/1024 = 1.318359375mm</p>
SubMicro on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FSubMicrourn:uuid:9d6713fe-67b6-bad0-53b3-26ddbb3f19d12011-03-07T15:44:18-07:00<p>Sounds like you've got an experiment to do!</p>
Brain21 on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FBrain21urn:uuid:e22734d1-76e6-175e-9779-86a9372294042011-03-06T16:22:28-07:00<p>Does anyone know how these react to different color? Say I have a white board at 2 ft and take a reading (discard first, average 4), then switch to a red, green or blue board at the same distance and take another reading the same way. Will I get the same reading both/all times or even something close?</p>
Jade on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FJadeurn:uuid:1a895cab-ed79-7cc1-776f-fd90ec9436a22011-03-03T09:52:02-07:00<p>Make sure your power supply is clean and filter it with capacitors if necessary.<br>
Putting a 0.1 uF ceramic capacitor on the IR sensor output may also smooth out some of the signal.<br>
You can also smooth out the signal by averaging a set of readings in your Arduino code. Something along the lines of:<br>
void loop()<br>
{<br>
sensorInput = (analogRead(sensorPin));<br>
bufferA = bufferB;<br>
bufferB = bufferC;<br>
bufferC = sensorInput;<br>
average = (bufferA + bufferB + bufferC) / 3;<br>
delay(x);<br>
}<br>
That example takes a sensor reading and puts it in bufferC the first time. Second time the loop runs, that value passes to bufferB and third time to bufferA. Essentially, you get to keep the last 3 readings that you can then average to get a smooth output. By increasing the number of samples or the delay you can increase smoothing at the expense of latency.</p>
cltitran on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0Fcltitranurn:uuid:1a1733d8-5c76-f9d6-c8e7-3f2e49c42b3d2011-02-28T16:08:57-07:00<p>I was wondering if anyone can help me with my problem.<br>
I bought this sensor hoping for it to track the distance my hand is away from it, which it does. However, the numbers corresponding to the distance fluctuate very quickly despite how I hold my hand still. Is this normal?<br>
I plan to use these numbers as a way to control which sounds I play. However, if the numbers fluctuate so much it won't work.<br>
I'm using an Arduino Uno and Max MSP for my project.<br>
I apologize if this isn't the place to ask this question but hopefully someone here can help me. Thanks.<br>
Other than that the sensor is plug and play =)</p>
Jade on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FJadeurn:uuid:7ad6bda9-b307-1d4d-a759-36dc0b9a8e8b2011-02-10T12:30:59-07:00<p>Glass case can be used for protection, provided it is flat and clear, not refracting or scattering light. Don't use plexiglass as it reduces or completely blocks the infrared light.<br>
Regarding the main question, this would be a very bad choice for car backup monitor as it performs poorly in sunlight or under any light containing infrared spectrum. It's best suited for indoor use. Most car sensors are ultrasonic. I use this one for outdoors which has some weatherproofing http://www.sparkfun.com/products/9496. It is pricey and if you do get dirt into it, it'll be absolutely impossible to clean.<br>
In your case I'd go with a cheap Maxsonar EZ series sensor, putting a PVC pipe extender onto it for weatherproofing. The longer the barrel, the less chances of something getting into it.<br>
Another issue with IR sensors is that they project a dot and are only able to detect what's directly in front of them based on how well the dot is reflected. If the object is black, shiny or textured you may get a bad reading. A sonic sensor is a lot harder to fool. In addition it emits a cone-shaped sound wave, so the detection radius is much wider.</p>
SgtOneill on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FSgtOneillurn:uuid:8841362b-82aa-aadc-0aab-af7bd8195c642011-02-07T09:52:26-07:00<p>Can we use glass case to protect this sensor from weather? Would it be ideal for car backup monitor? the ultrasonic ones arent weather proof and putting a glass case will void the range finding.</p>
Jade on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FJadeurn:uuid:a37bce83-cdcc-0358-1c67-dc89d02d26002011-02-03T01:32:14-07:00<p>Short answer - yes. Depth perception will get affected by a small amount in presence of a foreign IR light source, but the remote is very unlikely to cause a major misreading unless you shine it right into the sensor or have it against the obstacle that it's scanning.<br>
This device projects an infrared dot and triangulates the distance based on where it sees the reflection. The dot itself is not perfectly sharp, so the triangulation result gets affected by reflective quality of the obstacle on which it lands. A dot on a white surface will appear to be slightly closer than one on a black plane. The ambient light (including sunlight) containing infrared spectrum will also increase the perceived radius of the dot.<br>
Most IR remotes project a soft cone of light as oppose to a focused beam, so they won't cause much error in reading. A ray of sunlight, in comparison, will generate a measurement error 100x greater. The device is best suited for indoor applications with constant lighting containing the least amount of IR. To get the idea of what the sensor actually sees check out my post higher in the thread.</p>
stushev on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0Fstushevurn:uuid:f06d334b-30a5-13e5-a885-e0669e8b17a72011-01-23T07:31:54-07:00<p>Will IR remote controller interfere with it?</p>
rmackay9 on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0Frmackay9urn:uuid:5a4872da-0862-a485-a0e0-b873a40a9f122010-12-22T03:31:45-07:00<p>Re the comments on the "gotcha" - this comment threw me off a bit. I interpreted it as meaning every other read would be garbage..but actually it's really just the very first read which (for me anyway) is no big deal.<br>
-Randy</p>
Jade on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FJadeurn:uuid:a1b8ac67-11ea-d5d8-7afc-d43b957b68db2010-12-07T18:22:01-07:00<p>Arduino was programmed to respond to serial commands. Receiving number followed by "x" would adjust the horizontal servo. Number followed by "y" adjusted height and "d" performed an read of the depth value and returned a digit via serial port. I don't remember where I put the sketch. It's been years. I did find the Python sketch though:<p>import sys
import os
import serial
import math
from PIL import Image</p><p>def clamp(lowvalue, highvalue, driver):
if driver < lowvalue:
driver = lowvalue
elif driver > highvalue:
driver = highvalue
return driver</p><p>ser = serial.Serial(port='COM33', baudrate=19200, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, bytesize=serial.EIGHTBITS)</p><p>imageWidth=1581
imageHeight=791
delay = 0</p><p>scan = Image.new("RGB", (imageWidth, imageHeight))</p><p>xPos = 820
yPos = 1215
rVal = 0
gVal = 0
bVal = 0</p><p>time.sleep(2)
ser.write(str(yPos) + 'y')
time.sleep(delay)</p><p>while yPos < 2005:</p><p>while xPos < 2400:
ser.write(str(xPos) + 'x')
ser.write('d')
dVal = int(ser.readline())/4
scan.putpixel((xPos - 820,yPos - 1215), (dVal, dVal, dVal))
xPos += 1
time.sleep(delay)</p><p>while xPos > 820:
ser.write(str(xPos) + 'x')
ser.write('d')
dVal = int(ser.readline())/4
scan.putpixel((xPos - 820,yPos - 1215), (dVal, dVal, dVal))
xPos -= 1
time.sleep(delay)</p><p>ser.write(str(yPos) + 'y')
time.sleep(delay)
yPos += 1</p><p>scan.save("c:/scan_01.tga", "TGA")</p><p>ser.close()</p></p>
Jade on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FJadeurn:uuid:0a581cf2-ec2e-9b10-a80d-cc6056fa016e2010-11-05T15:33:12-06:00<p>Using this sensor, an Arduino Uno and Python 2.5 for data processing I made a single pixel camera. The sensor is attached to a servo rig allowing incremental rotation along X and Y axis. Python then takes the distance values and servo rotation coordinates, converts them to luminance and constructs an image pixel by pixel:<br>
Here's a test scan (link updated):<br>
http://imgur.com/a/muMiX<p>Image on the left is taken with a web camera and the image on the right is scanned with this Sharp Sensor (over the course of about 5 minutes). Used a single 0.1uF capacitor for signal filtering.<br>
The noise in the image comes primarily from cheap wobbly servos.</p></p>
pstemari on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0Fpstemariurn:uuid:e0519dc7-f379-fce5-c212-c9592bcaa5fb2010-10-24T13:39:19-06:00<p>They work reasonably well and there doesn't appear to be any single-component replacement available. Get 'em while the getting is good.</p>
Engineer04915 on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FEngineer04915urn:uuid:788a7c93-afa9-00d1-0ae5-da9c2b00f8932010-10-23T13:06:44-06:00<p>Hey, all these sharp proximity sensors are obselete!<br>
I almost used them on a project.</p>
SomeGuy123 on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FSomeGuy123urn:uuid:f4011f2a-738e-912f-4f3d-4f251b9cbf252010-10-17T21:39:10-06:00<p>The connector is a bit strange. I unsoldered it and soldered on a few 90 degree male header pins.</p>
Jade on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FJadeurn:uuid:ca2921ad-28da-6398-39ae-97fe1bee8fa72010-10-13T19:55:45-06:00<p>Had a chance to test these out today. Managed to reliably extract about 1/3 of the maximum stated range (60cm) off a 4.5 volt power supply. Increasing the voltage to 5.5v raised the max range all the way to the stated 1.5m. Much like with sonic sensors, the power supply affects the intensity of the dot/ping and the max detection range. However the input voltage does not change the min range cutoff, so if 15cm is too much for you, go with a mid or short range Sharp sensor.<br>
Overall, great value, fast response and negligibly low self-noise.</p>
Richard Hart on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FRichard Harturn:uuid:d7e280de-67e6-4f3c-62fb-1a42c94c86742010-09-30T15:12:05-06:00<p>You know, Jade, I'd be willing to bet if you explained your situation to Sparkfun, they'd let you buy the extra sensor. They're reasonable folk.</p>
Jade on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FJadeurn:uuid:bb3dd93b-51d9-3e44-618e-025d4fa1e4842010-09-21T18:26:44-06:00<p>Would it be possible to raise the item limit to 5? The robots I build tend to have an odd number of proximity sensors for symmetrical obstacle detection. There's a central sensor and a matching number for the left and right side. 3 sensors are enough for some setups, but for anything more complex (near/far side detection) or for motion tracking 4 just isn't enough.<br>
Last time I needed to track linear movement, I had to go with a thermopile array, just because I couldn't buy enough stand alone infrared detectors from Sparkfun.</p>
Cameri on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FCameriurn:uuid:68747959-c6ac-0fcc-88c1-4033a071fcae2010-08-21T06:10:59-06:00<p>Just place a decoupling/bypass capacitor across Vcc and GND. 0.1uF will do. That will remove the noise that comes from the power supply lines.</p>
EmilioG on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FEmilioGurn:uuid:750f61bb-ff3b-7393-6f7d-78ccca22ddae2010-04-19T23:50:31-06:00<p>its just the Sparkfun standard. Every single item on site has these cheaper priced listed under it. And the change all that for just three items..? (I am referring to the other two sharp IR sensors that Sparkfun sells)</p>
Numex on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FNumexurn:uuid:212f3889-fcc5-5c0a-5193-e7490e2fea692010-04-19T02:37:45-06:00<p>lmao! "This is a really hard to find item! Limit 4 pieces per customer." vs. $13.45 10-99 (10% off), $11.96 100+ (20% off) i think there is a problem here as an individual may want to purchase more than 10 perhaps</p>
Richard Hart on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FRichard Harturn:uuid:c68c9bd8-a76e-7882-a5ce-4ba602920b242010-03-17T14:40:12-06:00<p>20 feet is pushing IR. I think Sharp makes one for that range. Beyond 20 feet, you'll have to rely on LASER ranging ($$$). You might also try two parallel LASER beams and a TV camera, and try analyzing the number of pixels apart the two beam dots are, but that's only theoretical and may require LASER power that could be harmful to human (and animal) eyes.</p>
bdodds on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0Fbdoddsurn:uuid:c64e0c8b-52eb-ee25-9f65-f375c798ab5f2010-02-22T01:13:10-07:00<p>Do they make something like this that works up to 50 feet?</p>
Sam Reese on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0FSam Reeseurn:uuid:72047880-d138-ff5c-426e-941491d968682010-01-11T13:24:36-07:00<p>Check the datasheet... One really fun gotcha of this component is that it needs two reads to really stabilize the data and get good information, but it will tell you the first read, meaning that if there is constant motion, or something JUST NOW stopped, your first read will be trash, and subsequent reads will actually have a basis in reality.</p>
monkeyslayer56 on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0Fmonkeyslayer56urn:uuid:2fb945c7-69ed-ba69-b2e7-beed96c7ff602009-11-14T09:58:52-07:00<p>if your using the 3 wire connector then you need to wire the yellow to the analog in, the red to the 5V, and the black to GRD<br>
hope this helps</p>
rickburgen on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0Frickburgenurn:uuid:8f41c98e-601e-c922-c371-1db024c3a7d42009-11-10T11:08:51-07:00<p>I take that back. The input voltage seems to be random, and not related to how far an object is.</p>
rickburgen on SEN-08958 - Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0Frickburgenurn:uuid:5cf0bbea-2977-ebca-a0b7-3f54162678ad2009-11-10T10:05:59-07:00<p>I hooked this up to my Arduino, but I am not getting any input voltage. How should the wires be connected?</p>