The ADNS-9800 Laser gaming sensor comprises of sensor and VCSEL in a single chip-on-board (COB) package. ADNS-9800 provides enhanced features like programmable frame rate, programmable resolution, configurable sleep and wake up time to suit various PC gamers’ preferences. The advanced class of VCSEL was engineered by PixArt Imaging to provide a laser diode with a single longitudinal and a single transverse mode. This Laser gaming sensor is in 16-pin integrated chip-on-board (COB) package. It is designed to be used with ADNS-6190-002 small form factor (SFF) gaming laser lens to achieve the optimum performance featured in this document. These parts provide a complete and compact navigation system without moving part and laser calibration process is NOT required in the complete mouse form, thus facilitating high volume assembly. The sensor is based on Laser technology, which measures changes in position by optically acquiring sequential surface images (frames) and mathematically determining the direction and magnitude of movement. It contains an Image Acquisition System (IAS), a Digital Signal Processor (DSP), and a four wire serial port. The IAS acquires microscopic surface images via the lens and illumination system. These images are processed by the DSP to determine the direction and distance of motion. The DSP calculates the Δx and Δy relative displacement values. An external microcontroller reads the Δx and Δy information from the sensor serial port. The microcontroller then translates the data into PS2, USB, or RF signals before sending them to the host PC or game console.

In this tutorial You will learn how to connect ADNS-9800 Laser Mouse Sensor to Arduino and Display Traveled Distance (Δx) on 20x4 LCD

NOTE: You have to activate +5V mode first (this tutorial is written for arduino uno (any arduino will work which uses Atmega8 - Atmega16 - Atmega32)), To activate +5V mode you have to cut the three traces on the 3.3V side between the exposed sets of pads, and add three solder bridges to the 5V side of the board (Be careful don't damage board).When you will activate +5V mode and then connect it correctly it will work fine, but remember code that is uploaded doesn't show distance in meters and you have to decrease loop delay to speedup sensor. If you are removing LCD please edit code to display distance that sensor has traveled

I'm working on this code now for days but I cant get it to work properly. I want to see my traveled distance in cm in the serial monitor. Is there anyone who got it all working and wants to share his or her conde with me?

I saw a code down here but since it was posted 3 years ago I can't open it anymore...

It is for a project for my study, but I am not really good at arduino.

Hi Gigi - I'm trying to use this to monitor the speed of movement. At first blush everything seems to be working, but xydat[0] seems to always be -1, 0 or 1 instead of a byte showing the distance moved since the last reading so it's really inaccurate unless you're moving really slowly. Any idea what could be causing this?

Hey JasonC11, can you explain the math you're doing on the xydat[0] and xydat[2] in this line? I see the 2.54 so I assume you're going from inches to cm, but I'm not sure where the 200 is coming from along with the FS*1e-6, or 0.1 (1e5*1e-6).

That's exactly right. I think the "ncs pin" is the SS pin on the ADNS-9800. In this example he connects it to pin 10 on the arduino. If you connected it to, say, pin 6 on the arduino, make sure to change the number in code to 6.

Thanks, That was it. Actually all I need is two output pulses derived from the laser mouse forward and reverse movement, that emulates a rotary encoder. I have a scalable totalizing counter that accepts square wave pulses. I do not need the "y" output. Sounds easy, but I haven't figured it out yet. I am completely new to Arduino and C. Any help would be greatly appreciated.