Gravity Mouse

CSE466 - Fall '00

Justin Huff and Melissa Poole

Project Description

For this project, we made what we call a Gravity Mouse, a mouse that used the angle it was tilted at to determine which direction the pointer should move. We used an accelerometer to measure changes in acceleration due to gravity in the X and Y directions in order to determine which angle the mouse was tilted at. The greater the angle in one direction, the faster the mouse pointer would move in that direction. There actually is two ways we found to implement the mouse. One was to use the angle tilted to determine the position the mouse was on the screen. The other way was to use the angle tilted to determine the speed the mouse moved in a certain direction. We decided to use the angle to determine speed instead of position because monitor sizes change, which would make determining the position hard, and we felt that using it to determine speed would be more accurate in moving the mouse. If we had tried to have it determine the position, we would have had to write our own mouse driver or have the user input screen dimensions. The serial mouse protocol is a packet of 3 bytes which included a bit for each of the right and left mouse buttons (1 is down) and 8 bits for each of the X and Y directions telling how much it changed from the last time we sent a packet out. The processor used was the Atmel 89C55 and we used the Keil 8051 development tools to create the program that ran our Gravity Mouse, which was able to move around and click on the screen close to that of a regular mouse.

Outstanding Problems

One problem during this project that was never resolved was a bug, maybe in our software, which when the mouse gets tilted in a certain direction (to the right), it jumps in the opposite direction before going in the right direction. We tried many things to resolve this problem, but never succeeded and still don’t know why this anomaly occurs.

Recommendations

In the future, there are some ways of improving the mouse, some of which we had wanted to do. The mouse would be a lot nicer if it was small enough to fit in the palm of your hand. This way, one could hold the mouse and just tilt their hand in the direction they want to move very easily. To do this, we would need a smaller board and probably a smaller chip than the 8051, since we don’t need all the pins it provides. It would also be nice to have a battery to power it so we didn’t need to carry around the big power source. Also enclosing it in some sort of case would be more practical for use.

Another idea would be to implement the mouse using the angle to determine the position and write our own mouse driver and see if this was a easier way for the user to move the mouse.

This kind of mouse would probably be good in games such as flight simulator, and once the jumping bug was fixed, it would be nice to try this out.

Use

The gravity mouse is not hard to use. First, your computer needs to be setup to use a serial mouse. Then attach the GravityMouse to the correct serial port. Next, apply power to the mouse. One of the two LEDs should light up indicating step 1 in binary. The GravityMouse is now in ‘calibration mode.’ Each reset we need to calibrate the accelerometer using a six step process.
  1. Lay the mouse flat. Press the left button. The LEDs should now read 2.
  2. Tilt it to one side in the X direction. The mouse should be perpendicular from it’s position in step 1. Press the left button. The LEDs should read 3.
  3. Tilt it the other way in the X direction. This is a 180-degree rotation from #2. Press the left button. The LEDs will show 1 again.
  4. Repeat the previous steps for the Y direction.
  5. The mouse is ready for use.

Source Code and Schematics

The source code is in mouse.c.
The schematic is in mouse.gif.