Lex is using the GP2D02 in his robots but there are many applications for this part.
The GP2D02 from Sharp is a distance sensor that can measure distances from 7cm to 1.2 meter.
It uses an optical transmitter and receiver to measure the distance and outputs the distance in 8 bit serial format.
The datasheet of the GP2D02 can be downloaded from : http://www.sharp.co.jp/ecg/sys/gp2d02/gp2d02-fea.html
A more in depth description of the GP2D02 is also available.
Dr.-Ing. Claus Kuehnel donated one of the chapters of his BASIC STAMP book that describes the GP2D02.
In fact the BASIC STAMP book is a good source for interfacing all kind of hardware.