top of page

Interfacing analog joystick with Arduino

Updated: May 16

In this project, you will learn to interface an analog joystick with Arduino.


Hardware components - analog joystick with Arduino


1. Arduino Uno:

#ArduinoUno board is used for interfacing the input-output elements to construct a project. It is an open-source microcontroller board that can be programmed according to user requirements. "(analog joystick with Arduino)


Arduino Uno
Arduino Uno

2. Joystick:

A joystick is an input device used to communicate 2D motion to the device which is being controlled. In a joystick, two independent potentiometers are positioned perpendicular to each other, and the change in the resistances is calculated to record the joystick's position.


Joystick Module
Joystick Module


Pin diagram of a joystick module
Pin diagram of a joystick module


3. Jumper Wires:

Jumper wires have connectors and pins that are used to connect different components.


Jumper wires
Jumper Wires


Circuit Connections:


Circuit Diagram
Circuit Diagram

  1. Connect the ground of the joystick to the ground of the Arduino.

  2. Connect the 5V of the Joystick to the 5V of the Arduino.

  3. Connect the VRx pin to the A0 of the Arduino.

  4. Connect the VRy pin to the A1 of the Arduino.

  5. Connect the SW (Switch) pin of the joystick to D13 of the Arduino.


Code:




  • Declare the pins of the Arduino connected to the joystick.

  • In void setup(), set the pin mode for the SW pin. Using digitalWrite() function, set the SW pin to high.

  • Start the serial monitor output with a 9600 baud rate.

  • In void loop(), using digitalRead() and analogRead() functions, read the values of the digital and analog pins of the joystick and print them.


Working:

When the pivot of the joystick is moved, there will be a change in the resistances of the independent potentiometers. The position of the joystick is determined by processing these changed resistances by the Arduino.


Working of an analog joystick.
Working of an analog joystick.

Video by- Anupama Koley


Written by-

Name- Nagashree R Nadig


See also-


Controlling stepper motor with Joystick Sensor and Arduino


Controlling stepper motor with Joystick Sensor and Arduino

Follow us -


Please do follow us i.e #learnelectronicsindia to get daily updates about new blogs, videos, courses, quizzes, and contests.



Want us to help you with the projects, write your inquiry here - Order Projects


Check out our Free Arduino Projects Playlist - Arduino Projects

Check out our Free Raspberry Pi Projects Playlist - Raspberry Pi Projects

Check out our Free TinkerCAD Projects Playlist - TinkerCAD Projects

Check out our Free IoT Projects Playlist - IoT Projects

Check out our Free Home Automation Projects Playlist - Home Automation Projects

Check out our Free NodeMCu Projects Playlist - NodeMCu Projects

99 views2 comments

Related Posts

See All

2 Comments


Informative and concise! LearnElectronics India always delivers quality content.

Like

Anushka Gupta
Anushka Gupta
Jul 19, 2023

Learn Electronics India has done an exceptional job with this blog on interfacing analog joysticks with Arduino. The article not only covers the basics but also dives into advanced techniques, making it suitable for beginners and experienced enthusiasts alike. I'm grateful for the wealth of knowledge shared here, and I look forward to exploring more of their content.

Like
bottom of page