how do i get arduino to move a mouse

does anyone have any idea on how to get arduino to move a mouse curser? any code or tips help. :)

first thought: oh not you again

second thought: you'd better not multipost this or bump this thread even once (people will answer if/when they want to, bumping just puts people off)

third thought: Yes, I have some ideas. You can send serial data from your arduino, down the USB cable, to your computer and then get AAC keys to move your mose (or 'press' keyboard keys). You will need to look up AAC keys and then you will be able to find the serial commands you need to send and that will tell you how it works.

Or you could do this by hacking into an old computer mouse but it would be more difficult and more pointless.


I would go for or the teensy


Well I would recommend something like that if I thought that bootloader flashing was within his (or mine at the moment!) capabilities. I don't think most people have AVR programmers (yes ok, quite a lot of people have 2 arduino boards and could do it like that)

Secondly, the teensy isn't an arduino (ok, yes it has an arduino add-on)

Oh well... No doubt none of this will help him anyway. Or he'll just bump the thread for the hell of it Or maybe i'm just a bit grumpy tonight...

What are "atm" capabilities? I am not a native speaker, so I do not get this point. Would you explain it to me?

I agree that it might be beyond his capabilities but anyway, he now has a hint.


I found this: using that new fangled google thingy: 'arduino usb hid'

EDIT: does this work?

RE: teensy not arduino. Thats true, the implication of which is that the code is not portable, as the lotsa neat stuff that it can do is in its own libraries. And the pinouts are different. Don't ask too much how I know this....

What are “atm” capabilities?

atm = at this moment

Pauls: ah, got it.

Another thought: controlling a PS/2 mouse would be much easier. PS/2 to USB converters are pretty cheap. I do not mean the dumb ones but the real converters. In Europe you get them for less than 5 Euros if you search for them a little bit.

From that point on things should be much easier.


  • Wire a solenoid to the Arduino
  • Put the mouse in front of the solenoid
  • Write a program that triggers the solenoid, or just use the blink, then you can have plenty of fun!


Put an optical mouse on top of a GLCD and move the pixel patterns ;)

Salvage an old x-y plotter... ;D

Sorry you guys aren't offering a 4th dimensional answer.

If you used an optical mouse, you could simply move the mat below it. Like any pesky rodent, holding the tail is possible but dangerous, so you sould employ a squeezing motion along the side.

Two servos (one on each axis) would allow limited movement, but the really big moves involves linear actuators....

Can't see why you would want to perform surgery on a mouse, when you can over engineer a solution.


While we’re overcomplicating things, mount the mouse on a stand on top of a hamster ball supported by rollers. Put a real mouse inside the ball, and use one servo to move an arm with cheese at the end. The Mouse runs, moving the cursor!!!

Another seious idea: get an old mouse with a ball and connect arduino wires to the ir detectors in the encoders. Use the arduino to activate these detectors, moving the cursor.


get an old mouse with a ball and connect arduino wires to the ir detectors in the encoders

that one has other possibilities. I was looking at some datasheets on the IC's inside an a old optical mouse. The IR detector is actually quadrature (one collector and two emitters), and the output to a USB/PS2 does all the dpi conversion for you.

This could make a useful wheel encoder.

Mark do you think our originator gets the hint yet. ;D

I think I would mount some cheese on the end of a long servo arm and see if It could entice the mouse to move.


I would mount some cheese

Peanut butter works better.