Available Pins

I have a Zumo with the Reflectance Sensor array that I built from the kit. I have successfully done most of the Arduino library examples. And have been successful in doing the border detect program. I plan to do the line following and maze examples in near future. I am a newbie to Arduino and Robots so bear this in mind when responding.

I want to install a Sharp analog distance sensor like GP2Y0A21YK0F or the GP2Y0A02YK0F to add object (other bots) detection. The problem I am having is understanding what specific pins I connect it on the front expansion of the Zumo shield. I have read several forum discussions, but the pin availability is still not clear. Further, it is not clear as to how many of these sensors are needed to effectively detect objects.

For reference, I have the Reflective Sensor array attached and all the pins of the female socket are soldered to the Zumo shield. I have also installed the jumper block for the buzzer using pin 3 (have Arduino Uno) and the jumper for the battery. Separately, I do not want to do any resoldering or cutting of circuit board contacts to make pins available unless absolutely necessary.

So here are my questions:

  1. What analog and digital pins are available? I have seen so many different answers on the forum, it is confusing as to what is available. Plus, the guide’s reference apparently does not include what pins are being used with Reflectance Sensor. Based on my forum searching, I believe the available pins are: Digital 2 and 6, and Analog 1, 4, and 5. Can someone confirm this is correct for my setup or if not what it should be? Also, does using any of these pins interfere with the compass or accelerometer?

  2. How many distance sensors do you need? I have seen examples of 1 and 2. I assume that you take one Analog pin for each sensor and connect the other 2 wires to 5v and ground. Please confirm this is correct. Should the sensor be mounted vertical or horizontal?

  3. What do you recommend for connection to the available pins? I would like to not solder the sensors directly, but rather be able to easily disconnect for other sensors I might want to use. I was thinking of using bent male headers or permanently soldering a wire with a plug for the connection. Any suggestions?

Upon further research I have determined the following with an Arduino Uno and a Reflectance Sensor Array:

  1. Digital pins D2 and D6 are available for use.
  2. A1 can be made available without the jumper across A1 and Battery Level. I currently have a jumper across it. Relative to the other Analog pins this looks like the best bet for gaining an analog pin since I do not know why I would want to monitor battery level.
  3. All other Analog pins are taken up by the Reflectance Sensor Array (A0, A2, A3) and I2C (A4, A5).

So my questions become:

  1. Can I use A1 to attach an Analog Distance sensor like GP2Y0A21YK0F or the GP2Y0A02YK0F? I assume the 3 wires would go to A1, 5V and GND?
  2. Can I use pins D2 or D6 to attach a Digital Distance Sensor like the GP2Y0D805 and GP2Y0D810? Again I assume Out would go to D2 or D6, Vin to 5V and GND to GND?
  3. Which is better to use an Analog or Digital Distance Sensor? My intent is for object avoidance and detecting other robots nearby.

Thanks for your help in advance…


According to what you have stated, the pins you propose using should be available, and the connection you propose also sound reasonable. Each sensor is different; you will have to determine for yourself which is best suited for your application. You can read more about the differences between the sensors in the “Alternative Sharp Distance Sensors” section on their product pages.

The orientation of the sensor can be optimized for the direction that the object you are detecting moves relative to the sensor. You can find more information on this in the datasheet for each sensor. Datasheets can be found under the “Resources” tab on their product pages.

- Grant