Patching into an optical mouse with a PIC

[MikyMouse] cracked open a couple different optical mice (or is it mouses?) in order to play with the data communications coming off of the chips inside. Once he figured out the protocol, it wasn’t too hard to grab the data for use in his own projects. The chip that controls the mouse is one of two he looked at, either an ADNS2051 or an ADNS2610. They run at 5V and use serial communications via SDIO and SCK pins. The clip after the break shows the test apparatus displaying coordinates of the mouse on an LCD screen. This seems like an easy and inexpensive way to get position data from your project. The only tricky part is going to be deciding when and how to to zero out the location.

Not interested in this type of mouse hack? Can we spark your curiosity with this mouse auto-fire project?


  1. ino says:

    I wonder if the mouse sensor can be used as a contact less tachometer. Could be quite useful for some projects.

  2. Hackineer says:

    This was done years ago over at Kronos Robotics.

  3. MikyMouse says:

    it depends on the speed you want to misure… remember that you have a delay from reading to reading and that the maximum displacement is “128” (from reading to reading too)… but it’s a good idea! (ps mice or mouses isn’t the same? XD

  4. fartface says:

    Better yet is using a optical mouse as a low res camera for motion detection or low cost computer vision.

    I have at least 1 ardunio bot using a mouse chip as vision for obstacle avoidance.

  5. geekabit says:

    Sprite_tm also wrote an article about this: and used it again a while later:

  6. Anonymous says:

    For just simple mouse data don’t USB mice still detect the clock signal and switch to PS/2 communication? I seem to remember that old USB mice came with a USB-to-PS/2 adapter. This is still neat, none-the-less.

  7. HackerK says:

    Pretty good write up. And these are the things I wanted to see at HaD…

  8. Lucassiglo21 says:

    i did this for a robot, it was pointing to the floor, and then i made a closed loop control system, so i could control the robot speed and position in real time. optical mouses are very nice sensors indeed.

  9. Kevka says:
  10. Stofli says:

    I’m interested in building this hack. Can you give me details?

  11. MikyMouse says:
    • Ditch08 says:

      Can i use this with ADNS2051 too? i tried your code while replacing DY address to 0x04 based on the sensor’s datasheet and instead of displaying the output x&y to the lcd, i tried to display it to hyperterminal using serial connection with pic16f877a. But no luck, please give some advice, thanks :)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

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

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s


Get every new post delivered to your Inbox.

Join 96,695 other followers