By Les Pounder
published
Keep your PC from showing you as inactive when you take a break.

If you need your PC – particularly a corporate laptop from your job – to see you as active even when you step away, a mouse jiggler is your best choice. Most company-issued computers either don’t allow you to install software or spy on which apps you are running so using a device that moves the pointer automatically but presents to the OS as a mouse solves the problem. You can head off to Amazon and buy a USB device that costs anywhere from $7 to $40, or you can make your own diy mouse jiggler using the $4 Raspberry Pi Pico.
In this how to, we will build a diy mouse jiggler using the Raspberry Pi Pico and CircuitPython. Nothing else is required, not even drivers, making this $4 project a great saving of your time and your money. Note that, though we used a Pico, these instructions will work for any RP2040-powered microcontroller that has CircuitPython support (almost all of them). A board like the Adafruit Trinkey QT2040, another RP2040-powered microcontroller which costs $8, would be even better than the Pico because it has a USB Type-A built-in so doesn’t even require a wire to connect to your PC.
Configuring CircuitPython for Mouse Jiggler
1. Go to the official CircuitPython page for the Raspberry Pi Pico and download the latest release UF2 firmware image. At the time of writing this was CircuitPython 8 Beta 6. If you are using a different RP2040-powered board, find its UF2 page on Circuitpython.org.
2. Whilst holding the BOOTSEL button, connect the Raspberry Pi Pico to your computer. A new drive, RPI-RP2 will appear
3. Copy the downloaded CircuitPython UF2 file to RPI-RP2. This will write CircuitPython to the internal flash storage of the Pico. A new drive, CIRCUITPY will appear.
We need a number of CircuitPython libraries before we can continue. These libraries of prewritten code add extra features to a project.
1. Download the bundle of libraries for the same version of CircuitPython as installed on the Pico. We installed CircuitPython 8 so downloaded the bundle for version 8.x.
2. Extract the bundle to your desktop and then open the lib folder contained within.
3. Copy the adafruit_hid folder from this lib folder to the lib folder on the CIRCUITPY drive.
Writing CircuitPython Code for Mouse Jiggler
1. Download and install Thonny if you don’t have it already. Thonny is a Python editor which covers Python 3, MicroPython and CircuitPython.
2. Open Thonny and go to Tools >> Options.
3. Select Interpreter, then set the interpreter as CircuitPython, port to automatic, and click OK. Thonny will now connect to the Pico W running CircuitPython.
4. Click on File >> Open and open code.py on the CircuitPython device (our Raspberry Pi Pico).
5. Delete any code already in the file.
6. Import the USB_HID library, followed by Adafruit’s Mouse support library.
import usb_hidfrom adafruit_hid.mouse import Mouse
7. Import the sleep function from the time library. We will use this to add a short delay between each movement.
from time import sleep
8. Create an object, m, to control the virtual mouse.
m = Mouse(usb_hid.devices)
9. Create a loop to continuously run the code within. For testing purposes this loop can be replaced with a for loop, otherwise the code would lock us out of working.
while True:
Alternative Testing For Loop
for i in range(2):
10. Use “move” to move the cursor 100 pixels to the left.
m.move(-100, 0, 0)
11. Print a message to the Python shell and pause for half a second. Printing helps us to debug the code.
print("I am working")
12. Now move the mouse 100 pixels to the right, print another message and pause for a further half second.
m.move(100, 0, 0) print("I am so busy") sleep(0.5)
13. Move the mouse down 100 pixels, print a message and then another pause.
m.move(0, -100, 0) print("So much to do") sleep(0.5)
14. Move the mouse up 10 pixels, print a message and then again pause.
m.move(0, 100, 0) print("I need a vacation") sleep(0.5)
15. Save the code as code.py to your Raspberry Pi Pico (CircuitPython device). CircuitPython will automatically run code.py (MicroPython can also do this with main.py and boot.py) when the Pico is connected to the computer. As the OS believes this is “just a mouse” the project can be used on any OS.
Complete Code Listing
import usb_hidfrom adafruit_hid.mouse import Mousefrom time import sleepm = Mouse(usb_hid.devices)while True: m.move(-100, 0, 0) print("I am working") sleep(0.5) m.move(100, 0, 0) print("I am so busy") sleep(0.5) m.move(0, -100, 0) print("So much to do") sleep(0.5) m.move(0, 100, 0) print("I need a vacation") sleep(0.5)
Adding a Button to the DIY Jiggler
A plug and play mouse jiggler is handy, but more useful is one that we can activate at the push of a button. Here we modified the code to include a push button on GPIO12 which will toggle the jiggler on or off.
For This Project You Will Need
- A Raspberry Pi Pico
- Half Sized Breadboard
- Push Button
- 2 x Male to male wires
The circuit is extremely simple, we just need to wire up a push button to GPIO 12 and GND. GPIO 12 will be set to pull high, and when the button is pressed it will connect the pin to GND. This will trigger the pin to change state to low, and we use this as a toggle for the jiggler code. This project will build upon the code from the previous version.
1. Add two extra imports for board and digitalio. These two libraries provide access to the GPIO and enable us to set the state of GPIO pins.
import usb_hidfrom adafruit_hid.mouse import Mousefrom time import sleepimport boardfrom digitalio import DigitalInOut, Direction, Pull
2. Create an object, button and set this to be GPIO12.
m = Mouse(usb_hid.devices)button = DigitalInOut(board.GP12)
3. Set GPIO 12 to be an input and pull the pin high. Some GPIO pins have an internal resistor that we can pull high to 3.3V or low to GND.
button.direction = Direction.INPUTbutton.pull = Pull.UP
4. Create two variables, active and button_press and store 0 in each. These two variables will store a 0 or 1, identifying if the jiggler is active and the button has been pressed. At the start of the code they are both set to inactive using 0.
active = 0button_press = 0
5. Add a while True loop to run the code.
while True:
6. Create a conditional statement that checks the status of the button and the value stored in active. When the button is pressed, the state of GPIO 12 is changed from high (True) to low (False). When pressed, the conditional statement will check the value stored in active. The default value is 0, meaning the jiggler is not active.
if button.value == False and active == 0:
7. Update the variables to 1 and then print a message to the Python shell.
active = 1 button_press = 1 print("Turning on")
8. Add a five second pause for this condition. This enables us time to press the button and for the code to register the press and offer plenty of debounce time that prevents multiple button presses.
sleep(5)
9. Use an else if condition to check that the button is not currently being pressed and that the values stored in active and button_press are 1. This means that we have pressed the button and want the mouse jiggler code to run.
elif button.value == True and active == 1 and button_press == 1:
10. Reuse the mouse jiggler code to move the mouse around the screen.
m.move(-100, 0, 0) print("I am working") sleep(0.5) m.move(100, 0, 0) print("I am so busy") sleep(0.5) m.move(0, -100, 0) print("So much to do") sleep(0.5) m.move(0, 100, 0) print("I need a vacation") sleep(0.5)
11. Create another conditional statement to check that the button has been pressed and that active and button_press store the value 1. This means that the user wants to turn off the jiggler code.
elif button.value == False and active == 1 and button_press == 1:
12. Print a message to the user, then reset the values stored in the variables before pausing for five seconds.
print("Turning off") active = 0 button_press = 0 sleep(5)
13. Save the project as code.py to the Raspberry Pi Pico and the board will reset and run the code. Press the button to toggle the jiggler code on and off.
Complete Code Listing
import usb_hidfrom adafruit_hid.mouse import Mousefrom time import sleepimport boardfrom digitalio import DigitalInOut, Direction, Pullm = Mouse(usb_hid.devices)button = DigitalInOut(board.BUTTON)button.direction = Direction.INPUTbutton.pull = Pull.UPactive = 0button_press = 0while True: if button.value == False and active == 0: active = 1 button_press = 1 print("Turning on") sleep(5) elif button.value == True and active == 1 and button_press == 1: m.move(-100, 0, 0) print("I am working") sleep(0.5) m.move(100, 0, 0) print("I am so busy") sleep(0.5) m.move(0, -100, 0) print("So much to do") sleep(0.5) m.move(0, 100, 0) print("I need a vacation") sleep(0.5) elif button.value == False and active == 1 and button_press == 1: print("Turning off") active = 0 button_press = 0 sleep(5)
Special Adafruit Trinket QT2040 Version
Adafruit’s Trinkey QT2040 is a USB dongle shaped board powered by Raspberry Pi’s RP2040. It doesn’t have a traditional GPIO per se, rather it uses a StemmaQT connector for use with compatible breakout boards.
This special version of the button toggle code uses the boards built in user button (BOOT) to toggle the code on / off and the NeoPixel to denote the if the jiggler is active. The code is largely the same as the previous button toggle code, just altered to use the button reference (a CircuitPython abstraction) and to setup NeoPixels.
1. Download the bundle of libraries for the same version of CircuitPython as installed on the Pico. We installed CircuitPython 8 so downloaded the bundle for version 8.x.
2. Extract the bundle to your desktop and then open the lib folder contained within.
3. Copy the following files / folders from this lib folder to the lib folder on the CIRCUITPY drive.
adafruit_hid
adafruit_pixelbuf.mpy
neopixel.mpy
4. Open a new file in Thonny and copy the code from the previous example.
5. In the imports add a line to import the NeoPixel library.
import neopixel
6. After setting up the button, add a new line to create a connection to the single NeoPixel on the Trinkey QT2040.
pixel = neopixel.NeoPixel(board.NEOPIXEL, 1)
7. Scroll down to the else if condition that toggles the jiggler on. This is where we press the button, and the active and button_press variables are set to 1. Add a line to set the pixel to red, at one quarter brightness.
pixel.fill((32, 0, 0))
8. Scroll down to where the jiggler code is toggled off. This is where the button is pressed, and the active and button_press variables are set to 1. Change the color of the NeoPixel to green, with one quarter brightness.
pixel.fill((0, 32, 0))
9. Save the code as code.py to the Adafruit Trinkey QT2040. The board will reset and the code will start. Press the button to toggle the code.
Complete Code Listing
import usb_hidfrom adafruit_hid.mouse import Mousefrom time import sleepimport boardfrom digitalio import DigitalInOut, Direction, Pullimport neopixelm = Mouse(usb_hid.devices)button = DigitalInOut(board.BUTTON)button.direction = Direction.INPUTbutton.pull = Pull.UPpixel = neopixel.NeoPixel(board.NEOPIXEL, 1)active = 0button_press = 0while True: if button.value == False and active == 0: active = 1 button_press = 1 print("Turning on") sleep(5) elif button.value == True and active == 1 and button_press == 1: pixel.fill((32, 0, 0)) m.move(-100, 0, 0) print("I am working") sleep(0.5) m.move(100, 0, 0) print("I am so busy") sleep(0.5) m.move(0, -100, 0) print("So much to do") sleep(0.5) m.move(0, 100, 0) print("I need a vacation") sleep(0.5) elif button.value == False and active == 1 and button_press == 1: pixel.fill((0, 32, 0)) print("Turning off") active = 0 button_press = 0 sleep(5)
Be In the Know
Get instant access to breaking news, in-depth reviews and helpful tips.
Les Pounder
Les Pounder is an associate editor at Tom's Hardware. He is a creative technologist and for seven years has created projects to educate and inspire minds both young and old. He has worked with the Raspberry Pi Foundation to write and deliver their teacher training program "Picademy".
Topics
Raspberry Pi Pico
2 CommentsComment from the forums
punkncat It is an interesting counter-position for a site that doesn't allow things such as password questions or help with cracked software to turn around and offer a tech advice column on how to fraudulently seem as if you are working.
Shame, really....
Reply
GLT1963 mmhh.. so this is because they don't let you install software at work? and part of the solution involves installing software? i must admit that i do cobol and rpgii/iii ports to c on ibm and fujitsu systems so i have only rudimentary knowledge of python but my logic does just fine regardless. also, i don't know about the rest of the world, but all of our clients who control software installation on their windows or mac pcs have usb port blockers and only ever allow running of specific whitelisted apps. so absolutely no part of the above would work at all even if no installation was required. that's before working through remote desktop comes in the picture, as several of our clients do. a waste of an article
Reply
FAQs
Can your IT department detect a mouse jiggler? ›
Jigglers and movers are generally hard to detect unless you are using a work computer, which can be monitoring for extra peripherals or additional software. That's why some people prefer the dock-style mouse jigglers that can be plugged into a separate power source.
Can I make a computer with Raspberry Pi Pico? ›It's no secret that the Raspberry Pi can emulate a number of devices, and the Raspberry Pi Pico is no exception. In his latest project, Eric Badger demonstrates the Pico's ability to emulate a 6502 computer and shows a side-by-side comparison of the Pico running next to an Apple II computer.
Is a mouse jiggler worth it? ›A mouse jiggler will keep the screen awake while you go back to your toolbox for the tenth time. Similarly, a mouse jiggler can be useful when you're using some video software. It will keep your screen awake so your screen saver doesn't come on in the middle of your movie.
What do you need for a Raspberry Pi Pico? ›- A Raspberry Pi Pico🗗 (or Pico W🗗)
- A USB cable🗗 - you'll need a microB USB cable to plug your Pico into your computer to be able to program it. ...
- Header pins🗗 - to be able to plug your Pico into our Packs and Bases (or a breadboard) it will need to be equipped with header pins.
Any keyboard and mouse activity can be tracked to see when you're active and when you've stepped away. What's going on in your workspace. Depending on your employee agreement, bosses can also have access to your webcam.
How do I make my mouse move constantly? ›Step 1: Put a Cup Upside Down...
Now balance the mouse so the sensor is hitting the corner of the cup. When it's right the mouse will keep the bright LED for moving on instead of stopping after a few seconds.
The short answer is no. The GPIO pins of the Raspberry Pi Pico cannot deliver the current needed for a DC motor and, if we were to try, there is a good chance that we would damage the Pico. Instead we need a motor controller that acts as a bridge between the Pico and our motor.
What can be done with the Raspberry Pi Pico? ›A Raspberry Pi Pico has GPIO pins, much like a Raspberry Pi computer, which means it can be used to control and receive input from a variety of electronic devices. The new Introduction to Raspberry Pi Pico path uses the picozero package to engage in some creative physical computing projects.
How much RAM does Raspberry Pi Pico have? ›The Raspberry Pi Pico is a microcontroller with an RP2040 chip featuring 2 x ARM Cortex-M0+ cores clocked at 133MHz; 256KB RAM; 2 MB of onboard Flash, 30 GPIO pins; and a range of interfacing options.
What can I use instead of a mouse jiggler? ›There are eight alternatives to Mouse Jiggler for Android, Windows, Mac and F-Droid. The best alternative is Caffeine for Windows, which is free. Other great apps like Mouse Jiggler are KeepOn, Lungo, Keep Screen On and No Sleep.
How does a USB mouse jiggler work? ›
They work by using a full rotating platform or rotating disc underneath the mouse. The movement is subtle but enough to move the user's cursor on their screen. Software driven mouse movers install a program on the user's machine that also moves the mouse cursor across the screen.
Why would someone use a mouse jiggler? ›So what does mouse jiggler do? As the name indicates, is used to simulate mouse movement, preventing your computer from going into sleep mode. Though the mouse jiggler may not help with keyboard usage or clicks, it is capable of tricking the screen time monitoring.
Can Raspberry Pi Pico run independently? ›It's a different type of device, which you can use with or independent of a Pi.
Is Raspberry Pi Pico powerful? ›The Raspberry Pi Pico is powerful enough to cover many basic to intermediate maker projects. Projects that would traditionally be powered by Raspberry Pi Zero, such as robotics and Wi-Fi data collection devices. To do this with the Raspberry Pi Pico we need a few extra components.
Can I use Raspberry Pi Pico without soldering? ›It comes with a Pico Female Header, allowing you to attach it to your Pico without Soldering. 2.54mm spacing between holes for attachment to your Pico. Compatible with Raspberry Pi Pico.
Can my boss watch me on camera all day? ›Generally, it's legal for your employer to use video cameras in the workplace. No federal or state law absolutely prohibits the practice, and there are many reasons why cameras can be beneficial, such as monitoring the security of employees and customers.
How to tell if your computer is being monitored at work 2022? ›- Your webcam is recording without your authorization. ...
- Your task manager or activity monitor is disabled. ...
- Your computer becomes slow. ...
- Your browser often gets redirected. ...
- Your computer heats up frequently.
Another, potentially simpler option is to purchase a mouse mover, or mouse jiggler, which physically sits underneath your mouse and uses a spinning disk to trick the mouse's optical sensor into thinking it's moving around.
Is there some device that can keep moving the mouse? ›Mouse jigglers, or mouse movers, simulate cursor movement, preventing your computer from going into sleep mode.
How do I stop ghost mouse? ›GhostMouse will loop continuously until it is stopped with the Stop button or with CTRL-ALT.
Is there a mouse that moves on its own? ›
...
Item model number | F4 |
---|---|
Size | Small |
The PIco Long Life Battery is a LiPO battery specially designed for the UPS PIco, that easily upgrade to the extended capacity of 3000mAh version, which enables prolonged use of a Raspberry Pi for up to 8 hours without a power supply connected!
Does Raspberry Pi Pico have PWM? ›PWM performance on the Raspberry Pi Pico
The microprocessor doesn't generate PWM signals permanently but uses dedicated hardware blocks. You only need to configure the PWM blocks once in the script to permanently create the signal in the background. We associate the output of a PWM block with a pin of our board.
Until the Pico, Raspberry Pis were fully fledged single-board computers capable of running an operating system. The diminutive Pico is designed to interface with and control physical, real-world projects.
Can Raspberry Pi Pico run on battery? ›The Raspberry Pi Pico requires a power supply capable of delivering a minimum of 1.8 volts and a maximum of 5.5V. A battery pack with a USB to micro-USB cable can also power a Raspberry Pi Pico. This battery pack provides up to 2.1A of current at 5V.
Can Pi Pico connect to Wi-Fi? ›Make the most of the Raspberry Pi Pico W's wireless capability by getting it to connect to your Wi-Fi network.
How many volts does a Raspberry Pi Pico need? ›If you want to run your Raspberry Pi Pico without it being attached to a computer, you need to use a USB power supply. Safe operating voltages are between 1.8V and 5.5V.
Is 64GB enough for Raspberry Pi? ›You can use a 64GB SD card, but there’s a catch. Using a 64GB SD card requires formatting with the exFAT filesystem. According to Raspberry Pi’s official formatting instructions, Raspberry Pi’s bootloader only has support for reading from FAT16 or FAT32 filesystems.
Is 16GB SD card enough for Raspberry Pi? ›When thinking of smartphones with expandable memory, 16GB doesn't seem like a lot of space. However, it is plenty big enough for use in your Raspberry Pi. If you are planning on using your Pi for only one application, then the SanDisk 16GB Ultra microSD is a great choice.
Is there going to be a Raspberry Pi 5? ›In theory, the Raspberry Pi 5 could appear at any point in 2023. However, this is unlikely. Recent reports suggest the Raspberry Pi 5's release date won't be until 2024.
Will a mouse jiggler keep Teams active? ›
It is often called mouse mover or jiggle mouse. It can be used as an auto mouse mover, mouse shaker, jiggle mouse & mouse jiggler download for windows. Keeps Microsoft Teams status active.
How do you move a mouse with no hands? ›- Lip/chin joysticks: this is a hardware device that allows you to move the mouse cursor and control mouse buttons with your chin or lips. ...
- Wearable sensors: with this approach, you wear a sensor (usually on your head), and as you move, the motion of that sensor controls the mouse cursor.
Move Mouse is a utility tool that simulates activity on your computer. With its help, you can keep your PC in an active state, even when you're not around.
What is Zen jiggle? ›The 'Zen jiggle?' checkbox enables a mode in which the pointer is jiggled 'virtually' - the system believes it to be moving and thus screen saver activation, etc., is prevented, but the pointer does not actually move.
How do I make my computer look active? ›Go to Control Panel > Personalization > Change Screensaver. Next to On Resume, Display Logon Screen, uncheck the box. This prevents your system from sleeping.
How do you set up a mouse jiggler? ›Installation
Plug the Mouse Jiggler into your computer's USB port. That's it! The Mouse Jiggler prevents your computer from going to sleep or displaying the screen saver by automatically moving the mouse pointer. You can continue to use your computer while Mouse Jiggler is plugged in and working in the background.
PWM Pins Raspberry Pi Pico
The RP2040 PWM block has 8 identical PWM slices, each with two output channels (A/B), where the B pin can also be used as an input for frequency and duty cycle measurement. That means each slice can drive two PWM output signals, or measure the frequency or duty cycle of an input signal.
This is a simple DIY Digital clock with RTC DS1307 and Raspberry Pi PICO. You might have build a digital clock using Arduino, RTC and coded it with embedded C. In this project we will be using micro python and electronics. People who have the basic knowledge of python and electronics can build this project easily.
Can a Raspberry Pi Pico run a discord bot? ›Looking for a cheap way to host your Discord Bot, why not use a Raspberry Pi. This article provides step by step instructions for creating your first Discord Bot and running on the Raspberry Pi.
Can your workplace tracking your computer activities? ›There are numerous ways employers can track workers' productivity. If you are using a work laptop or are connected to your company's virtual private network, your employer has the ability to monitor nearly everything you do.
Can you tell if work is monitoring your computer? ›
If you're on Windows 10, press the Alt + Ctrl + Del keys and open the Task Manager. Click on the Processes tab and check if there any known employee monitoring software running in the background. If you use a MacBook, navigate to Utilities, and launch the Activity Monitor.
Do companies have to tell you if they are tracking your computer? ›EPCA also says that employers don't need to inform employees of monitoring or gain their consent. While there is no federal law requiring information or consent of surveillance technology, however, several states do mandate it.