Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use Analog Joystick (Wokwi Compatible): Examples, Pinouts, and Specs

Image of Analog Joystick (Wokwi Compatible)
Cirkit Designer LogoDesign with Analog Joystick (Wokwi Compatible) in Cirkit Designer

Introduction

The Analog Joystick is a two-axis input device that allows for directional control and variable resistance. It is commonly used in gaming controllers, robotics, and other applications requiring precise navigation or movement. The joystick features two potentiometers for the X and Y axes and a push-button for additional input functionality. Its compatibility with platforms like Wokwi and Arduino makes it a versatile and beginner-friendly component for prototyping and development.

Explore Projects Built with Analog Joystick (Wokwi Compatible)

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
ESP32-Based Dual Joystick Controller with Wi-Fi Connectivity
Image of new_project: A project utilizing Analog Joystick (Wokwi Compatible) in a practical application
This circuit features an ESP32 microcontroller interfaced with two analog joysticks. The joysticks provide analog input to the ESP32, allowing it to read horizontal and vertical positions as well as the select button state from each joystick.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO-Based Analog Joystick Interface
Image of Joystick: A project utilizing Analog Joystick (Wokwi Compatible) in a practical application
This circuit consists of an Arduino UNO microcontroller connected to an analog joystick. The joystick's vertical and horizontal movements are read by the Arduino's analog pins A0 and A1, respectively. The embedded code on the Arduino reads these analog values and outputs the joystick's position to the serial monitor.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO Based Analog Joystick Interface
Image of PILAPIL_JOYSTICK: A project utilizing Analog Joystick (Wokwi Compatible) in a practical application
This circuit consists of an Arduino UNO microcontroller connected to an analog joystick. The joystick's vertical and horizontal movements are read by the Arduino through analog pins A0 and A1, respectively. The microcontroller is programmed to read these analog values and output the joystick's position to the serial monitor.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino Nano Joystick-Controlled Bluetooth Module with Battery Power
Image of padelpro transmitter: A project utilizing Analog Joystick (Wokwi Compatible) in a practical application
This circuit is a wireless joystick controller that uses an Arduino Nano to read analog signals from a KY-023 Dual Axis Joystick Module and transmits the data via an HC-05 Bluetooth Module. The system is powered by a 18650 Li-Ion battery with a rocker switch for power control.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with Analog Joystick (Wokwi Compatible)

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of new_project: A project utilizing Analog Joystick (Wokwi Compatible) in a practical application
ESP32-Based Dual Joystick Controller with Wi-Fi Connectivity
This circuit features an ESP32 microcontroller interfaced with two analog joysticks. The joysticks provide analog input to the ESP32, allowing it to read horizontal and vertical positions as well as the select button state from each joystick.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Joystick: A project utilizing Analog Joystick (Wokwi Compatible) in a practical application
Arduino UNO-Based Analog Joystick Interface
This circuit consists of an Arduino UNO microcontroller connected to an analog joystick. The joystick's vertical and horizontal movements are read by the Arduino's analog pins A0 and A1, respectively. The embedded code on the Arduino reads these analog values and outputs the joystick's position to the serial monitor.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of PILAPIL_JOYSTICK: A project utilizing Analog Joystick (Wokwi Compatible) in a practical application
Arduino UNO Based Analog Joystick Interface
This circuit consists of an Arduino UNO microcontroller connected to an analog joystick. The joystick's vertical and horizontal movements are read by the Arduino through analog pins A0 and A1, respectively. The microcontroller is programmed to read these analog values and output the joystick's position to the serial monitor.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of padelpro transmitter: A project utilizing Analog Joystick (Wokwi Compatible) in a practical application
Arduino Nano Joystick-Controlled Bluetooth Module with Battery Power
This circuit is a wireless joystick controller that uses an Arduino Nano to read analog signals from a KY-023 Dual Axis Joystick Module and transmits the data via an HC-05 Bluetooth Module. The system is powered by a 18650 Li-Ion battery with a rocker switch for power control.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications

  • Gaming controllers for directional input
  • Robotic navigation and control
  • Camera gimbal control
  • DIY remote-controlled vehicles
  • User interface navigation in embedded systems

Technical Specifications

The Analog Joystick consists of two potentiometers (for X and Y axes) and a tactile push-button. Below are the key technical details:

Parameter Specification
Operating Voltage 3.3V - 5V
X-Axis Output Range 0V - Vcc (Analog Output)
Y-Axis Output Range 0V - Vcc (Analog Output)
Button Output Digital (Active Low)
Dimensions 40mm x 26mm x 32mm
Interface Analog (X, Y), Digital (Button)

Pin Configuration

The joystick typically has 5 pins. Below is the pinout description:

Pin Name Description
1 GND Ground connection
2 +Vcc Power supply (3.3V or 5V)
3 VRx X-axis analog output (connect to an ADC pin)
4 VRy Y-axis analog output (connect to an ADC pin)
5 SW Push-button digital output (active low)

Usage Instructions

Connecting the Joystick

  1. Power Supply: Connect the +Vcc pin to a 3.3V or 5V power source and the GND pin to ground.
  2. X and Y Axes: Connect the VRx and VRy pins to analog input pins on your microcontroller (e.g., Arduino).
  3. Push-Button: Connect the SW pin to a digital input pin on your microcontroller. Use a pull-up resistor if necessary.

Example Circuit with Arduino UNO

Below is an example of how to connect the joystick to an Arduino UNO:

  • +Vcc → 5V
  • GND → GND
  • VRx → A0
  • VRy → A1
  • SW → D2

Sample Arduino Code

The following code reads the X and Y axis values and detects button presses:

// Define pin connections
const int VRxPin = A0; // X-axis analog pin
const int VRyPin = A1; // Y-axis analog pin
const int SWPin = 2;   // Push-button digital pin

void setup() {
  // Initialize serial communication for debugging
  Serial.begin(9600);

  // Configure the button pin as input with internal pull-up resistor
  pinMode(SWPin, INPUT_PULLUP);
}

void loop() {
  // Read X and Y axis values (0-1023 for 10-bit ADC)
  int xValue = analogRead(VRxPin);
  int yValue = analogRead(VRyPin);

  // Read the button state (LOW when pressed)
  bool buttonPressed = digitalRead(SWPin) == LOW;

  // Print the values to the Serial Monitor
  Serial.print("X: ");
  Serial.print(xValue);
  Serial.print(" | Y: ");
  Serial.print(yValue);
  Serial.print(" | Button: ");
  Serial.println(buttonPressed ? "Pressed" : "Released");

  // Add a small delay for stability
  delay(100);
}

Best Practices

  • Use a stable power supply to avoid noise in the analog readings.
  • Calibrate the joystick's center position (typically around 512 for a 10-bit ADC).
  • Debounce the push-button in software if it is used for critical input.

Troubleshooting and FAQs

Common Issues

  1. No Output or Incorrect Readings

    • Cause: Loose or incorrect wiring.
    • Solution: Double-check all connections and ensure the joystick is powered correctly.
  2. Analog Values Fluctuate

    • Cause: Electrical noise or unstable power supply.
    • Solution: Use decoupling capacitors near the power pins or a regulated power source.
  3. Button Not Detected

    • Cause: Missing pull-up resistor or incorrect pin configuration.
    • Solution: Enable the internal pull-up resistor in your microcontroller or add an external one.

FAQs

Q: Can I use the joystick with a 3.3V microcontroller?
A: Yes, the joystick is compatible with both 3.3V and 5V systems.

Q: How do I calibrate the joystick?
A: Read the X and Y axis values when the joystick is at rest. Use these values as the center point in your code.

Q: Is the push-button necessary for operation?
A: No, the push-button is optional and can be left unconnected if not needed.

Q: Can I use this joystick with platforms like Wokwi?
A: Yes, the joystick is fully compatible with Wokwi for virtual prototyping and simulation.