SmartMouse : When your Smart Phone squeaks

There are times when an external mouse comes handy while browsing or while playing an exciting FPS game on a laptop computer. But one doesn’t carry a USB mouse always. Here comes your smartphone to the rescue !

The movement of phone can be mapped to the movement of mouse pointer using Accelerometer present in the phone. Accelerometer data is sent wireless ( the phone and computer being in the same network ). Network can be established using WiFi-Hotspot present in the phone.

The server program runs on the smart phone. It sends Accelerometer data to the client program on the computer, which filters the data and sends corresponding signals to move the mouse pointer.

Currently, a server program has been developed to send X and Y data from the Accelerometer to the client program running on the computer. The client program is written in java. Thanks to Vishal for the programs !

Much improvement has to be done on both server and client side.

Here is a screenshot of the output from the client program running in terminal

Image

The Accelerometer data obtained has low frequency noise which affects the performance of the mouse pointer movement. This is the raw plot of X and Y Data obtained.

Image

Image

Visually it can be seen from the data that the phone has moved right ( Along X-axis ). The accuracy should be improved so that the mouse movement can be made smooth. Filters like Kalman Filter can be used to remove noise from the Accelerometer data.

Source of the server, client program ( Java ) and the .apk file for android phone is available at OpenHware. For people who might be interested in filtering the data from Accelerometer , text files containing the data is available too.

To test the code, install the .apk file in your android phone. Connect the phone and the computer in the same network. Replace the IP address of the phone in client program accordingly. Compile the client code and run! Make sure the server program is running on the phone.

Do contribute what you can to develop on the idea! 🙂

One thought on “SmartMouse : When your Smart Phone squeaks

Leave a comment