

The Mini Analog Thumbstick by PiHut is a compact joystick designed for precise input control in gaming controllers, robotics, and other interactive devices. It provides two analog outputs (X and Y axes) and a digital button press when the joystick is pushed down. This versatile component is ideal for applications requiring smooth directional control, such as remote-controlled vehicles, robotic arms, and gaming interfaces.








The Mini Analog Thumbstick has 5 pins, as detailed in the table below:
| Pin | Name | Description |
|---|---|---|
| 1 | GND | Ground connection for the thumbstick. |
| 2 | +VCC | Power supply input (3.3V to 5V). |
| 3 | VRx | Analog output for the X-axis (horizontal movement). |
| 4 | VRy | Analog output for the Y-axis (vertical movement). |
| 5 | SW | Digital output for the push-button (active low, connects to GND when pressed). |
Power the Thumbstick:
Connect the +VCC pin to a 3.3V or 5V power source and the GND pin to ground.
Read Analog Outputs:
Read the Button Press:
Below is an example of how to interface the Mini Analog Thumbstick with an Arduino UNO:
// Pin definitions
const int VRxPin = A0; // X-axis connected to analog pin A0
const int VRyPin = A1; // Y-axis connected to analog pin A1
const int SWPin = 2; // Button connected to digital pin 2
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 the X and Y axis values (0 to 1023)
int xValue = analogRead(VRxPin);
int yValue = analogRead(VRyPin);
// Read the button state (LOW when pressed, HIGH otherwise)
int buttonState = digitalRead(SWPin);
// Print the values to the Serial Monitor
Serial.print("X: ");
Serial.print(xValue);
Serial.print(" | Y: ");
Serial.print(yValue);
Serial.print(" | Button: ");
Serial.println(buttonState == LOW ? "Pressed" : "Released");
// Add a small delay for stability
delay(100);
}
LOW when pressed and HIGH when released due to the pull-up resistor.No Output from the Joystick
Analog Values Are Not Stable
Button Not Responding
Joystick Outputs Incorrect Range
Q1: Can I use the Mini Analog Thumbstick with a 3.3V microcontroller like the ESP32?
A1: Yes, the thumbstick operates at both 3.3V and 5V. Ensure the microcontroller's analog pins are compatible with the voltage range.
Q2: How do I mount the thumbstick on a PCB?
A2: The thumbstick has through-hole pins for easy soldering onto a PCB. Ensure proper alignment and secure solder joints.
Q3: Can I use the thumbstick for digital-only applications?
A3: While the thumbstick is primarily designed for analog input, you can use the push-button for digital input in such applications.
Q4: What is the lifespan of the joystick?
A4: The Mini Analog Thumbstick is designed for durability, but its lifespan depends on usage conditions. Avoid excessive force to prolong its life.