I designed this gripper in SolidWorks and 3D printed the components in PLA filament. It uses a photoreflector constructed from an LED and a photoresistor 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 microcontroller to monitor the sensors and control the servo.