Robotic arm mounted on an autonomous line follower

hello everyone.

I am working on a robotic arm mounted on an autonomous robot. I am done with the line following part. and It tracks the line pretty well. controlled 2 DC geared motors via fastPWM from atmega16 using motor driver l298, used LDRs and LM324 comparators for the line following. all the programming is done in avr studio 4 and used ponyprog to burn the code in atmega 16.

Problem:

I need an arm mounted on the robot to pick a small PVC pipe flag from a specific place and place it on another key hole. I dont want to feed the path in controller, instead i want to install another sensor assembly to do this task.

I need suggestions for where to install the sensors on the robot or on the arm to detect the flag and the hole to place it. flag is placed in a holder at the height of almost 20cm from groud. and most importantly what kind of sensor will or can work in such a situation. I need atleast 2 degree of freedom for this arm. what kind of motors should i use, the flag to be picked is very light, maximum weight 150grams.
another suggestion is required that should i install the gripper and elbow motors on the arm and use gears or is it possible to install both motors on robot base and use a belt instead? 
and is atmega16 capable for doing all these jobs in a timely fashion or i need to shift on pic or anyother controller if i want to improve the robot's sensing and computation time.

i used atmega16 on default frequecny of 1Mhz, lets say i change it to maximum 8Mhz. most of my computations are done in loops, and i read the sensors again when a loop is complete. now can i expect it to complete the loop faster than default?

any suggestions would be highly appreciated.