Skip to content

ANANTH-SWAMY/mousecam

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MouseCam

Optical mouse sensors internally capture low-resolution grayscale images of the surface to track movement. This project taps into that data stream to read and display those images.

The sensor being used here is an Agilent ADNS-2051 from an old Logitech mouse. The datasheet can be found here. It can easily be adapted to work with other optical mouse sensors of the same family.

ss

Hardware

An Arduino UNO was used for bit-banging the serial interface of the mouse sensor. The connections are as follows:

  • ADNS-2051 VCC to Arduino 5V
  • ADNS-2051 GND to Arduino GND
  • ADNS-2051 SCLK to Arduino pin 2
  • ADNS-2051 SDIO to Arduino pin 3
  • ADNS-2051 PD to Arduino pin 4

circuit

Software

The Arduino sketch mousecam.ino initializes the sensor and continuously reads image frames from it. serial_cam.py is a Python script that reads the image data from the Arduino over serial and displays it using OpenCV.

Make sure to install the required Python packages:

pip install pyserial opencv-python

To run the Python script, use:

python serial_cam.py <PORT>

About

Read the frames being captured by an optical mouse

Resources

Stars

Watchers

Forks