Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: mondo32 on November 10, 2012, 11:12:33 AM

Title: problem with Sharp IR Sensor -GP2Y0A21YK0F
Post by: mondo32 on November 10, 2012, 11:12:33 AM
hi everyone  8)
i bought one of Sharp IR Sensor -GP2Y0A21YK0F .... and it looks easy to use 3 pins vcc , gnd & signal ....
but when i try it it has no response for changing distance .... Have i done something wrong here ?  :'(  .... please help i'm new in robotics and i definitely need some help
thanx alot guys
Title: Re: problem with Sharp IR Sensor -GP2Y0A21YK0F
Post by: zwarte on November 10, 2012, 12:33:01 PM
Check the tutorial you should Calibrate it first.
Title: Re: problem with Sharp IR Sensor -GP2Y0A21YK0F
Post by: waltr on November 10, 2012, 01:29:50 PM
Quote
but when i try it it has no response for changing distance
What exactly did you try?
Start with a voltmeter on the Sharp sensor output. The voltage should vary as a detected object (or wall) changes distance.

What power supply are you using?
the Sharp sensor draws a bit of current (100mA) when it pulses its IR LED on. If the power supply voltage sags too much then the sensor doesn't work.
Title: Re: problem with Sharp IR Sensor -GP2Y0A21YK0F
Post by: mondo32 on November 10, 2012, 03:40:03 PM
I used a 9 volt battery and then regulated by 7805 IC then connect +ve 5 volt to VCC wire of the sensor and the ground with GND , and connect the signal pin to the +ve side in the voltmeter and the -ve with the same ground of the circuit , and try to move objects front of the sensor and nobody's home 
Title: Re: problem with Sharp IR Sensor -GP2Y0A21YK0F
Post by: mondo32 on November 10, 2012, 03:43:01 PM
Check the tutorial you should Calibrate it first.
how can i do that ?? can you give me a link for calibration tutorial  ;D
Title: Re: problem with Sharp IR Sensor -GP2Y0A21YK0F
Post by: waltr on November 10, 2012, 05:00:19 PM
what voltage do you measure on the Sharp's output?
Are you sure you have the + and - input pins correct?
Is the regulator (7805) output always +5V (+-0.1V)?
Do you have caps on the regulator input and output?
Do you have another power supply to feed the regulator? A 9VDC, 300 to 600mA wall wart would do fine.
I've used these and the only issues has been the high current spikes causing other circuits to reset.

Quote
Quote from: zwarte on Today at 12:33:01 PM

    Check the tutorial you should Calibrate it first.

how can i do that ?? can you give me a link for calibration tutorial  ;D

The Sharp sensor do not need calibration. What zwarte may be thinking is that you are using the ADC input of a processor which might need calibration to translate V out to distance (ie the $50 robot expansion).
Title: Re: problem with Sharp IR Sensor -GP2Y0A21YK0F
Post by: Soeren on November 12, 2012, 06:08:45 PM
Hi,

I used a 9 volt battery and then regulated by 7805 IC then connect +ve 5 volt to VCC wire of the sensor and the ground with GND
Are you sure you got it connected the right way around? (It may be hard to see which is pin 1).

The sensor draws pulses of more than 200mA, so if your 9V battery is an alkaline PP3/"Transistor battery", it hasn't got the stamina for the task.
You can test if that's the case by measuring the input to the regulator. If it gets under 7.5..8V, it won't quite cut it.

A capacitor right at the sensor supply terminals is needed, no matter the supply.

A cap of at least 100µF (up to say 470µF), will help if it's a fresh alkaline PP3 - if it's not fresh... Forget it). Let the cap charge to the full voltage before you connect the sensor.
Placing this cap before the regulator is best (and a smller one may do it then. This is because you have a bit more allowed voltage drop before things go wrong than on the 5V side.

To sum up: Cap of 100..470µF on the input of the regulator, ~22µF on the output of the regulator and 10..47µF right on the terminals of the sensor.