Arduino Forum

Using Arduino => Programming Questions => Topic started by: -____- on May 30, 2014, 06:06 am

Title: Arduino Robot with Sharp IR Sensor
Post by: -____- on May 30, 2014, 06:06 am
Hi,

My school has recently brought an Arduino Robot use in the RoboCup, along with half a dozen Sharp GP2Y0A02YK0F IR range sensors.

We have tried using the SharpIR Arduino library, but to no avail.

Does anyone have an idea of how to use these sensors? Can we even use them with the Arduino Robot?

Thanks,
Isaac
Title: Re: Arduino Robot with Sharp IR Sensor
Post by: holmes4 on May 30, 2014, 09:34 am
Ditch the lib you don't need it. The wiring is power to +5, ground to ground and the output to an analog pin. The you just use analogRead() to get the range when ever you want it. The graph in the datasheet is used to convert to cm if you want.

Mark
Title: Re: Arduino Robot with Sharp IR Sensor
Post by: -____- on May 30, 2014, 09:40 am
Uh, okay. Thanks for the reply!

Where exactly do I plug everything into on the board? I can't find any ground or power pins on it.

(http://arduino.cc/en/uploads/Main/LottieLemon_figure_hardware_top.png)

This is what we are using (http://arduino.cc/en/Main/Robot)
Title: Re: Arduino Robot with Sharp IR Sensor
Post by: -____- on Jun 27, 2014, 05:28 am
Bump
Title: Re: Arduino Robot with Sharp IR Sensor
Post by: holmes4 on Jun 27, 2014, 11:10 am
According to the docs you have 4 analog inputs available on the control board it connects to one of these. Its up to you to figure out where they are.

Mark
Title: Re: Arduino Robot with Sharp IR Sensor
Post by: holmes4 on Jun 27, 2014, 10:46 pm
From the link you gave,
Quote
Pins TKD0 to TKD3 can also be used as analog inputs with Robot.analogRead()


So you hook the sharp IR sensor to one of these pins and use RobotanalogRead() to read the sensor

I can't however find VCC/5V or GND in the documents but take a close look at the top of the control board they should be there!

Mark