The optic flow sensor fabricated by Centeye (www.centeye.com) provides a packaged method for measuring visual motion for robotic applications and particularly for unmanned aircraft. Visual motion - or optic flow - can be used to detect the relative change between speed and depth. This is useful for aircraft attempting to measure altitude or moving robots attempting to detect nearby obstacles.
Optic flow is a measure of how fast an image is moving by. This is measured by detecting changes in areas seen by a vision chip. By measuring how fast a dark or light spot progress across the chip, the rate at which the image is moving can be determined. By restricting measurement to one direction it is possible to decipher both the direction and rate at which the sensors surroundings are moving by. This information can then be used to determine altitude, the distance to an object, or if an object is in the sensors path.
For a plane, the closer it is to the ground, the faster the ground will appear to be traveling by. In a commercial jet, the ground appears to move by slowly underneath, where as in a helicopter the ground seems to zoom by. If the velocity of the vehicle is known or kept constant, the rate at which the ground is moving by can be used to determine the altitude. The same principle applies for object avoidance.
The optic flow sensor from centeye provides a 4-bit binary number corresponding to the optic flow measured. The vision chip used is highly sensitive to lighting conditions and image contrast. In particular, light intesity plays a big factor in the sensitivity of the sensor. The sensor must be tuned for the expected light intensity of the application. This can be determined using a light meter to measuer the light intensity in lux of the environment. The type of lighting and image contrast also play a big role. The sensor operates best in natural light (flourescent light is very noisy) with a highly contrasted image (such as a checkerboard pattern or black lines on white paper). Obviously these are not realistic situations, but they can be used for testing.
The output from the sensor is intentionally non-linear. The higher the optic flow value, the less sensitive the sensor becomes, as several optic flow values may be mapped to a signal binary output.
Four pins at the bottom of the sensor are used for supply voltages and data. The pinouts are shown below in Figure 1, along with the direction optic flow is measured in.

The optic flow sensor operates at lower voltages, but performs best in the 4-5 VDC range.
The optic flow sensor is relatively easy to use and program with. With binary output it readily interfaces with any microcontroller. A simple test circuit comprised of the sensor and LED's can be used to observe the output of the sensor. A schematic for such a circuit is shown below in Figure 2.

To test the sensor, apply the correct voltage and run a sheet of paper with thick blacks lines or other highly contrasted object (newspapers are good) over the sensor. If the sensor is operating properly, you should see the LED's count up in binary.
Below is an example of the optic flow sensor in use. The sensor is hooked up to a PIC16F84 microcontroller. The PIC reads the imput from the sensor and generates a PWM signal to control an actuator attached to the rudder of an airplane. When the optic flow value exceeds a threshold the rudder is deflected. A piece of paper with black lines is used to give a high contrast image.
Hopefully this tutorial has familiarized you with the Centeye Optic Flow Sensor and given you ideas for implementing the sensor in your own applications. If you have any questions about this tutorial you can email me at Keithicus@drexel.edu.