Adding Sharp IR Dist Sensor via A4 or A5

I recently added a Sharp GP2Y0A021YK IR distance sensor to my Zumo bot. According to the manual, analog in A4 and A5 are not used by the reflectance sensor array or the shield and should be available for my use. I soldered a four pin header to the front expansion panel on the starboard edge at the front corner just behind the metal blade that had A3 5V GND and A4 to access the analog pins. I used the A4 5V and GND header pins for the IR sensor. The software printed out the wrong values from the sensor. I discovered that A4 and A5 had a steady 5V on them and aren’t usable as spares. Why not? Where is the 5V coming from and can I defeat it somehow? Without reflectance array software running, I used the A3 pin and called it out in my sketch and the new IR sensor worked fine. Of course, I need A3 for edge detection normally. I can use A1 (normally for the battery level monitor), but I really would like to use A4. I would appreciate someone familiar with the shield wiring layout to advise me how to free up A4 (and A5 for that matter).

Thanks,
John Wolf
p.s. Everything else about the Zumo works very well. I have two of them and enjoy them a lot.

Hello, John.

I am glad you like the Zumo robot! When you use an Arduino Uno, pins A4 and A5 are used for I2C communication with the compass on the Zumo shield, so they are both pulled up to 5V. If you do not want to use the compass on the Zumo, or do not plan to use A4 or A5 for I2C communication, you can cut the traces on the shield as described under the “Jumper settings” section of the Zumo user’s guide.

-Jon

Thanks JK:
So using an Arduino Uno, there are no spare analog pins if all the Zumo features are left intact and only two digital pins - 2 and 6.

I don’t really understand the “Monitor LEDS” function on the expansion board. What is this signal meant to tell me? There are a lot of LEDS on this board.

I think sacrificing the battery level signal is the least useful, so I will use the A1 input for my IR sensor. My plan is to swing the bot to locate the opponent with the IR sensor and reference its location with a compass direction. I’ll adjust the heading of the bot from that to proceed toward the opponent. I can then speed up with closure with IR readings to hit the hardest and detect that with the accelerometers or change directions if the opponent moves.

Later,
John Wolf

Hello, John.

That’s right; none of the analog pins and only digital pins 2 and 6 are available when using the Zumo with the Arduino Uno, the compass/accelerometer, and reflectance sensor array as long as the shorting block on the reflectance array does not connect to LEDON. However, you might not need all six reflectance sensors for a mini-sumo application; a lot of our robots get by with only the two outermost sensors (on pins 4 and 5).

I am not sure what you mean when you ask about “Monitor LEDS”. The red and blue LEDs indicate when power is present, and the yellow LED is for user control.

In general, compass readings on the Zumo are not very reliable for navigation. (You might get them to work for you at your place, or even a specific room at your place, but when moving to another room or building, the readings could be drastically different.) You could just make a loop in your sketch that constantly adjusts where your robot is pointed to keep your opponent in front of your blade, which is basically what most of the robots in this competition are doing.

-Jon

The “LED ON” is the name on the expansion board for the shorting plug to select pin A4 for the Leonardo or pin 2 for the Arduino Uno. I found the explanation in the manual. It’s for controlling all the LEDs on the expansion board for battery conservation if you are doing a function like compass calibration that doesn’t require the front LEDs to be on. I lose pin 2, but I can’t see what I’d do with it anyway.

I decided if I want to use the Zumo for a totally different use, I’ll remove the expansion board and plug in my own expansion plug going to whatever. Or I could cut the analog links and still use a couple of IR sensors.

Thanks for the help. Sometimes it just take confirmation of what I was thinking all along.