Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use Mini Analog Thumbstick: Examples, Pinouts, and Specs

Image of Mini Analog ThumbstickDesign with Mini Analog Thumbstick in Cirkit Designer

Introduction

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.

Explore Projects Built with Mini Analog Thumbstick

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 Raspberry Pi Pico-based PS2 Controller Emulator with ADS1115 Analog Input: A project utilizing Mini Analog Thumbstick in a practical application
Raspberry Pi Pico-based PS2 Controller Emulator with ADS1115 Analog Input

This circuit appears to be a game controller interface that uses a Raspberry Pi Pico microcontroller to emulate a PS2 controller, interfacing with a PS2 joystick and a PS2 console cable. The ADS1115 analog-to-digital converter is used to read the joystick's analog signals, and the microcontroller's SPI and I2C interfaces are utilized for communication with the PS2 console and the ADS1115, respectively. Additionally, an NPN transistor and a resistor are configured to handle the PS2 controller's acknowledge signal.

Open Project in Cirkit Designer

Common Applications

Technical Specifications

The Mini Analog Thumbstick is equipped with two potentiometers for X and Y axis detection and a tactile pushbutton for additional input functionality.

Key Specifications

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

Pin Configuration

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)

Usage Instructions

Connecting the Thumbstick

  1. Power Supply: Connect the +VCC pin to a 3.3V or 5V power source and the GND pin to ground.
  2. Analog Outputs: Connect the VRx and VRy pins to the analog input pins of your microcontroller (e.g., Arduino).
  3. Pushbutton: Connect the SW pin to a digital input pin of your microcontroller. Use a pull-up resistor if necessary, as the button output is active LOW.

Example Circuit with Arduino UNO

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

Example 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 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);
}

Best Practices

Troubleshooting and FAQs

Common Issues

  1. No Output from VRx or VRy Pins

    • Ensure the +VCC and GND pins are properly connected.
    • Verify that the analog input pins on the microcontroller are functioning correctly.
  2. Pushbutton Not Responding

    • Check the connection to the SW pin and ensure it is configured as an input.
    • Confirm that the button is not stuck or damaged.
  3. Inconsistent or Noisy Analog Readings

    • Use a decoupling capacitor (e.g., 0.1 µF) between +VCC and GND to reduce noise.
    • Ensure the joystick is not exposed to excessive vibrations or interference.

FAQs

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.