Using an optical mouse to retrieve coordinates

Hello friends,

I'm trying to use a mouse sensor(ADNS-5700 H3MB) to retrieve coordinates for positioning, but i'm having problems on understanding how the sensor works.

The sensor uses SPI to communicate.

After reseaching some topics about SPI I concluded that it needs (correct if I'm wrong):
-A output(MOSI) ,
-A input(MISO),
-A slave select(SS),
-A clock(CLK).

After reading some topics about using mouse sensors I concluded that(also correct if wrong):
-It uses hexadecimal values for communicating or displaying values(dont know which one yet)

This was all I could figure out researching by my own.

Here are the problems:
-I can't find the SS and CLK on the sensor.
-I barely know how SPI works
-I don't know how to obtain the values from the sensor
-I don't know what to do with the values

Can someone help resolve all those problems?

These are the websites that I used on researching:

http://frenki.net/2013/12/convert-optical-mouse-into-arduino-web-camera/
http://www.bidouille.org/hack/mousecam
http://strofoland.wordpress.com/2013/08/08/reading-a5020-optical-sensor-using-arduino-part2/

http://www.martijnthe.nl/2009/07/interfacing-an-optical-mouse-sensor-to-your-arduino/

Hi WhiteBeta

According to the data sheet you linked to, that sensor has a USB interface, not SPI.

There are ADNS sensors with SPI: for example, 3090, 6090, 9800.

Regards

Ray

Oh, i see.

Is there a way to use this sensor for the project?

Not without an rather expensive USB-hostshield and probably a lot of programming.
I guess you'll have more luck finding an SPI-sensor in an PS2-mouse.

Question, do you actually need to read the optical sensor itself ?

If you use a PS-2 mouse, 2 arduino pins and the PS2-mouse library, you can read position and get 3 inputs+scrollwheel for free.

I thought on using a PS-2 mouse, but i think it can't fit in the 3cm-radius circle of the project. Also I want to use only the sensor, not the whole mouse.

Is it possible to make a wiring using only the sensor?If so, how would the wiring be?And the programming?

This sensor has built in USB ONLY. You have to interface via USB

This is technically possible with a USB host shield, which is expensive.

I've noticed also, that LUFA now has support for USB Mouse host, see

However I'm not sure how easy it would be to use the LUFA code in a sketch

The easiest way is just to get another mouse that uses a sensor with spi.

I recently took two mice to pieces. An old one had that chip you have, a newer Microsoft branded mouse, had a chip that has spi

However, I was a bit loathed to destroy an expensive new mouse.

I'd ask your friends for any old mice they have, carefully open then, and see if any have an spi compatible chip