Main Content


Moves the mouse cursor a tiny amount occasionally, simulating the user being at the computer, preventing the PC from going to sleep/lock.

Having worked in corporate America for the better part of 40 years, I’ve seen corporate computer security policies change over that time from almost none to nearly insane. Today many IT groups force the computers they maintain to require a password to be entered if the computer goes to sleep, which can occur in as few as 5 minutes, in some cases. A recent employer of mine also went to a two step authentication scheme using your password and a token device that displays a set of numbers that also have to be entered as a second password. While this security is nice and sometimes essential, it can be very annoying if you actually need to get something done (besides entering passwords). I can’t count the times I’ve been interrupted at my desk by a conversation with a co worker only to find that when I get back to my computer, the screen has gone to the lock screen and I have to enter the password and a token value to continue. It would be nice to have a mechanism to occasionally automatically move the mouse a little to keep the computer from going to sleep and the lock screen.

Searching the web for a solution to this revealed that others have attempted to solve this problem. Everything from a servo that physically moves a real mouse to software programs that run on the PC as a background task were found to do this function. The servo method seems far too primitive, while the software only PC program versions don’t always work because the security rules “see through” this cheap trick. What would be nice is to come up with a low cost device that “looks and smells” like a real mouse, that occasionally moves. This lead to the development of the “MouseMover” device detailed here.

Project Details
This project implements a simple “MouseMover” that can be used to keep a computer from going to sleep or locking using only a low cost (≈$5-$17) Pro Micro module (Sparkfun DEV-12640 or equivalent clone) with an ATMega32U4 processor chip, a USB cable and software implemented using the Arduino IDE compiler and environment. It can also be used on other Arduino controllers like the Arduino Leonardo or Arduino Micro, but the Pro Micro board is tiny, powered by the USB port and low cost, making it the ideal hardware solution for this task.

This controller moves the mouse cursor a tiny amount every minute or so, simulating the user being at the computer, which prevents host PC from going to sleep or locking the screen. Unlike software only solutions that many IT infrastructure systems know how to ignore, this solution looks as though a real (second) mouse is added to the computer. The normal mouse is still used for computer operation.

Usually moving the mouse cursor a few pixels every minute or so is enough to keep the computer from going to sleep or locking. Because the amount moved is small (even just a few pixels in either the X or Y direction is usually enough) and it’s only is done every minute or so, this will not usually interfere with normal computer operation. To maintain some semblance of system security (that IT groups demand) this added mouse controller can be programmed to only run for a limited time, after which it stops moving the mouse, until commanded to run again (or unplugged and re plugged in again).

This controller has a number of user changeable parameters. All of the parameters for the controller can be modified by sending commands to the controller’s serial port, which is also added to the host PC when the controller is plugged in. This controller will appear to Windows as a mouse device (HID) and a virtual serial com port. Once the controller is programmed, it will have default parameters selected for all of the changeable parameters, but these can be changed and then saved to EEPROM so that the user selected parameters are used each time the controller is connected to the PC.

This firmware is designed for use with a Pro Micro board (that uses an ATMEGA32U4) and is connected to the PC with its USB port. With this concept, the only hardware required for this solution is an Arduino Pro Micro controller and a USB cable that connects this controller to the PC.

Hardware and I/O
While this project requires no hardware or wiring other than the Pro Micro module and the USB cable to hook it up to the computer, there are a few of the I/O pins that can have jumpers added to alter the devices operation. There is another pin that can have an LED connected to it to indicate that it’s running or not, if desired. While not required, it has been found that having the LED connected is a handy addition – It’s nice to know when the MouseMover is running and not. The other connections to the jumpers are mostly provided as a convenience, or if control of the MouseMover by jumpers is desired instead of using serial commands.”

Link to article