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!
This circuit is a custom game controller featuring a SparkFun Pro Micro microcontroller, multiple tactile pushbuttons, and two analog joysticks. The Pro Micro reads inputs from the buttons and joysticks, processes them, and sends the corresponding gamepad signals. Additionally, a Raspberry Pi 4B is powered by a Pisugar S Pro battery module.
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.
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.
This circuit features an Arduino Nano microcontroller interfaced with various input devices including a 2-axis joystick, pushbutton, rotary potentiometers, and an ADXL345 accelerometer. It also includes an HC-05 Bluetooth module for wireless communication and multiple LEDs for visual feedback, all powered by a 9V battery.
Robotic control systems for movement and navigation
User interfaces for embedded systems
Camera gimbals and pan-tilt mechanisms
DIY electronics projects requiring joystick input
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
Power Supply: Connect the +VCC pin to a 3.3V or 5V power source and the GND pin to ground.
Analog Outputs: Connect the VRx and VRy pins to the analog input pins of your microcontroller (e.g., Arduino).
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
Use a stable power supply to ensure accurate readings.
Avoid applying excessive force to the joystick to prevent damage.
Use proper pull-up or pull-down resistors for the pushbutton if required.
Calibrate the joystick in your software to account for any offset or noise in the analog readings.
Troubleshooting and FAQs
Common Issues
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.
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.
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.