Motility detection of microorganisms using a hacked optical mouse

Just done further experiments with the hacked optical mouse sensor, in this case a Avago ADNS2610, from a cheap wired logitec optical mouse. So i managed to connect the optical sensor to the arduino and send all the data, including the image from the 18x18pixel sensor, through a serial connection to puredata (pd). The sensor is a real high-end device, it calculates the optical flow, thus gets out motion and the speed of the mouse, it detects focus by a SQL-value, which is proportional to the number of features the sensor detects on a surface. and other values such as maximum and average pixel and shutter speed can be read from the registers.

The frame rate of the transmitted image is sadly relatively low, cos the ADNS chip is not meant to present this info at higher speed. still its reasonable, when reading all 18x18 pixel a framerate of roughly 5 fps is feasible, if you only dump the first couple of lines you can increase it to higher framerates.

After building a patch to visualize all these data from pd, i started experimenting with placing microorganisms on top of the sensor, keeping the optics intact, but replacing the LED with an RBG, so i can control illumination.

I got some really amazing results, it seems i can detect single cell microorganisms using just the mouse sensor and an arduino. see the movie below. while the sensor only detects motion if the whole image is shifted, it seems that when a microorganism (Blepharisma Japonicum) passes the field of view, there is a substantial change in the SQL-value.

further i will try to do some simple image processing on the arduino directly, such as simple background substraction.

Download Code
The code for the arduino and puredata can be found here (work in progress):

worm_on_mouse2pd

* The arduino code, uses two libraries: pitches.h and SimpleMessageSystem.h. the first is just used to play a nice little welcome melody, the second is only needed to communicate back from pd to change the dumpWidth of the frame. copy them to your libraries folder.

* The pd patch uses two externals, "convert" to communicate with SimpleMessageSystem" (again only from pd to arduino not vice-versa) and a second one, "pd_fire_grad" to apply a look-up-table (LUT) to the pixels for better visualization.

2 Responses to “Motility detection of microorganisms using a hacked optical mouse”


  1. 1 gaudi

    Mac OS X MouseHack Software for the ADNS2051 Chipset can be downloaded here: http://www.gaudi.ch/MouseHackTest.zip

  2. 2 Plasmo

    Hey, love the hack. have been trying to copy this to try and view/measure my parasites bound to a substrate. I've attempted to hack an A2366 sensor. Seems as though its talking to the chip, but no image. Any suggestions?

Leave a Reply