Arduino Mouse Wiggler

2,661

12

13

About: Designer, inventor, and maker.

It is kind of annoying every time when the computer goes into sleep, especially when you are in the middle of a PowerPoint presentation, or working from home but supposed to appear available online all the time. This simple device will wiggle (jiggle) your mouse for you every 30 seconds or so and keep your computer always awake. This device simply simulates the physical mouse movement, there's no App or driver to be installed, so it is 'stealth' and won't violate the company IT policy or expose yourself to dangerous software.

Step 1: Make the Device

The entire mouse wiggler is 3D printed. The files are attached. Print the parts with your favorite color.

Step 2: Hardware and Assembly

The mouse wiggler uses parts that are available from many retailers. Following hardware are needed:

  • Arduino Nano (or clone,don't solder the pins to the Nano)
  • SG90 Servo and hardware pack
  • Mini USB cable
  • Some wires

Following are the steps to wire the servo to the Arduino Nano and installation of the servo and wheel.

The servo has a connector with 3 female pins. The orange one is the PMW pin that needs to be connected to the D9 pin on the Arduino Nano. The center Red wire is Vcc that goes to the +5V on the Nano and the Brown is ground that is connected to the GND on the nano. I used 3 male pins and soldered it to the wires from the Nano to make the wiring easier.

Use one of the servo horn and the screws to secure the SG90 servo to the mouse wiggler body, and install the wheel on the servo output. Make sure the wheel is level and does not interfere with the mouse. Optionally you can print the pattern and place it on top of the wheel to improve aesthetics and make the mouse move more consistent. I used white address labels for this.

Step 3: Code

The Arduino sketch is attached. Make sure you have the Servo.h and SimpleTimer.h libraries installed before uploading the sketch to your nano. You may change the angle in which the servo will travel, and the time interval that the servo will move. The default setting is the servo will move the wheel 30 degrees to the left then 30 degrees to the right every 30 seconds. This will make your mouse move for about 10 mm which is enough for keeping the computer from sleep, yet not too much to lost track of the mouse cursor. You may adjust these values as you desire.

Step 4: Let the Mouse Move

Place your mouse on top of the Mouse Wiggler and make sure the optical sensor on top of the wheel. Power the device up use a USB power adapter and you're good to go.

Automation Contest 2017

Runner Up in the
Automation Contest 2017

Share

    Recommendations

    • PCB Contest

      PCB Contest
    • First Time Author

      First Time Author
    • Big and Small Contest

      Big and Small Contest

    13 Discussions

    0
    None
    PacoT6

    1 year ago

    could you put out the code in the article because i cant open the file.

    3 replies
    0
    None
    ArtSuzhouPacoT6

    Reply 1 year ago

    I just tried the sketch can be downloaded without issue. It can be opened by Arduino IDE, or a text editor.

    0
    None
    PacoT6ArtSuzhou

    Reply 1 year ago

    Could you send me an email or something because the computer I use cannot open the file.

    0
    None
    PacoT6PacoT6

    Reply 1 year ago

    *email text file of the code or a picture of the code

    0
    None
    Virginijus

    1 year ago

    You can write and compile it to the .com file with a few lines of C++.

    1 reply
    0
    None
    ArtSuzhouVirginijus

    Reply 1 year ago

    Both software and handware mouse emulator is available. This is more suitable to be used when you don't want to take the risk using none-authorized software or hardware which is not uncommon if you work with sensitive information.

    0
    None
    docman100

    1 year ago

    I have always wanted one of these, for instance, you don't want your character on minecraft and/or roblox to get disconnected for being idle.

    0
    None
    falias

    1 year ago

    just get an Atmega32u4 and send mouse commands. no empty mouse batteries, no loud servo, 1-2 lines of code in the loop

    2 replies
    0
    None
    ArtSuzhoufalias

    Reply 1 year ago

    ATtiny85 can do the same. But that requires installation of mouse driver which in some cases are not permitted. In some places plug in such an USB device will trigger an red alarm.

    0
    None
    faliasArtSuzhou

    Reply 1 year ago

    well the 32u4 has built-in usb and doesn't require special drivers (as far as i know), so attiny85 can't do the same. not to mention that those places must suck, when you aren't allowed to plug in another "default" input device :-P

    0
    None
    onetruegod

    1 year ago

    I love the you way you avoid using an app. Could you run this off a ATtiny85 instead of a full arduino?

    1 reply
    0
    None
    ArtSuzhouonetruegod

    Reply 1 year ago

    Absolutely ATtiny85 can do it. But the sketch needs to be rewritten since the ATtiny85 use different libaries.

    Genius! No more issues with movies getting interrupted by the screen saver.