If you want a really small, compact sensor to detect obstacles coming at your device, the 2-direction sensor kit is just the thing!
This 2-direction object sensor is great for short-range, wide field detection. The Sharp IS471 sensor provides modulation to the IR LEDs, and decodes the reflected signal, which helps the noise-immunity. Ideal for tiny robots - it's only 1.55" (3.94cm) wide!
Here are the full specifications:
Note: This is a kit that requires some manual dexterity to assemble correctly!