Manav Kataria's Blog

Air Mouse: Construction and Working

Construction

Here is the circuit:

Working

Conversation with a friend on Air Mouse Working Principles:

Subbu: Manav… the air pigeon… how is the mouse like movement achieved?
Manav: Dark magic, with evil-looking sacrificial knives on scantily clad virgins under pale moonlight! LOL! just kiddin ;-)

  • It actually uses an (analog) accelerometer that responds to the Horizontal (X) and Vertical (Y) tilts of the device in terms of voltages.
  • Then the microcontroller ATMEGA32 sends the tilt data via the serial-port to the PC after converting it to digital using an ADC.
  • This is where the Visual Basic Driver takes over and sends mouse move events using user32.dll to Windows .
  • For the Clicks, there is a push button on the PCB for user-inputs.
Earlier, the first version of Pigeon was Serial based and used an ATMEGA32. It also required a 5V external supply. I ported it to Arduino today. Now it has a USB interface and requires no external power supply -6th May 2009. See Evolution of AirMouse on Project homepage.

Video:

About these ads

27 responses

  1. Garima

    Can you please explain the motivation behind using an accelerometer in the air mouse?

    May 9, 2010 at 12:07 pm

    • To understand and explore using an accelerometer

      May 9, 2010 at 12:47 pm

  2. Pratik Tikle

    For conversion of analog to digital why have you used Atmega32 instead a simple 8051 can do it.

    October 19, 2010 at 3:50 am

    • Hi! Pratik,

      ATMEGA32 has a built-in ADC. 8051 would need an external ADC. Its not a limitation but just makes it more convenient.

      -Manav

      October 19, 2010 at 12:04 pm

  3. pooja sunder

    hey haven’t u written a code to program the microcontroller?i can’t find it anywhere.I am making a similar project.

    April 10, 2011 at 7:46 am

    • You can find it on the project website: http://air-mouse.googlecode.com

      Manav

      April 19, 2011 at 3:50 am

  4. Krunal

    Hey it seems pretty cool! what did u do after u sent in the values of the accelerometer via arduino?? I mean how to tell the pc to treat it as a mouse??

    August 29, 2011 at 9:20 pm

    • A program runs on the PC which reads accelerometer values coming in via the serial port. This program maps accelerometer values to mouse movements with the help of windows mouse libraries. You can take a look at the source code on the air-mouse website:
      http://air-mouse.googlecode.com

      August 30, 2011 at 2:03 am

  5. Krunal

    Thanks man for replying so soon..i checked out the code..i dont have any knowledge of python whatsoever..so hmm…just to see whether i got it right…tell me what i am saying is correct or not..
    1.Send values of the acc to the PC serially via the serial port.
    2.Download and install “python” and run the code named accelclent.py(note: i have a PC, will it cause any complications?).
    3. It says in the readme that i need ethernet over bluetooth??!! What’s that about?
    4. Do i need to do any signal filtering or calibration before i send the data to the PC?
    5. So how is gaming with this thing? :)
    And did i miss out on anything?
    And thanks alot on sharing the code…:)..ill let you know if i finish this project..:)..its just for fun so it might take some time before ull know..cheers..:)

    August 30, 2011 at 7:46 pm

    • There is a visual basic version of the code which is more elaborate. You might want to take a look at that if you find it easy to read.

      The steps you’ve enumerated seem to be correct. Calibration is a part of the VB code and always helps. The ethernet over bluetooth was needed as the python code was run on a smartphone with Linux on it. Details on the website.

      Games like Snake / Bricks are more fun with the Air Mouse in my experience. I’d suggest if you want to use this on a PC, try the VB code.

      August 30, 2011 at 9:26 pm

  6. abhi

    like it

    September 7, 2011 at 7:11 pm

    • Glad :)

      September 14, 2011 at 2:54 am

  7. lyn

    i really cant find the code for the program in the link that u gave.. can you send me the code through email? here is my e-add…
    babylynconcon@gmail.com
    thank you…

    February 18, 2012 at 12:07 pm

    • Hey lyn! Sorry for the late reply, I had been travelling.

      The Visual Basic code is much more elaborate than Python.

      Did you check here, use 2.15.2:
      http://code.google.com/p/air-mouse/downloads/list

      or check out from the version control system:
      http://code.google.com/p/air-mouse/source/browse/#hg%2FWinDriver

      What do you need? What are you making?

      Regards
      Manav

      February 21, 2012 at 6:16 pm

  8. lyn

    i am making the same project as yours, but my problem is the code. i cant compile it because i cant find the right compiler for the code.. did you used proteus to simulate the program in the microcontroller? i’m really confused… i am stuck with the code. huhuhu

    March 2, 2012 at 6:03 pm

  9. lyn

    and also, here in our place there is no available accelerometer the same as yours. i just got an ADXL355 3 axis accelerometer.. can i used it instead of wat u used?.. please do post a pic of the complete connection from microcontroller to the accelerometer and the left and right buttons.. can you help me for this? please.. lastly, i am just familiar with mikroc and pic basic, can i load vb code directly to the microcontroller? i cant compile it. i am waiting for your response.. thank you.. hope you can help me.

    March 2, 2012 at 6:18 pm

  10. Mounica

    hey… can you help me out in using a bluetooth for interfacing..
    i am trying to construct the same using a atmega8L,capacitive touch sensor,3-axis accelerometer(through i2c interface),bluelink bluetooth module.
    My basic doubt is how to control the mouse drivers of a bluetooth enabled laptop using avr studio?
    i would appreciate your earliest possible reply.. :) thankyou!!

    March 28, 2012 at 9:30 pm

    • See point #3 described in ‘Working’

      April 1, 2012 at 12:50 am

  11. Deepu

    hi, dude i’m trying to do the same thing..i’ve just one doubt, this is a general purpose mouse..ryt? so did u create a new driver for the mouse or just used the existing mouse driver in the os..is the latter way possible..i.e for the os to detect it as a mouse by sending some signal from the microcontroller…could you please help?..

    October 8, 2012 at 8:53 pm

    • It is possible to program a mouse for the OS to detect it to be a generic mouse. That was the initial objective I had for this project. However, the documentation on Microsoft Mouse was too little and I could not get it to work with the documentation I found. Hence I ended up writing my own user-mode device driver on top of the OS.

      Hope this helps!
      Manav

      October 8, 2012 at 9:08 pm

      • Deepu

        one more thing..how did u convert the motion in 3 axis to corresponding motion in plane..did u neglect one axis?

        October 11, 2012 at 6:54 am

      • Yes. On a typical desktop (2D) use case the third axis doesn’t make sense and needs to be ignored. For (special) 3D applications it becomes useful.

        October 11, 2012 at 9:29 pm

  12. anup

    hello Manav ,
    i m doing the same project for my final year project… and i m using usb interface to do it… i m stuck with how will the pc know that i am giving the input through a mouse. ie. is it possible to use the present mouse drivers of windows…?

    November 4, 2012 at 8:35 pm

  13. anup

    as ur above comments, i dont have any idea about python.. so i want you let me know where will i get information about python?

    November 4, 2012 at 8:39 pm

  14. PRANAY BORKAR

    did you use JAVA program to interface accelrometer to PC.??
    what is the OS of your PC..??

    February 28, 2013 at 12:39 pm

  15. PRANAY BORKAR

    which program you used to BURN on arduino??

    February 28, 2013 at 12:55 pm

  16. I want to make same this one any person help me

    January 20, 2014 at 5:49 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 1,315 other followers