+1 500 000 products in offer

6000 packages per day

+300 000 clients from 150 countries

Quick Buy Favourites
Cart

DIY computer mouse

Date of publication: 13-11-2025 🕒 5 min read

In this project, you will turn Arduino UNO R4 WiFi into a working PC mouse. This is a fun way to learn how devices like keyboards and mice, called Human Interface Devices (HIDs), work.

Using parts from the Plug and Make Kit, you’ll be able to control the mouse on your computer screen by tilting and pressing buttons.

1. Introduction

A Human Interface Device (HID) is something like a keyboard, mouse, or game controller that lets you interact with your computer. In this project, you will use your Arduino UNO R4 WiFi to act as a PC mouse. Instead of using the USB cable just for programming the Arduino, it will also act as a connection between the Arduino and your computer to control the mouse. All the parts you need are included in the Plug and Make Kit, so everything is ready for you to start right away.

2. What you will learn

  • How to add buttons to a project.
  • How to make your Arduino work like a mouse.
  • How to control the mouse movement using a motion sensor called an accelerometer.

3. Parts you will use

All the parts for this project are included in the Plug and Make Kit:

  • Arduino UNO R4 WiFi: the main board that will control everything.
  • Modulino Movement: a sensor that will track how you tilt or move your mouse.
  • Modulino Buttons: these will act as the mouse buttons.
  • Qwiic cables: cables to connect everything together.
  • USB cable: connects the Arduino to your computer.

4. Setting up the workspace

First, connect the Modulino Buttons to your Arduino UNO R4 WiFi using the Qwiic cables. The buttons will be used to click like a regular mouse. Make sure the cables are tightly connected.

Then, you will need to load a code template from the Arduino Cloud, which will help you control the buttons.

Here is the link: https://app.arduino.cc/templates/game-controller

After setting it up, you can see how many times each button is pressed on the Arduino Cloud dashboard.

This is helpful to check if the buttons are working properly.

5. Adding mouse movement with the accelerometer

Now comes the exciting part - making the mouse move when you tilt the Modulino Movement sensor! Modulino Movement contains an accelerometer, which detects motion. This sensor will allow you to control the movement of the mouse on your computer screen by tilting the Arduino board.

Connect the Modulino Movement sensor to the Arduino UNO R4 WiFi using the Qwiic cable. Once connected, add the code for mouse movement to your project. The accelerometer in the Modulino Movement sensor will detect how much you tilt the board in two directions: left-right and up-down, and these tilts will control the movement of the mouse on your screen. In the code, there is a variable called “sensitivity” that determines how fast the mouse moves based on the tilt of the sensor. A higher number means the mouse will move faster. You can start with a value of 50 and adjust it to suit your preference for the mouse speed.

When the Arduino is connected and the code is running, the Modulino Movement sensor will measure your tilts.

If you tilt the board to the left, the mouse will move left; if you tilt it to the right, the mouse will move right. Tilting the board forward or backward will move the mouse up and down.

After uploading the code to the Arduino, test the movement by tilting the Modulino Movement sensor in different directions to observe how the mouse responds. You can continue adjusting the sensitivity in the code until the mouse moves at a comfortable speed for you.

6. Testing and fine-tuning

Once you have everything set up, it’s time to test your new PC mouse! Move the board around and press the buttons to see how it works. If the mouse is too slow or too fast, you can easily go back to the code and adjust the sensitivity.

If you want to make the mouse click in a different way or change the button functions, you can modify the code to fit your needs.

7. Conclusion

By following these steps, you’ve built your own PC mouse using Arduino UNO R4 WiFi and parts from the Plug and Make Kit. Not only did you learn how to make your own mouse, but you also gained valuable skills in working with sensors and programming.

This project shows how versatile Arduino is and opens up endless possibilities for other fun DIY projects.

Now you can enjoy using your homemade mouse or try customizing it further!

Transfer Multisort Elektronik (TME) is one of the world’s largest global distributors of electronic components, electrotechnical parts, workshop equipment, and industrial automation. The catalog includes over 1,500,000 products from 1,300 leading manufacturers. TME’s modern logistics centers in Łódź and Rzgów (Poland), with a combined area of over 40,000 m², ship nearly 6,000 packages daily to customers in more than 150 countries.

TME also invests in the development of knowledge and skills of young engineers and electronics enthusiasts through the TME Education project, and supports the tech community by organizing the TechMasterEvent series, promoting innovation and experience exchange.

Download
If you would like to use the article, please cite TME as the source and add a link to the original text when republishing it online.

READ ALSO