Joystick Controlled PC Mouse Using Arduino UNO

by prabeenraj01 in Circuits > Arduino

2574 Views, 1 Favorites, 0 Comments

Joystick Controlled PC Mouse Using Arduino UNO

snapshot59.png

In This Tutorial We are going to see how to make joystick controlled pc mouse by using Arduino Uno

Required Components:

IMG_20210925_135238_1_BEAUTY.jpg
IMG_20210925_135329_1_BEAUTY.jpg
DEBUG_IMG_20210925_135754_BEAUTY.jpg
DEBUG_IMG_20210925_135502_BEAUTY.jpg
IMG_20210925_135545_1_BEAUTY.jpg

For this we need arduino board (*You Can Use Any Arduino Board)

joystick Module

Potentiometer (If you don't have joystick Module)

Push Buttons

few jumper (male to female)

Circuit Connection

For Non Joystick Circuit.png
Joystick Module.png

1) First make the circuit as per the schematics

if you don't have joystick use the circuit that have potentionmeter

Connection For joystick Module to Arduino

Joystick Module Arduino Code

GND GND

Vcc 5V

VRx A0

VRy A1

Sw D8

Connection For Potentiometer to Arduino

  1. Connect the two potentiometer 3rd pin to 5v of Arduino
  2. Connect the two potentiometer 1st pin to GND of Arduino
  3. Connect one potentiometer center pin that is (wiper) to Analog Pin A0 in Arduino
  4. Connect another potentiometer center pin to Analog Pin A1 in Arduino
  5. Connect the push button to Digital Pin D8 (for using as left click of mouse)

Upload Arduino Code

port and board type.png

Program LINK

First Upload the Arduino Code To your microcontroller

Before uploading check the port number and board type

Execute Python Code

package.png
ser.png

Program LINKNow Run the python script . This script make the serial communication with arduino

Before executing the program

Install the Required modules Like Pyserial and Pyautogui

pip command for pyserial : pip install pyserial
pip command for pyautogui : pip install PyAutoGUI

Run this above command in Terminal By run as adminstrator mode

And Don't forgot to enter your arduino port number

Now Run the code

Final Output

Joystick Controller PC Mouse Using Arduino UNO