I designed this gripper in SolidWorks and 3D printed the components in PLA filament. It uses a photo-reflector constructed from an LED and a photo-resistor to detect and automatically grip an object once it is close enough.
To accommodate different sized objects, it uses a 3D printed tension sensor that trips once a certain tension force develops in the threads. This allows the gripper to apply the same gripping force to objects of different size.
It uses an Arduino micro-controller to monitor the sensors and control the servo.