Analyzing USB Mouse Wiring

Hi,

I am working on a project that will require input from a mouse when it moves. I have taken apart many USB mice and tried powering them out of an Arduino 5v pin.

I usually get lucky with determination of which wires of the mouse are for its power supply. And tonight I fried my Leonardo by trying different wires.

Is there a better way of determining the wiring of the USB to the mouse to figure out what the power supply lines are and what the output of the other wires are?

And the safest way to power these things is not to connect them to the controllers. I have supplied 5v from controller to them and it has been okay for the mouse. But it would be nice to be able to figure out their voltage needs and experiment without having to connect to the controller power supply. Any recommendations?

Thanks

Farzad

Hello.

There should be 4 wires coming from the USB cable that are soldered to the mouse PCB. One of those will be GND and another will be VBUS (5V). Can you see those wires and tell what colors they are? To safely power your system, you might consider using a benchtop power supply with an adjustable current limit.

–David

Thanks, David.

There is an unshielded wire which I assume is the ground and the red one which I assume is the +ve. the other three wires are Black, White and Blue. This was a Fujitsu mouse.

What is a good way of determining which of the additional three wires transmits what information?

If you’re trying to get data using the mouse’s USB interface, you’ll probably have to spend some time reading the USB specification, revision 2.0, which can be downloaded here:

usb.org/developers/docs/usb20_docs/

That document contains information about the pin assignments in the USB connector and what kind of data can be sent on them.

It will probably be easier to just find a device that has USB host capabilities, such as an mbed or a USB host shield instead of implementing the USB protocol yourself on the Arduino.

–David

Thanks, David.

Something like this is even better:

pololu.com/product/2593

All that I want to do is to move the mouse, have Arduino recognize that it has moved and how far from the previous point.

I would need a breakout board that can host regular size USB. Pololu doesn’t seem to carry it. Maybe I can build one?

You might try a USB type-A jack. At one point I soldered the metal part of a type-A socket to a quarter-sized perma-proto board in order to create a fake USB port. That just takes care of the physical connections though; the actual signals and data packets you will need to send in order to communicate with your mouse are complicated, so I still think you should get some device that was designed to act as a USB host.

–David

David,

They also have this: https://www.sparkfun.com/products/12700?gclid=Cj0KEQiAhvujBRDUpomG5cq_mI0BEiQA7TYq-vJJrfWwaiaB5jRichg9j1OjQLP0F_v7H-r-YWPJM2AaAjzq8P8HAQ and this is actually what I want to build: https://www.sparkfun.com/products/retired/10105 which is unfortunately discontinued.

Here is a replacement for that device that I have found:
https://www.tindie.com/products/jkicklighter/adns-9800-optical-laser-sensor/

Thanks.