The joystick module in an electronic system is the same as the analogue joystick found in the gamepad. It is an affordable solution for Arduino-based DIY projects and robot control etc. The joystick module is constructed by mounting two potentiometers at a 90-degree angle and hence can be used to sense movements in X & Y direction. These potentiometers are connected to short sticks centred by springs, and thus generating an output of around 2.5v from x and y when in a resting position. The output varies from 0V to 5 v when the joystick moves. When the joystick is connected to a microcontroller a value of 512 is expected in the resting position and when the joystick moves value varies from 0 to 1023. The joystick offers a wide range of applications such as for controlling outputs such as a melody or pixels on a screen. And also used for navigation or game control.
In this Joystick Module, the position coordinates measurement on the X and Y axis is performed by moving the “hat”. The hat is the inbuilt switch activated by pressing the stick. The X and Y axes were designed with two 10k potentiometers to control 2D movement by generating analogue signals. The two potentiometers on the joystick connect to analogue pins A0 and A1 on your microcontroller. When the module is in working mode, it will output two analogue values, Y-axis movement of the joystick produces a proportional analogue voltage on analogue pin 0. Similarly, the horizontal movement of the joystick can be tracked on analogue pin 1.
- And: Ground terminal of Module
- +5v: Positive supply terminal of Module
- VRx: Voltage Proportional to X-axis
- VRy: Voltage Proportional to Y-axis
- SW: Switch