Using an Optical Mouse to guide a Robot

Thread Starter

John A Bonilla

Joined Mar 11, 2017
92
Hello Everyone,

I am currently working on a BB8 and trying to get it to follow a coordinate system. Currently the robot is being controlled via a Bluetooth connection to my tablet (remote control). Now I am trying to get it to follow this system so that it can be programmed to move itself through a maze. However, my research has not been successful. I have tried using the connectors from the inside of the mouse and connected it to an arduino however, it may have been damaged or otherwise not working.

What I am here to ask is how i can use an optical mouse's x and y coordinate tracking to develop a grid so that points can be programmed for the robot to follow. Once this is done I would need further assistance on another portion of this project however this is my main concern. I currently have access to different Optical mice, Arduino Unos, HC-05 Bluetooth receiver/transmitter, and should be able to get hands on anything, within reason, to help my end goal.

I appreciate any help that anyone can offer, and I will be happy to clarify any questions that you may have so that I can continue this project!
 

wayneh

Joined Sep 9, 2010
17,496
To use a mouse, you'd have to implement the protocols it expects to interface with. You haven't mentioned whether the robot has an onboard computer that might be able to do this.

Rather than using a mouse, you might consider using the same kind of technology. The old 'ball' mice used to use two rotating magnets held against the ball. Each rotation of the magnet registered a pulse along the appropriate axis, allowing the computer to compute the travel of the mouse. Newer, optical mice shine a light at the surface and are able to 'see' motion. More simply than either of these methods, you can use a wheel rotating through a slot containing an IR emitter/receiver pair and count every time the wheel blocks or passes the light.

It might be easier to adopt one of these technologies directly to your robot than to try to use a mouse.
 

AlbertHall

Joined Jun 4, 2014
12,345
Using a ball mouse requires good contact of the ball with the surface it is travelling over - any slippage and you're lost - so it all depends what the surface is.

Some optical mice are easy to interface and some much more complicated. It all depends what chip is used. Look for a PS2 optical mouse.
 

Thread Starter

John A Bonilla

Joined Mar 11, 2017
92
To use a mouse, you'd have to implement the protocols it expects to interface with. You haven't mentioned whether the robot has an onboard computer that might be able to do this.

Rather than using a mouse, you might consider using the same kind of technology. The old 'ball' mice used to use two rotating magnets held against the ball. Each rotation of the magnet registered a pulse along the appropriate axis, allowing the computer to compute the travel of the mouse. Newer, optical mice shine a light at the surface and are able to 'see' motion. More simply than either of these methods, you can use a wheel rotating through a slot containing an IR emitter/receiver pair and count every time the wheel blocks or passes the light.

It might be easier to adopt one of these technologies directly to your robot than to try to use a mouse.
Well the microcontrollers that I can use is an Arduino Uno and Arduino mega. I was hoping to use the clock and data pins from the mouse however it has not been working. I can try to get my hands on a ball mouse, however I will most likely not be able to get access to one.

https://www.google.com/amp/www.inst...use-Odometer-for-Arduino-Robot/?amp_page=true

The link is the basis of using the mouse for the x and y coordinate plane. However it does not seem to work.
 

Thread Starter

John A Bonilla

Joined Mar 11, 2017
92
Using a ball mouse requires good contact of the ball with the surface it is travelling over - any slippage and you're lost - so it all depends what the surface is.

Some optical mice are easy to interface and some much more complicated. It all depends what chip is used. Look for a PS2 optical mouse.
Is there a difference between a ps/2 optical mouse and a USB optical mouse?
 

AlbertHall

Joined Jun 4, 2014
12,345
Interfacing with a PS2 mouse is described in the link you posted and there is a library for the Arduino which makes the software part easy.
 
Top