USB Optical Mouse Position Encoder Issue

Dear All,

I am new to Arduino community and instrumentation as well. I am trying to measure distance. I want resolution of around 20-30 micron. After going through couple of youtube videos and blogs, I realized that USB optical mouse can provide the required resolution.

Therefore, I am trying to read the data from optical mouse using Arduino Leonardo. I have tried various codes (available on internet) to read the position from optical mouse but none of them worked. I thought it might be hardware issue. After digging a little bit, I could not find anything where anyone has reported any hardware issue except 1 post where they talk about pull up resistor ( I tried that solution as well but it doesn’t seem to be working.

Finally, I hooked up the oscilloscope to see whats happening with Clock and Data pin. I have attached images of clock and data pin with and without arduino connection. When clock and data pin is not connected to Arduino, there is no signal and Data pin is always in LOW state. When I connect Clock Pin to Arduino, I get some pulses in Clock pin and Data signal becomes HIGH. When I connect both Data and Clock pin to Arduino, the clock signal changes to a square wave with an amplitude of 0.5V and offset of ~4V. But both are in HIGH state.

State Clock pin Data pin
No pin connected HIGH LOW
Clock pin Connected to arduino HIGH/LOW (Pulses) HIGH
Both pin connected to arduino HIGH (Square Wave) HIGH

At this point, I am not sure whether it is due to interface issue or Arduino board problem or coding issue. I was wondering if someone has any idea about how to resolve this issue.

Thanks and Regards,

USB-Mouse Issue.pdf (561 KB)

Use a USB Host shield.