Read Encoder from USB Mouse

Hey- I was wondering if it is possible to just read the Encoder from the USB Mouse Scroll Wheel.

If so, is there a USB Library i could use?

It is possible to do this with a PS/2 mouse; search the playground for the PS/2 library. From what I have read though, USB speeds are too high for the arduino. Wether this is true or not, I don't know. It is likely that you will need special drivers for it though, which the arduino may or may not cope with. IMO, stick with PS/2 and stay happy.


USB is not a simple protocol. It is a layered protocol stack. In order to use a USB device, you must operate as a USB Host. There is a USB Host Shield that will help in communicating with USB devices. Since mice are HID devices, code probably exists.

Keep in mind, you are talking a lot of overhead for what you are trying to do.

I think we are going in a little deep here. The op wants to read an encoder, not a USB device.
You need to connect the IR diode pulses to a digital pin configured as an input.

I have two old PS2 mice I was trying to use, but they didn't work with the PS2 library.

One of the mice didn't give me ANY readings at all, and the other one always gave a constant X and Y value of -1.

Texy- So would it be possible for me to just solder some jumpers onto the mouse's diodes connectors? Hopefully while still leaving the circuits inside of it intact?