Author Topic: IR range finder calibrate problem  (Read 1242 times)

0 Members and 1 Guest are viewing this topic.

Offline kalu125Topic starter

  • Jr. Member
  • **
  • Posts: 12
  • Helpful? 0
IR range finder calibrate problem
« on: October 01, 2010, 07:20:34 PM »
Hi
I made my $50 robot, it works well and i have also added UART to my $50 robot. I was able to collect readings of Photoresistors through the UART. now I'm going to add  IR range finder to my $50 robot. I'm using SHARP GP2Y0A21YK0F range finder. I'm going to calibrate it and the problem is, it gives me almost same reading regardless of the distance with the object. data sheet says it works accurately between 10cm to 80cm. i kept the object distance 10, 20, 30, 40, 50, 60, 70, and 80cm and took 10 readings of each distance with the following code. but always it give almost same range of readings.
for( i=0; i<10; i++){
sensor_ir=a2dConvert8bit(3);
rprintf("IR Reading: %d\r\n", sensor_ir);
delay_cycles(40000);
}
it always gives set of data like this
IR Reading: 156
IR Reading: 156
IR Reading: 156
IR Reading: 156
IR Reading: 138
IR Reading: 156
IR Reading: 114
IR Reading: 156
IR Reading: 131
IR Reading: 157
IR Reading: 130
IR Reading: 115
IR Reading: 156
IR Reading: 156
IR Reading: 156
IR Reading: 156
IR Reading: 149
IR Reading: 156
IR Reading: 147
IR Reading: 156
IR Reading: 156
IR Reading: 156

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,944
  • Helpful? 99
Re: IR range finder calibrate problem
« Reply #1 on: October 01, 2010, 08:41:53 PM »
Did you check the Sharps output with a voltmeter at each distance?
The voltage should match the V vs distance curve in the data sheet.

Offline knossos

  • Robot Overlord
  • ****
  • Posts: 278
  • Helpful? 14
Re: IR range finder calibrate problem
« Reply #2 on: October 01, 2010, 08:46:10 PM »
I would also check that you have your sensor wired correctly.   If looking into the sensors with the connector downward you should have the following:

Output   -   Ground  -  Power.

And while you're at it, make sure you ground the Sharp's chassis to ground as well (it looks like its plastic but it is conductive and should be grounded).
"Never regret thy fall,
O Icarus of the fearless flight
For the greatest tragedy of them all
Is never to feel the burning light."
 
— Oscar Wilde

Offline kalu125Topic starter

  • Jr. Member
  • **
  • Posts: 12
  • Helpful? 0
Re: IR range finder calibrate problem
« Reply #3 on: October 01, 2010, 09:10:50 PM »
I would also check that you have your sensor wired correctly.   If looking into the sensors with the connector downward you should have the following:

Output   -   Ground  -  Power.

And while you're at it, make sure you ground the Sharp's chassis to ground as well (it looks like its plastic but it is conductive and should be grounded).
Thanks a lot knossos, i have mounted it as {Power-   Ground  -  Output}. corrected as you pointed out then it works.
but the data sheet says {Power-   Ground  -  Output} completely miss leadind  ???
data sheet : http://sharp-world.com/products/device/lineup/data/pdf/datasheet/gp2y0a21yk_e.pdf

Thanks a lot  :)

Offline kalu125Topic starter

  • Jr. Member
  • **
  • Posts: 12
  • Helpful? 0
Re: IR range finder calibrate problem
« Reply #4 on: October 01, 2010, 09:15:26 PM »
Did you check the Sharps output with a voltmeter at each distance?
The voltage should match the V vs distance curve in the data sheet.

No, i didnt check the output with a voltmeter.
OK now it working i have misswired it.
thanks for the reply  :)

 


Get Your Ad Here

data_list