
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.

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.

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.

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.

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.

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.
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) |
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) |
+Vcc pin to a 3.3V or 5V power source and the GND pin to ground.VRx and VRy pins to analog input pins on your microcontroller (e.g., Arduino).SW pin to a digital input pin on your microcontroller. Use a pull-up resistor if necessary.Below is an example of how to connect the joystick to an Arduino UNO:
+Vcc → 5VGND → GNDVRx → A0VRy → A1SW → D2The 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);
}
No Output or Incorrect Readings
Analog Values Fluctuate
Button Not Detected
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.