How a two-axis analog joystick works: two potentiometers for X and Y plus a push switch, its pinout, and where joysticks are used from games to surgical robots.
Embedded Systems · 9 August 2023 · 1 min read · Updated 11 August 2023
What is a joystick?
A joystick is an input device used to control the X and Y dimensions of any control system it is applied to. It varies the values of two potentiometers, which control the X and Y axes respectively, with a switch underneath.
Pinout
Ground (GND): common ground connection for the other pins.
Power (VCC): power to the joystick, typically 5 volts.
X-axis: an analog signal corresponding to the horizontal position. On some modules this is labelled “VRX” or “AN0”.
Y-axis: an analog signal corresponding to the vertical position. On some modules this is labelled “VRY” or “AN1”.
Button: some joysticks add a pin for the push switch or other features.
Applications
Video games: flight simulators, racing games, and arcade-style games.
Robotics: controlling robots such as remote-controlled drones or robotic arms.
Pan/tilt applications: controlling cameras, cranes, or heavy machinery.
AR/VR: input devices for virtual reality systems.
Surgical robots: controlling medical equipment and prosthetics.
Accessibility: input devices for individuals with disabilities to control computers and electronics.
Simulator controls: flight and driving simulators for a more immersive experience.