Interfacing with a PS/2 mouse

[David] sent in his implementation of reading a PS/2 mouse with a PIC microcontroller and some LED displays. Of course, this follows hot on the heels of using a PIC with a PS/2 keyboard so now might be the time to start digging out your old peripherals out of your junk pile.

[David] began his project trying to figure out how to connect a mouse to his breadboard. After hacking the plastic off a PS/2 mouse extension cord, he wired everything up according to the pinout. Programming the PIC to understand PS/2 commands was a little strange. [David] is used to having his microcontrollers provide the clock signal. The PS/2 protocol is a bit strange as the peripheral sets the clock. Since PS/2 is a bidirectional protocol, the mouse also accepts commands. The host – [David]’s PIC – must send the mouse a command to start sending movement data.

Because USB keyboards and mice are backwards compatible with PS/2 ports, [David] tried out a few USB mice with a USB to PS/2 adapter. Every attempt at using a USB mouse failed. Strangely, when a Bluetooth mouse was tried (via Bluetooth to USB to PS/2), everything worked perfectly. Check out [David]’s PIC mouse demo after the break.

18 thoughts on “Interfacing with a PS/2 mouse

  1. Wait… Bluetooth USB dongles work over PS2? If so, this is amazing! However, I think he might just be confusing a regular 2.4 GHz wireless mouse with a Bluetooth mouse (understandable, Bluetooth works in the 2.4 GHz band).

    This is still pretty cool, Bluetooth or not.

  2. IIRC, those adapters are device specific, or at least manufacturer specific, I have not been able to get mine to work with several wireless mouses, it only works with the one it came with.

    It would make perfect sense to me that the adapter puts the mouse into a PS2 mode, and others don’t respond the same way.

  3. Sorry, but that’s not bluetooth, but a normal wireless mouse. Bluetooth mice won’t work that way, because bluetooth is a rather complicated technology requiring setup (and drivers) for the devices to connect and to communicate.

  4. The mice that work with either usb or ps/2 have special microcontrollers that emulate one of the two when connected to the pc. The adapter is just passive. So a mouse that supports only USB will not work with a ps2 adapter. The wireless works just as well because the dongle will provide PS2 signals, again it has nothing to do wit bluetooth.

    I find the demo really amusing…

    1. Yeah, I learnt this hard way when I thought: “Hmm, maybe I can use cheap usb number pad with usb/ps2 converter instead of self made keypad or dpad?”. Sadly, the answer is no. I needed to buy full ps2 keyboard for this to work.

  5. i would rather say the bluetooth dongle of the mouse is ps/2 compatible not the mouse. after all the mouse sends data to the mouse in some standard and the bluetooth dongle does all the layer abstraction stuff like telling the pc a mouse is attached.

    1. I ordered “samples” from a manufacturer in China. Shipping cost a lot (International DHL is very expensive). I was looking for displays with “square dots” (like the ones I already ordered from this page:, but I wanted either larger ‘dots’ or a larger display. I did a google search for “square dot led matrix” and found a few websites that listed manufacturers. For a while I ignored them because I wanted to order from someone like digikey. Since I could not find them anywhere, I eventually decided to contact one of the manufacturers. It took me a while to accept how much I would have to pay for shipping, but, eventually, I decided to do it. There are some more pictures here:

Leave a Reply


You are commenting using your account. Log Out / Change )

Twitter picture


Facebook photo


Google+ photo


Connecting to %s