Interface for the ADNS-3080 optical-flow mouse sensor
While working on the autonomous tracked robot, it became necessary to the readings from a set of optical flow sensors. This was especially important for the tracked robot, as I wanted to use two sensors to create an array that could determine both translation and rotation. This led to the development of an Arduino library for the ADNS 3080 mouse sensor. It is generally sold as an independent module with a lens attached. The library was was written for such a module.

Sensor module for the mouse sensor
The module communicates with the Arduino via the SPI protocol. This makes it possible to communicate with multiple sensors of the same type, as we can assign different pins to the Arduino to interface with the sensors independently. To make the device plug and play, the code provides a simple interface to retrieve motion and frame data from the sensor. However, it also nessesary to calibrate the sensor by focusing the lens of its camera. Otherwise, it would not be possible to obtain proper motion tracking. This led to the development of a script that could retrieve the information from the sensor and generate an image. The script worked in conjuction with an arduino sketch that depended on this library. See the following repository for more information: ADNS3080_frame_capture.

Schematic for the sensor module and Arduino Uno. It's the same for other boards except the SPI spins change
References
Credit goes to Lauszus and Neumi for on their code to get the sensor to work with arduino. This library is essentially a repackaging of their code into a neater form. See:
- ADNS3080 by Lauszus
- OpticalFlowA3080ArduinoProcessing by Neumi
- ADNS-3080 datasheet
- Connection diagram for ADNS-3080. Note: This page contains another library for the ADNS-3080.
Github Repository
The code for the ADNS-3080 library can be found at the following repository. It can also be downloaded from the arduino library browser. See: ADNS3080 - Arduino Library