

The Mini Analog Thumbstick by PiHut is a compact joystick designed for precise two-dimensional input. It features a pivoting stick that detects angular and directional movement, making it ideal for applications requiring smooth and accurate control. This component is commonly used in gaming controllers, robotic control systems, and other interactive electronic devices.








The Mini Analog Thumbstick is equipped with two potentiometers for X and Y axis detection and a tactile pushbutton for additional input functionality.
| Parameter | Value |
|---|---|
| Operating Voltage | 3.3V - 5V |
| Output Type | Analog (X and Y axes), Digital (button) |
| X-Axis Resistance | 10 kΩ |
| Y-Axis Resistance | 10 kΩ |
| Button Type | Momentary pushbutton |
| Dimensions | 26mm x 26mm x 20mm |
| Mounting Type | PCB mount |
The Mini Analog Thumbstick has 5 pins, as detailed below:
| Pin Number | Label | Description |
|---|---|---|
| 1 | GND | Ground connection |
| 2 | +VCC | Power supply (3.3V - 5V) |
| 3 | VRx | Analog output for X-axis movement |
| 4 | VRy | Analog output for Y-axis movement |
| 5 | SW | Digital output for the pushbutton (active LOW) |
+VCC pin to a 3.3V or 5V power source and the GND pin to ground.VRx and VRy pins to the analog input pins of your microcontroller (e.g., Arduino).SW pin to a digital input pin of your microcontroller. Use a pull-up resistor if necessary, as the button output is active LOW.Below is an example of how to connect the Mini Analog Thumbstick to an Arduino UNO:
| Thumbstick Pin | Arduino Pin |
|---|---|
| GND | GND |
| +VCC | 5V |
| VRx | A0 |
| VRy | A1 |
| SW | D2 |
The following code reads the X and Y axis values and detects button presses:
// Define pin connections
const int VRxPin = A0; // X-axis analog input
const int VRyPin = A1; // Y-axis analog input
const int SWPin = 2; // Pushbutton digital input
void setup() {
// Initialize serial communication for debugging
Serial.begin(9600);
// Configure the pushbutton pin as input with 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 pushbutton 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 from VRx or VRy Pins
+VCC and GND pins are properly connected.Pushbutton Not Responding
SW pin and ensure it is configured as an input.Inconsistent or Noisy Analog Readings
+VCC and GND to reduce noise.Q: Can I use the Mini Analog Thumbstick with a 3.3V microcontroller?
A: Yes, the thumbstick operates within a voltage range of 3.3V to 5V, making it compatible with 3.3V systems.
Q: How do I calibrate the joystick?
A: Read the analog values when the joystick is in its neutral position and use these as offsets in your code to normalize the readings.
Q: Is the pushbutton debounce handled automatically?
A: No, you need to implement software debounce in your code if required. This can be done by adding a small delay or using a debounce library.
Q: Can I replace the joystick cap?
A: Yes, the joystick cap is removable and can be replaced with a compatible one if needed.
By following this documentation, you can effectively integrate the Mini Analog Thumbstick into your projects for precise and reliable input control.