Analyzing USB Mouse Wiring


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?




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.


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:

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.


Thanks, David.

Something like this is even better:

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.



They also have this: and this is actually what I want to build: which is unfortunately discontinued.

Here is a replacement for that device that I have found: