Ordered on weekdays before 14:00 = shipped the same day and delivered the next day in 98% of cases. Free returns 30-day reflection period 1-year warranty

Wiring diagram and code example

How to connect the Joystick module to an Arduino UNO or ESP32, with an example sketch you can upload straight away.

Dual-Axis Joystick Module with Pushbutton

This example reads the analog X and Y axis positions along with the integrated pushbutton from the joystick module. Move the stick or press down on it to view real-time position values and button state in the Serial Monitor.

Wiring diagram: Joystick module on an Arduino UNO
Wiring diagram · Click to enlarge
Connection table: Joystick module on an Arduino UNO
Connection table · Click to enlarge
Dual_Axis_Joystick_Module_with_Pushbutto.ino · compiled and verified
/*
 * ==================================================================
 *  Generated by Codey.online  —  https://www.codey.online
 * ==================================================================
 *  Project   : Dual-Axis Joystick Module with Pushbutton
 *  Board     : Arduino UNO (arduino:avr:uno)
 *  Parts     : Joystick module
 *  Libraries : none (built-in)
 *
 *  Codey Online is an AI-powered browser IDE for Arduino and ESP32.
 *  Describe your project and Codey writes the code, draws the wiring
 *  diagram and uploads it to your board, straight from the browser.
 *  This code is free to use, modify and share, without warranty.
 * ==================================================================
 */

// Pin definitions
const int PIN_X = A0;
const int PIN_Y = A1;
const int PIN_SW = 2;

void setup() {
  // Enable internal pull-up resistor for the integrated pushbutton
  pinMode(PIN_SW, INPUT_PULLUP);
  
  Serial.begin(115200);
  Serial.println(F("Joystick Module Demo"));
  Serial.println(F("--------------------"));
}

void loop() {
  // Read analog values for X and Y axes (range: 0 - 1023)
  int xVal = analogRead(PIN_X);
  int yVal = analogRead(PIN_Y);
  
  // Button is active-low (reads LOW when pressed)
  bool isPressed = (digitalRead(PIN_SW) == LOW);

  // Print the results to Serial Monitor
  Serial.print(F("X: "));
  Serial.print(xVal);
  Serial.print(F(" | Y: "));
  Serial.print(yVal);
  Serial.print(F(" | Button: "));
  Serial.println(isPressed ? F("PRESSED") : F("RELEASED"));

  delay(150);
}

Wiring diagram and example code generated by Codey.online — https://www.codey.online

ESP32 Analog Joystick Module Demo

This project reads the X and Y positions as well as the integrated pushbutton state from a dual-axis analog joystick module. The ESP32 reads analog voltages via GPIO 34 and 35, and the button state via GPIO 32. Open the Serial Monitor at 115200 baud to see real-time joystick coordinates and button presses.

Wiring diagram: Joystick module on an ESP32 DevKit V1
Wiring diagram · Click to enlarge
Connection table: Joystick module on an ESP32 DevKit V1
Connection table · Click to enlarge
ESP32_Analog_Joystick_Module_Demo.ino · compiled and verified
/*
 * ==================================================================
 *  Generated by Codey.online  —  https://www.codey.online
 * ==================================================================
 *  Project   : ESP32 Analog Joystick Module Demo
 *  Board     : ESP32 DEVKIT V1 (esp32:esp32:esp32doit-devkit-v1)
 *  Parts     : Joystick module
 *  Libraries : none (built-in)
 *
 *  Codey Online is an AI-powered browser IDE for Arduino and ESP32.
 *  Describe your project and Codey writes the code, draws the wiring
 *  diagram and uploads it to your board, straight from the browser.
 *  This code is free to use, modify and share, without warranty.
 * ==================================================================
 */

// Pin definitions (using bare GPIO numbers for ESP32)
const int pinVRX = 34;
const int pinVRY = 35;
const int pinSW  = 32;

void setup() {
  Serial.begin(115200);
  
  // Configure push-button pin with internal pull-up
  pinMode(pinSW, INPUT_PULLUP);
}

void loop() {
  // Read analog values from joystick potentiometers (0 - 4095 on ESP32)
  int xVal = analogRead(pinVRX);
  int yVal = analogRead(pinVRY);
  
  // Read digital state of the integrated switch (LOW when pressed)
  bool isPressed = (digitalRead(pinSW) == LOW);

  // Print the readings to the Serial Monitor
  Serial.print("X: ");
  Serial.print(xVal);
  Serial.print(" | Y: ");
  Serial.print(yVal);
  Serial.print(" | Button: ");
  Serial.println(isPressed ? "PRESSED" : "RELEASED");

  delay(100);
}

Wiring diagram and example code generated by Codey.online — https://www.codey.online

Joystick module

With this board, the X and Y position of the joystick can be output as analog voltage on the output pins. Suitable for, among others, Arduino, Raspberry Pi, ESP8266 or ESP32 projects.

view the Wiring diagram and example code >>> here

The module can be soldered or used on a breadboard.

Voltage range: 0 - 5 V
Operating voltage: 3.3 - 5V
Dimensions: 34 x 39 x 26 mm

  • 34 x 39 x 26 mm
  • 3,3 - 5V
  • Analog voltage
  • X and Y output

Why choose this product?

  • Analog position output – Displays X and Y position as voltage.
  • Suitable for projects – Usable with Arduino, Raspberry Pi, ESP8266, ESP32.
  • Usable on a breadboard – Can be used on a breadboard.
  • Also solderable – The module can be soldered.
Specifications
Dimensions34 x 39 x 26 mm
Operating voltage3.3/5V
Suitable forArduino, Raspberry Pi, ESP8266, ESP32

Frequently bought together

Total: € 4,75

Reviews

No reviews yet.

Write a review
Your rating

Shipping & returns

Shipping

  • Parcel with track & trace€ 7,70Within 24 hours
  • Pick up at PostNL location€ 7,40Within 24 hours
  • Letterbox parcel€ 3,70Within 2 business days
  • Letterbox parcel 24 hours€ 4,55Within 24 hours
  • Pick up in storeFree
All about shipping

Returns

Not satisfied? You have 30 days after delivery to return the product.

All about returns